ctubbsii commented on code in PR #3389:
URL: https://github.com/apache/accumulo/pull/3389#discussion_r1190580476
##########
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;
+
+ // if the manager state is normal and the goal is the same as the state or
manager is not running, return early
+ if ((managerState === 'NORMAL' && !isStateGoalDifferent) || managerState
=== null) {
Review Comment:
> The new code does not rely on any data from `/rest/status`. The two blocks
in `refreshManagerBanners()` each pull from different endpoints and act
independently of each other.
Right, that's my point. There are two banners. The other banner pulls from
the other endpoint. The end result is that it could say something in one banner
that contradicts the other banner. For example, it could say that it it's in
safe mode *and* that it's not running at the same time. But, maybe that's not
really a problem. I just wanted to make sure we thought about those edge cases.
--
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]