Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-30612 Warn user when Platform is too old #18031

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion esp/src/eclwatch/HPCCPlatformWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ define([
"src/react/index",
"src-react/components/About",
"src-react/components/controls/ComingSoon",
"src-react/hooks/platform",

"hpcc/_TabContainerWidget",
"src/ESPRequest",
Expand Down Expand Up @@ -74,7 +75,7 @@ define([
], function (declare, lang, nlsHPCCMod, arrayUtil, dom, domConstruct, domClass, domForm, domStyle, domGeo, cookie, query, topic, xhr,
registry, Tooltip,
UpgradeBar, ColorPicker,
CodeMirror, srcReact, AboutModule, ComingSoonModule,
CodeMirror, srcReact, AboutModule, ComingSoonModule, platformModule,
_TabContainerWidget, ESPRequest, ESPActivity, ESPUtil, WsAccount, WsAccess, WsSMC, WsTopology, WsMachine, LockDialogWidget, EnvironmentTheme, Utility,
template,

Expand Down Expand Up @@ -162,6 +163,31 @@ define([
/* */
var teaserNode = dom.byId(this.id + "teaser");
srcReact.render(ComingSoonModule.ComingSoon, { style: { color: "white" } }, teaserNode);

const DAY = 1000 * 60 * 60 * 24;
platformModule.fetchCheckFeatures().then(function (features) {
if (!features || !features.BuildTagTimestamp) return;
const age = features.BuildTagTimestamp ? Math.floor((Date.now() - new Date(features.BuildTagTimestamp).getTime()) / DAY) : 0;
let message = nlsHPCC.PlatformBuildIsNNNDaysOld.replace("NNN", `${age}`);
let severity = "Info";
if (age > 90) {
severity = "Alert";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colouring of alerts in the old eclwatch looks less important than errors,

message += ` ${nlsHPCC.PleaseUpgradeToLaterPointRelease}`;
} else if (age > 60) {
severity = "Error";
message += ` ${nlsHPCC.PleaseUpgradeToLaterPointRelease}`;
} else if (age > 30) {
severity = "Warning";
message += ` ${nlsHPCC.PleaseUpgradeToLaterPointRelease}`;
} else {
severity = "Info";
}
dojo.publish("hpcc/brToaster", {
Severity: severity,
Source: "eclwatch/HPCCPlatformWidget.js",
Exceptions: [{ Source: "", Message: message }]
});
});
},

// Implementation ---
Expand Down
7 changes: 4 additions & 3 deletions esp/src/eclwatch/InfoGridWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,11 @@ define([
if (item) {
var severity = this.store.getValue(item, "Severity", null);
if (severity === "Error") {
row.customStyles += "background-color: red;";
row.customStyles += "background-color: #fe8147;";
} else if (severity === "Alert") {
row.customStyles += "background-color: #febe47;";
row.customStyles += "background-color: #ff1e00;";
} else if (severity === "Warning") {
row.customStyles += "background-color: yellow;";
row.customStyles += "background-color: #ffee00;";
}
}
this.infoGrid.focus.styleRow(row);
Expand Down Expand Up @@ -337,6 +337,7 @@ define([
break;
case "Alert":
this._counts.alert++;
this._counts.errorWarning++;
if (errorChecked) {
data.push(item);
}
Expand Down
26 changes: 17 additions & 9 deletions esp/src/eclwatch/css/hpcc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1646,19 +1646,27 @@ margin-left:-20px;
color:#fff;
}

.dijitToasterWarning,
.dijitToasterAlert,
.dijitToasterWarning {
font-weight: bold;
}

.dijitToasterError,
.dijitToasterFatal{
font-weight:bold;
color:#fff;
.dijitToasterFatal {
font-weight: bold;
color: #fff;
}

.dijitToasterWarning .dijitToasterContent {
background: #ffee00;
}

.dijitToasterWarning .dijitToasterContent{
background:#d4d943;
}
.dijitToasterError .dijitToasterContent {
background: #fe8147;
}

.dijitToasterError .dijitToasterContent{
background:#c46600;
.dijitToasterAlert .dijitToasterContent {
background: #ff1e00;
}

/* imported from dijit.css */
Expand Down
Loading
Loading