ctubbsii commented on code in PR #3389:
URL: https://github.com/apache/accumulo/pull/3389#discussion_r1190583303
##########
server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/manager.js:
##########
@@ -25,29 +25,52 @@
var managerStatusTable, recoveryListTable;
-function refreshManagerBanner() {
+function refreshManagerBanners() {
getStatus().then(function () {
- var managerStatus = JSON.parse(sessionStorage.status).managerStatus;
+ const managerStatus = JSON.parse(sessionStorage.status).managerStatus;
// If manager status is error
if (managerStatus === 'ERROR') {
- // show banner and hide table
- $('#managerBanner').show();
+ // show the manager error banner and hide table
+ $('#managerRunningBanner').show();
$('#managerStatus_wrapper').hide();
} else {
- // otherwise, hide banner and show table
- $('#managerBanner').hide();
+ // otherwise, hide the error banner and show manager table
+ $('#managerRunningBanner').hide();
$('#managerStatus_wrapper').show();
}
});
+
+ getManager().then(function () {
+ const managerData = JSON.parse(sessionStorage.manager);
+ const managerState = managerData.managerState;
+ const managerGoalState = managerData.managerGoalState;
+
+ const isStateGoalDifferent = managerState !== managerGoalState;
Review Comment:
> We don't have much error handling anywhere in the monitor code but I could
add a catch block in this case to `console.error` the error.
If there's an error, I think it would show up on the console anyway. I was
mostly thinking about making sure the rendered view was sensible in those edge
cases. I think if it errors, then it will keep whatever the current message is,
whether it's hidden or shown on the page. That could lead to user confusion if
it contradicts the message in the other banner about the manager not running.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]