|
@@ -1,8 +1,7 @@
|
|
|
define([
|
|
|
"dojo/_base/declare",
|
|
|
"dojo/_base/lang",
|
|
|
- "dojo/i18n",
|
|
|
- "dojo/i18n!./nls/hpcc",
|
|
|
+ "src/nlsHPCC",
|
|
|
"dojo/_base/array",
|
|
|
"dojo/dom",
|
|
|
"dojo/dom-construct",
|
|
@@ -58,7 +57,7 @@ define([
|
|
|
"hpcc/TableContainer",
|
|
|
"hpcc/InfoGridWidget"
|
|
|
|
|
|
-], function(declare, lang, i18n, nlsHPCC, arrayUtil, dom, domConstruct, domClass, domForm, domStyle, domGeo, cookie, query, topic, xhr,
|
|
|
+], function (declare, lang, nlsHPCCMod, arrayUtil, dom, domConstruct, domClass, domForm, domStyle, domGeo, cookie, query, topic, xhr,
|
|
|
registry, Tooltip,
|
|
|
UpgradeBar, ColorPicker,
|
|
|
CodeMirror, srcReact,
|
|
@@ -73,6 +72,7 @@ define([
|
|
|
_huePickerPointerAlly: "/esp/files/eclwatch/img/hueHandleA11y.png"
|
|
|
});
|
|
|
|
|
|
+ var nlsHPCC = nlsHPCCMod.default;
|
|
|
return declare("HPCCPlatformWidget", [_TabContainerWidget], {
|
|
|
templateString: template,
|
|
|
baseClass: "HPCCPlatformWidget",
|
|
@@ -82,7 +82,7 @@ define([
|
|
|
upgradeBar: null,
|
|
|
storage: null,
|
|
|
|
|
|
- postCreate: function(args) {
|
|
|
+ postCreate: function (args) {
|
|
|
this.inherited(arguments);
|
|
|
this.searchText = registry.byId(this.id + "FindText");
|
|
|
this.logoutBtn = registry.byId(this.id + "Logout");
|
|
@@ -112,7 +112,7 @@ define([
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- startup: function(args) {
|
|
|
+ startup: function (args) {
|
|
|
this.inherited(arguments);
|
|
|
domStyle.set(dom.byId(this.id + "StackController_stub_Plugins").parentNode.parentNode, {
|
|
|
visibility: "hidden"
|
|
@@ -126,7 +126,7 @@ define([
|
|
|
},
|
|
|
|
|
|
// Implementation ---
|
|
|
- refreshBanner: function(activity) {
|
|
|
+ refreshBanner: function (activity) {
|
|
|
if (this.showBanner !== activity.ShowBanner ||
|
|
|
this.bannerContent !== activity.BannerContent ||
|
|
|
this.bannerScroll !== activity.BannerScroll ||
|
|
@@ -152,7 +152,7 @@ define([
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- refreshUserName: function() {
|
|
|
+ refreshUserName: function () {
|
|
|
if (this.userName) {
|
|
|
dom.byId(this.id + "UserID").textContent = this.userName;
|
|
|
} else if (cookie("ESPUserName")) {
|
|
@@ -163,7 +163,7 @@ define([
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- init: function(params) {
|
|
|
+ init: function (params) {
|
|
|
if (this.inherited(arguments))
|
|
|
return;
|
|
|
|
|
@@ -171,7 +171,7 @@ define([
|
|
|
|
|
|
WsMachine.GetComponentStatus({
|
|
|
request: {}
|
|
|
- }).then(function(response) {
|
|
|
+ }).then(function (response) {
|
|
|
if (lang.exists("GetComponentStatusResponse.ComponentStatus", response)) {
|
|
|
dojoConfig.monitoringEnabled = true;
|
|
|
var status = response.GetComponentStatusResponse.ComponentStatus
|
|
@@ -181,7 +181,7 @@ define([
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- WsAccount.MyAccount({}).then(function(response) {
|
|
|
+ WsAccount.MyAccount({}).then(function (response) {
|
|
|
if (lang.exists("MyAccountResponse.username", response)) {
|
|
|
context.userName = response.MyAccountResponse.username;
|
|
|
dojoConfig.username = response.MyAccountResponse.username;
|
|
@@ -215,7 +215,7 @@ define([
|
|
|
|
|
|
WsTopology.TpGetServicePlugins({
|
|
|
request: {}
|
|
|
- }).then(function(response) {
|
|
|
+ }).then(function (response) {
|
|
|
if (lang.exists("TpGetServicePluginsResponse.Plugins.Plugin", response) && response.TpGetServicePluginsResponse.Plugins.Plugin.length) {
|
|
|
domStyle.set(dom.byId(context.id + "StackController_stub_Plugins").parentNode.parentNode, {
|
|
|
visibility: "visible"
|
|
@@ -223,12 +223,12 @@ define([
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- WsTopology.TpGetServerVersion().then(function(buildVersion) {
|
|
|
+ WsTopology.TpGetServerVersion().then(function (buildVersion) {
|
|
|
context.build = WsSMC.parseBuildString(buildVersion);
|
|
|
});
|
|
|
|
|
|
this.activity = ESPActivity.Get();
|
|
|
- this.activity.watch("__hpcc_changedCount", function(name, oldValue, newValue) {
|
|
|
+ this.activity.watch("__hpcc_changedCount", function (name, oldValue, newValue) {
|
|
|
context.refreshBanner(context.activity);
|
|
|
});
|
|
|
|
|
@@ -241,19 +241,19 @@ define([
|
|
|
this.initTab();
|
|
|
this.checkIfSessionsAreActive();
|
|
|
|
|
|
- topic.subscribe("hpcc/monitoring_component_update", function(topic) {
|
|
|
+ topic.subscribe("hpcc/monitoring_component_update", function (topic) {
|
|
|
context.checkMonitoring(topic.status);
|
|
|
});
|
|
|
this.storage = new ESPUtil.LocalStorage();
|
|
|
|
|
|
- this.storage.on("storageUpdate", function(msg) {
|
|
|
+ this.storage.on("storageUpdate", function (msg) {
|
|
|
context._onUpdateFromStorage(msg)
|
|
|
});
|
|
|
this.storage.setItem("Status", "Unlocked");
|
|
|
|
|
|
EnvironmentTheme.checkCurrentState(this.id, this);
|
|
|
|
|
|
- this.environmentTextCB.on("change", function(state) {
|
|
|
+ this.environmentTextCB.on("change", function (state) {
|
|
|
if (state) {
|
|
|
context.environmentText.set("disabled", false);
|
|
|
} else {
|
|
@@ -262,7 +262,7 @@ define([
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- _onUpdateFromStorage: function(msg) {
|
|
|
+ _onUpdateFromStorage: function (msg) {
|
|
|
var context = this;
|
|
|
if (msg.event.newValue === "logged_out") {
|
|
|
window.location.reload();
|
|
@@ -273,7 +273,7 @@ define([
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- initTab: function() {
|
|
|
+ initTab: function () {
|
|
|
var currSel = this.getSelectedChild();
|
|
|
if (currSel && !currSel.initalized) {
|
|
|
if (currSel.init) {
|
|
@@ -282,18 +282,18 @@ define([
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- getTitle: function() {
|
|
|
+ getTitle: function () {
|
|
|
return "ECL Watch";
|
|
|
},
|
|
|
|
|
|
- checkMonitoring: function(status) {
|
|
|
+ checkMonitoring: function (status) {
|
|
|
if (status) {
|
|
|
domClass.remove("MonitorStatus");
|
|
|
domClass.add("MonitorStatus", status);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- checkIfAdmin: function(user) {
|
|
|
+ checkIfAdmin: function (user) {
|
|
|
var context = this;
|
|
|
if (user == null) {
|
|
|
registry.byId(context.id + "SetBanner").set("disabled", false);
|
|
@@ -305,7 +305,7 @@ define([
|
|
|
request: {
|
|
|
username: user
|
|
|
}
|
|
|
- }).then(function(response) {
|
|
|
+ }).then(function (response) {
|
|
|
if (lang.exists("UserEditResponse.isLDAPAdmin", response)) {
|
|
|
if (response.UserEditResponse.isLDAPAdmin === true) {
|
|
|
dojoConfig.isAdmin = true;
|
|
@@ -318,7 +318,7 @@ define([
|
|
|
}
|
|
|
} else {
|
|
|
if (lang.exists("UserEditResponse.Groups.Group", response)) {
|
|
|
- arrayUtil.some(response.UserEditResponse.Groups.Group, function(item, idx) {
|
|
|
+ arrayUtil.some(response.UserEditResponse.Groups.Group, function (item, idx) {
|
|
|
if (item.name === "Administrators" || item.name === "Directory Administrators") {
|
|
|
dojoConfig.isAdmin = true;
|
|
|
registry.byId(context.id + "SetBanner").set("disabled", false);
|
|
@@ -335,7 +335,7 @@ define([
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- checkIfSessionsAreActive: function() {
|
|
|
+ checkIfSessionsAreActive: function () {
|
|
|
if (cookie("ESPSessionTimeoutSeconds")) {
|
|
|
this.logoutBtn.set("disabled", false);
|
|
|
this.lockBtn.set("disabled", false);
|
|
@@ -344,12 +344,12 @@ define([
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- setEnvironmentTheme: function() {
|
|
|
+ setEnvironmentTheme: function () {
|
|
|
EnvironmentTheme.setEnvironmentTheme(this.id, this);
|
|
|
},
|
|
|
|
|
|
// Hitched actions ---
|
|
|
- _onUserID: function(evt) {
|
|
|
+ _onUserID: function (evt) {
|
|
|
var userDialog = registry.byId(this.id + "UserDialog");
|
|
|
var userInfo = registry.byId(this.id + "UserInfo");
|
|
|
if (!userInfo.init({
|
|
@@ -361,53 +361,53 @@ define([
|
|
|
userDialog.show();
|
|
|
},
|
|
|
|
|
|
- _onFind: function(evt) {
|
|
|
+ _onFind: function (evt) {
|
|
|
var context = this;
|
|
|
this.stackContainer.selectChild(this.mainPage);
|
|
|
- this.mainPage.ensureWidget().then(function(mainPage) {
|
|
|
+ this.mainPage.ensureWidget().then(function (mainPage) {
|
|
|
mainPage.widget.TabContainer.selectChild(mainPage.widget._Search);
|
|
|
- mainPage.widget._Search.ensureWidget().then(function(searchPage) {
|
|
|
+ mainPage.widget._Search.ensureWidget().then(function (searchPage) {
|
|
|
searchPage.doSearch(context.searchText.get("value"));
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- _openNewTab: function(url) {
|
|
|
+ _openNewTab: function (url) {
|
|
|
var win = window.open(url, "_blank");
|
|
|
if (win && win.focus) {
|
|
|
win.focus();
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- _onOpenResources: function(evt) {
|
|
|
+ _onOpenResources: function (evt) {
|
|
|
this._openNewTab("https://hpccsystems.com/download");
|
|
|
},
|
|
|
|
|
|
- _onOpenDocuments: function(evt) {
|
|
|
+ _onOpenDocuments: function (evt) {
|
|
|
this._openNewTab("https://hpccsystems.com/training/documentation");
|
|
|
},
|
|
|
|
|
|
- _onOpenJira: function(evt) {
|
|
|
+ _onOpenJira: function (evt) {
|
|
|
this._openNewTab("https://track.hpccsystems.com/issues");
|
|
|
},
|
|
|
|
|
|
- _onOpenForums: function(evt) {
|
|
|
+ _onOpenForums: function (evt) {
|
|
|
this._openNewTab("https://hpccsystems.com/bb/");
|
|
|
},
|
|
|
|
|
|
- _onOpenRedBook: function(evt) {
|
|
|
+ _onOpenRedBook: function (evt) {
|
|
|
this._openNewTab("https://wiki.hpccsystems.com/x/fYAb");
|
|
|
},
|
|
|
|
|
|
- _onOpenReleaseNotes: function(evt) {
|
|
|
+ _onOpenReleaseNotes: function (evt) {
|
|
|
this._openNewTab("https://hpccsystems.com/download/release-notes");
|
|
|
},
|
|
|
|
|
|
- _onOpenTransitionGuide: function(evt) {
|
|
|
+ _onOpenTransitionGuide: function (evt) {
|
|
|
this._openNewTab("https://wiki.hpccsystems.com/display/hpcc/HPCC+ECL+Watch+5.0+Transition+Guide");
|
|
|
},
|
|
|
|
|
|
- _onOpenConfiguration: function(evt) {
|
|
|
+ _onOpenConfiguration: function (evt) {
|
|
|
var context = this;
|
|
|
if (!this.configText) {
|
|
|
ESPRequest.send("main", "", {
|
|
@@ -416,7 +416,7 @@ define([
|
|
|
PlainText: "yes"
|
|
|
},
|
|
|
handleAs: "text"
|
|
|
- }).then(function(response) {
|
|
|
+ }).then(function (response) {
|
|
|
context.configText = context.formatXml(response);
|
|
|
context.configSourceCM = CodeMirror.fromTextArea(dom.byId(context.id + "ConfigTextArea"), {
|
|
|
tabMode: "indent",
|
|
@@ -434,24 +434,24 @@ define([
|
|
|
this.stackContainer.selectChild(this.widget._Config);
|
|
|
},
|
|
|
|
|
|
- _onOpenErrWarn: function(evt) {
|
|
|
+ _onOpenErrWarn: function (evt) {
|
|
|
this.stackContainer.selectChild(this.errWarnPage);
|
|
|
},
|
|
|
|
|
|
- _ondebugLanguageFiles: function() {
|
|
|
+ _ondebugLanguageFiles: function () {
|
|
|
var context = this;
|
|
|
- require(["hpcc/nls/hpcc"], function(lang) {
|
|
|
+ require(["src/nls/hpcc"], function (lang) {
|
|
|
var languageID = [];
|
|
|
var languageRequire = [];
|
|
|
for (var key in lang) {
|
|
|
if (key !== "root") {
|
|
|
languageID.push(key);
|
|
|
- languageRequire.push("hpcc/nls/" + key + "/hpcc");
|
|
|
+ languageRequire.push("src/nls/" + key + "/hpcc");
|
|
|
}
|
|
|
}
|
|
|
- require(languageRequire, function() {
|
|
|
+ require(languageRequire, function () {
|
|
|
var errWarnGrid = registry.byId(context.id + "ErrWarnGrid");
|
|
|
- arrayUtil.forEach(arguments, function(otherLang, idx) {
|
|
|
+ arrayUtil.forEach(arguments, function (otherLang, idx) {
|
|
|
var langID = languageID[idx];
|
|
|
for (var key in lang.root) {
|
|
|
if (!otherLang[key]) {
|
|
@@ -486,39 +486,39 @@ define([
|
|
|
},
|
|
|
|
|
|
_onAboutLoaded: false,
|
|
|
- _onAbout: function(evt) {
|
|
|
+ _onAbout: function (evt) {
|
|
|
var aboutNode = dom.byId(this.id + "AboutDialog");
|
|
|
srcReact.render(srcReact.AboutDialog, {
|
|
|
version: this.build.orig,
|
|
|
- handleClose: function() {
|
|
|
+ handleClose: function () {
|
|
|
srcReact.unrender(aboutNode);
|
|
|
}
|
|
|
}, aboutNode);
|
|
|
},
|
|
|
|
|
|
- _onShowLock: function(evt) {
|
|
|
+ _onShowLock: function (evt) {
|
|
|
var LockDialog = new LockDialogWidget({});
|
|
|
LockDialog.show()
|
|
|
},
|
|
|
|
|
|
- _onLock: function(evt) {
|
|
|
+ _onLock: function (evt) {
|
|
|
var LockDialog = new LockDialogWidget({});
|
|
|
LockDialog._onLock();
|
|
|
},
|
|
|
|
|
|
- _onHideLock: function(evt) {
|
|
|
+ _onHideLock: function (evt) {
|
|
|
var LockDialog = new LockDialogWidget({});
|
|
|
LockDialog.hide();
|
|
|
},
|
|
|
|
|
|
- _onLogout: function(evt) {
|
|
|
+ _onLogout: function (evt) {
|
|
|
var context = this;
|
|
|
this.logoutConfirm.show();
|
|
|
query(".dijitDialogUnderlay").style("opacity", "0.5");
|
|
|
- this.logoutConfirm.on("execute", function() {
|
|
|
+ this.logoutConfirm.on("execute", function () {
|
|
|
xhr("esp/logout", {
|
|
|
method: "post"
|
|
|
- }).then(function(data) {
|
|
|
+ }).then(function (data) {
|
|
|
if (data) {
|
|
|
cookie("ECLWatchUser", "", { expires: -1 });
|
|
|
cookie("ESPSessionID" + location.port + " = '' ", "", { expires: -1 });
|
|
@@ -531,16 +531,16 @@ define([
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- _onMonitoring: function(evt) {
|
|
|
+ _onMonitoring: function (evt) {
|
|
|
this.stackContainer.selectChild(this.operationsPage);
|
|
|
- this.operationsPage.ensureWidget().then(function(operationsPage) {
|
|
|
- operationsPage.widget._Topology.ensureWidget().then(function(topologyPage) { // This is needed otherwise topology will steal focus the first time it is delay loaded
|
|
|
+ this.operationsPage.ensureWidget().then(function (operationsPage) {
|
|
|
+ operationsPage.widget._Topology.ensureWidget().then(function (topologyPage) { // This is needed otherwise topology will steal focus the first time it is delay loaded
|
|
|
operationsPage.selectChild(operationsPage.widget._Monitoring);
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- _onSetBanner: function(evt) {
|
|
|
+ _onSetBanner: function (evt) {
|
|
|
registry.byId(this.id + "ShowBanner").set("value", this.activity.ShowBanner);
|
|
|
dom.byId(this.id + "BannerContent").value = this.activity.BannerContent;
|
|
|
dom.byId(this.id + "BannerColor").value = this.activity.BannerColor;
|
|
@@ -549,35 +549,35 @@ define([
|
|
|
this.setBannerDialog.show();
|
|
|
},
|
|
|
|
|
|
- _onSetBannerOk: function(evt) {
|
|
|
+ _onSetBannerOk: function (evt) {
|
|
|
this.activity.setBanner(domForm.toObject(this.id + "SetBannerForm"));
|
|
|
this.setBannerDialog.hide();
|
|
|
},
|
|
|
|
|
|
- _onSetBannerCancel: function(evt) {
|
|
|
+ _onSetBannerCancel: function (evt) {
|
|
|
this.setBannerDialog.hide();
|
|
|
},
|
|
|
|
|
|
- _onSetToolbar: function(evt) {
|
|
|
+ _onSetToolbar: function (evt) {
|
|
|
this.setToolbarDialog.show();
|
|
|
},
|
|
|
|
|
|
- _onSetToolbarOk: function(evt) {
|
|
|
+ _onSetToolbarOk: function (evt) {
|
|
|
this.setEnvironmentTheme();
|
|
|
},
|
|
|
|
|
|
- _onSetToolbarCancel: function(evt) {
|
|
|
+ _onSetToolbarCancel: function (evt) {
|
|
|
this.setToolbarDialog.hide();
|
|
|
},
|
|
|
|
|
|
- _onSetToolbarReset: function(evt) {
|
|
|
+ _onSetToolbarReset: function (evt) {
|
|
|
if (confirm(this.i18n.AreYouSureYouWantToResetTheme)) {
|
|
|
EnvironmentTheme._onResetDefaultTheme(this.id, this);
|
|
|
this._onSetToolbarCancel();
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- createStackControllerTooltip: function(widgetID, text) {
|
|
|
+ createStackControllerTooltip: function (widgetID, text) {
|
|
|
return new Tooltip({
|
|
|
connectId: [this.id + "StackController_" + widgetID],
|
|
|
label: text,
|