From 600fcc134ec266af02ff6bf31bd02e2246b562b5 Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:19:52 -0500 Subject: [PATCH] HPCC-32866 ECL Watch v5 disable tabs in containerized envs Fixes an issue in ECL Watch where "legacy" tabs in the operations section are unavailable, and attempts to reach them result in the page displaying a cryptic exception message from ESP Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- .../eclwatch/ClusterProcessesQueryWidget.js | 19 +++++++++++++++---- esp/src/eclwatch/SystemServersQueryWidget.js | 19 +++++++++++++++---- esp/src/eclwatch/TargetClustersQueryWidget.js | 19 +++++++++++++++---- esp/src/src/nls/hpcc.ts | 1 + 4 files changed, 46 insertions(+), 12 deletions(-) diff --git a/esp/src/eclwatch/ClusterProcessesQueryWidget.js b/esp/src/eclwatch/ClusterProcessesQueryWidget.js index 87ac7d5b130..3de56646a9c 100644 --- a/esp/src/eclwatch/ClusterProcessesQueryWidget.js +++ b/esp/src/eclwatch/ClusterProcessesQueryWidget.js @@ -2,6 +2,7 @@ define([ "dojo/_base/declare", "src/nlsHPCC", "dojo/topic", + "dojo/dom-construct", "dijit/registry", @@ -20,7 +21,7 @@ define([ "hpcc/IFrameWidget", "dijit/Dialog", -], function (declare, nlsHPCCMod, topic, +], function (declare, nlsHPCCMod, topic, domConstruct, registry, tree, selector, GridDetailsWidget, ESPPreflight, ESPRequest, WsTopology, Utility, ESPUtil, DelayLoadWidget, PreflightDetailsWidget, MachineInformationWidget, IFrameWidget) { @@ -50,6 +51,10 @@ define([ style: "border: 0; width: 100%; height: 100%" }); this.legacyClustersProcessesIframeWidget.placeAt(this._tabContainer, "last"); + if (dojoConfig.isContainer) { + const legacyTab = registry.byId(this.id + "_LegacyClustersProcessesIframeWidget"); + legacyTab.set("disabled", true); + } }, init: function (params) { @@ -85,9 +90,15 @@ define([ if (currSel.id === this.id + "_Grid") { this.refreshGrid(); } else if (currSel.id === this.legacyClustersProcessesIframeWidget.id && !this.legacyClustersProcessesIframeWidget.initalized) { - this.legacyClustersProcessesIframeWidget.init({ - src: ESPRequest.getBaseURL("WsTopology") + "/TpClusterQuery?Type=ROOT" - }); + if (!dojoConfig.isContainer) { + this.legacyClustersProcessesIframeWidget.init({ + src: ESPRequest.getBaseURL("WsTopology") + "/TpClusterQuery?Type=ROOT" + }); + } else { + const unavailMsg = domConstruct.create("div", { style: { margin: "5px" } }); + unavailMsg.innerText = this.i18n.UnavailableInContainerized; + this.legacyClustersProcessesIframeWidget.contentPane.set("content", unavailMsg); + } } else { currSel.init(currSel.params); } diff --git a/esp/src/eclwatch/SystemServersQueryWidget.js b/esp/src/eclwatch/SystemServersQueryWidget.js index b18f08e6c01..0acf7ea9d68 100644 --- a/esp/src/eclwatch/SystemServersQueryWidget.js +++ b/esp/src/eclwatch/SystemServersQueryWidget.js @@ -4,6 +4,7 @@ define([ "dojo/_base/array", "dojo/dom-class", "dojo/topic", + "dojo/dom-construct", "dijit/registry", "dijit/Dialog", @@ -21,7 +22,7 @@ define([ "hpcc/PreflightDetailsWidget", "hpcc/MachineInformationWidget", "hpcc/IFrameWidget" -], function (declare, nlsHPCCMod, arrayUtil, domClass, topic, +], function (declare, nlsHPCCMod, arrayUtil, domClass, topic, domConstruct, registry, Dialog, tree, selector, GridDetailsWidget, ESPPreflight, ESPRequest, WsTopology, Utility, ESPUtil, DelayLoadWidget, PreflightDetailsWidget, MachineInformationWidget, IFrameWidget) { @@ -71,9 +72,15 @@ define([ if (currSel.id === this.id + "_Grid") { this.refreshGrid(); } else if (currSel.id === this.systemServersQueryWidgetIframeWidget.id && !this.systemServersQueryWidgetIframeWidget.initalized) { - this.systemServersQueryWidgetIframeWidget.init({ - src: ESPRequest.getBaseURL("WsTopology") + "/TpServiceQuery?Type=ALLSERVICES" - }); + if (!dojoConfig.isContainer) { + this.systemServersQueryWidgetIframeWidget.init({ + src: ESPRequest.getBaseURL("WsTopology") + "/TpServiceQuery?Type=ALLSERVICES" + }); + } else { + const unavailMsg = domConstruct.create("div", { style: { margin: "5px" } }); + unavailMsg.innerText = this.i18n.UnavailableInContainerized; + this.systemServersQueryWidgetIframeWidget.contentPane.set("content", unavailMsg); + } } else { currSel.init(currSel.params); } @@ -139,6 +146,10 @@ define([ style: "border: 0; width: 100%; height: 100%" }); this.systemServersQueryWidgetIframeWidget.placeAt(this._tabContainer, "last"); + if (dojoConfig.isContainer) { + const legacyTab = registry.byId(this.id + "_SystemServersQueryWidgetIframeWidget"); + legacyTab.set("disabled", true); + } }, createGrid: function (domID) { diff --git a/esp/src/eclwatch/TargetClustersQueryWidget.js b/esp/src/eclwatch/TargetClustersQueryWidget.js index c58d4b175ee..85e33130515 100644 --- a/esp/src/eclwatch/TargetClustersQueryWidget.js +++ b/esp/src/eclwatch/TargetClustersQueryWidget.js @@ -2,6 +2,7 @@ define([ "dojo/_base/declare", "src/nlsHPCC", "dojo/topic", + "dojo/dom-construct", "dijit/registry", @@ -20,7 +21,7 @@ define([ "hpcc/IFrameWidget", "dijit/Dialog", -], function (declare, nlsHPCCMod, topic, +], function (declare, nlsHPCCMod, topic, domConstruct, registry, tree, selector, GridDetailsWidget, PreflightDetailsWidget, ESPPreflight, ESPRequest, WsTopology, Utility, DelayLoadWidget, ESPUtil, MachineInformationWidget, IFrameWidget) { @@ -61,9 +62,15 @@ define([ if (currSel.id === this.id + "_Grid") { this.refreshGrid(); } else if (currSel.id === this.legacyTargetClustersIframeWidget.id && !this.legacyTargetClustersIframeWidget.initalized) { - this.legacyTargetClustersIframeWidget.init({ - src: ESPRequest.getBaseURL("WsTopology") + "/TpTargetClusterQuery?Type=ROOT" - }); + if (!dojoConfig.isContainer) { + this.legacyTargetClustersIframeWidget.init({ + src: ESPRequest.getBaseURL("WsTopology") + "/TpTargetClusterQuery?Type=ROOT" + }); + } else { + const unavailMsg = domConstruct.create("div", { style: { margin: "5px" } }); + unavailMsg.innerText = this.i18n.UnavailableInContainerized; + this.legacyTargetClustersIframeWidget.contentPane.set("content", unavailMsg); + } } else if (currSel.params.newPreflight || currSel.params.Usergenerated) { //prevents loop of pfTab.init above currSel.init(currSel.params); } @@ -88,6 +95,10 @@ define([ style: "border: 0; width: 100%; height: 100%" }); this.legacyTargetClustersIframeWidget.placeAt(this._tabContainer, "last"); + if (dojoConfig.isContainer) { + const legacyTab = registry.byId(this.id + "_LegacyTargetClustersIframeWidget"); + legacyTab.set("disabled", true); + } this.machineFilter.disable(); }, diff --git a/esp/src/src/nls/hpcc.ts b/esp/src/src/nls/hpcc.ts index 6c87a0415a7..e1ed54e8c32 100644 --- a/esp/src/src/nls/hpcc.ts +++ b/esp/src/src/nls/hpcc.ts @@ -1064,6 +1064,7 @@ export = { Text: "Text", Tree: "Tree", Type: "Type", + UnavailableInContainerized: "This is unavailable in a containerized environment.", Unbound: "unbound", undefined: "undefined", Unknown: "Unknown",