From 0358bfe49d7beaf0b58e6de9daee0327207c890b Mon Sep 17 00:00:00 2001 From: avillarreal Date: Wed, 7 Oct 2026 14:58:08 -0500 Subject: [PATCH 01/11] Add new logic to determine server icon status --- .../accumulo/monitor/resources/js/navbar.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 7c2e1b798d8..5cca7ea6af0 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -99,6 +99,16 @@ function updateServerCount(elementId, status) { const responding = Math.max(0, total - problem); $element.text(`${responding}/${total}`); + + if (responding === total){ + return STATUS.OK; + } + else if (responding !== 0 && responding < total){ + return STATUS.WARN; + } + else if (responding === 0 && total > 0){ + return STATUS.ERROR; + } } /** @@ -130,11 +140,12 @@ function updateServerNotifications(statusData) { } NAVBAR_COMPONENTS.forEach(function (component, index) { - updateServerCount(component.countId, componentData[index]); + const serverStatus = updateServerCount(component.countId, componentData[index]); if (index === 0) { return; } - updateElementStatus(component.indicatorId, componentStatuses[index]); + + updateElementStatus(component.indicatorId, serverStatus); }); // Setting overall servers status notification From 292b08b89e0b7a8ecb3dad216079594cc7e071e1 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Wed, 7 Oct 2026 15:48:18 -0500 Subject: [PATCH 02/11] Add STATUS.OK to another condition --- .../org/apache/accumulo/monitor/resources/js/navbar.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 5cca7ea6af0..0f5bf231056 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -91,7 +91,7 @@ function updateServerCount(elementId, status) { if (!status || Number(status.serverCount) <= 0) { $element.text('0/0'); - return; + return STATUS.OK; } const total = Number(status.serverCount); @@ -144,7 +144,6 @@ function updateServerNotifications(statusData) { if (index === 0) { return; } - updateElementStatus(component.indicatorId, serverStatus); }); From ed4ba697df195264a53bcb17f32514f1d423f694 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Fri, 9 Oct 2026 11:51:22 -0500 Subject: [PATCH 03/11] Moving scan server icon status logic to function.js --- .../accumulo/monitor/resources/js/functions.js | 10 +++++++++- .../accumulo/monitor/resources/js/navbar.js | 17 +++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js index bbe619a5c01..81c53567883 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js @@ -575,11 +575,19 @@ function getStoredStatusData() { } function getComponentStatus(statusData, componentType) { + const status = statusData.componentStatuses[componentType]; + + // trying to add a variable for the component's countId to get the server count + //const componentStatusCount = NAVBAR_COMPONENTS[componentType].countId; + + if (!status.hasServers && componentType === 'SCAN_SERVER'){ + return 'OK'; + } + if (!statusData || !statusData.componentStatuses) { return 'ERROR'; } - var status = statusData.componentStatuses[componentType]; if (!status || !status.hasServers) { return 'ERROR'; } diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 0f5bf231056..09c9ec08a6a 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -91,24 +91,13 @@ function updateServerCount(elementId, status) { if (!status || Number(status.serverCount) <= 0) { $element.text('0/0'); - return STATUS.OK; } - + const total = Number(status.serverCount); const problem = Number(status.problemServerCount || 0); const responding = Math.max(0, total - problem); $element.text(`${responding}/${total}`); - - if (responding === total){ - return STATUS.OK; - } - else if (responding !== 0 && responding < total){ - return STATUS.WARN; - } - else if (responding === 0 && total > 0){ - return STATUS.ERROR; - } } /** @@ -140,11 +129,11 @@ function updateServerNotifications(statusData) { } NAVBAR_COMPONENTS.forEach(function (component, index) { - const serverStatus = updateServerCount(component.countId, componentData[index]); + updateServerCount(component.countId, componentData[index]); if (index === 0) { return; } - updateElementStatus(component.indicatorId, serverStatus); + updateElementStatus(component.indicatorId,componentStatuses[index]); }); // Setting overall servers status notification From 00430069c270d496dc4f0db26028f42573a053a8 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Fri, 9 Oct 2026 11:54:19 -0500 Subject: [PATCH 04/11] Restore navbar.js --- .../org/apache/accumulo/monitor/resources/js/navbar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 09c9ec08a6a..0fac2ed5432 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -91,8 +91,8 @@ function updateServerCount(elementId, status) { if (!status || Number(status.serverCount) <= 0) { $element.text('0/0'); + return; } - const total = Number(status.serverCount); const problem = Number(status.problemServerCount || 0); const responding = Math.max(0, total - problem); @@ -133,7 +133,7 @@ function updateServerNotifications(statusData) { if (index === 0) { return; } - updateElementStatus(component.indicatorId,componentStatuses[index]); + updateElementStatus(component.indicatorId, componentStatuses[index]); }); // Setting overall servers status notification From cc4df5a95b88d6195bd339bce6f62b125d278f79 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Fri, 9 Oct 2026 11:54:52 -0500 Subject: [PATCH 05/11] Restore navbar.js --- .../resources/org/apache/accumulo/monitor/resources/js/navbar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 0fac2ed5432..087f657230b 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -93,6 +93,7 @@ function updateServerCount(elementId, status) { $element.text('0/0'); return; } + const total = Number(status.serverCount); const problem = Number(status.problemServerCount || 0); const responding = Math.max(0, total - problem); From f70288925c87c691bc7f45fa23b4dcc20f0b9368 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Fri, 9 Oct 2026 12:09:57 -0500 Subject: [PATCH 06/11] Add new method to return server counts for component, for use in functions.js --- .../apache/accumulo/monitor/resources/js/functions.js | 5 +++-- .../apache/accumulo/monitor/resources/js/navbar.js | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js index 81c53567883..64232f01fbd 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js @@ -577,8 +577,9 @@ function getStoredStatusData() { function getComponentStatus(statusData, componentType) { const status = statusData.componentStatuses[componentType]; - // trying to add a variable for the component's countId to get the server count - //const componentStatusCount = NAVBAR_COMPONENTS[componentType].countId; + // trying to get the component's server counts + const respondingServers = getServerCounts().at(0); + const totalServers = getServerCounts().at(1); if (!status.hasServers && componentType === 'SCAN_SERVER'){ return 'OK'; diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 087f657230b..0c8f621009f 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -93,7 +93,7 @@ function updateServerCount(elementId, status) { $element.text('0/0'); return; } - + const total = Number(status.serverCount); const problem = Number(status.problemServerCount || 0); const responding = Math.max(0, total - problem); @@ -101,6 +101,15 @@ function updateServerCount(elementId, status) { $element.text(`${responding}/${total}`); } +function getServerCounts(component) +{ + const total = Number(component.serverCount); + const problem = Number(component.problemServerCount || 0); + const responding = Math.max(0, total - problem); + + return [responding, total]; +} + /** * Updates the notifications of the servers dropdown notification as well as the individual server notifications. * @param {JSON} statusData object containing the status info for the servers From ae7ac085f5134faf9b21f8e8eaa2a0bff3fec3a2 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Fri, 9 Oct 2026 12:26:16 -0500 Subject: [PATCH 07/11] Add responding and total servers to getComponentStatus --- .../monitor/resources/js/functions.js | 16 ++++++++---- .../accumulo/monitor/resources/js/navbar.js | 25 +++++++++++-------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js index 64232f01fbd..1605c477712 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js @@ -578,11 +578,17 @@ function getComponentStatus(statusData, componentType) { const status = statusData.componentStatuses[componentType]; // trying to get the component's server counts - const respondingServers = getServerCounts().at(0); - const totalServers = getServerCounts().at(1); - - if (!status.hasServers && componentType === 'SCAN_SERVER'){ - return 'OK'; + const respondingServers = getServerCounts(status).at(0); + const totalServers = getServerCounts(status).at(1); + + if (componentType === 'SCAN_SERVER'){ + if (respondingServers === totalServers) { + return 'OK'; + } else if (respondingServers === 0 && totalServers > 0) { + return 'ERROR'; + } else if (respondingServers > 0 && respondingServers < totalServers){ + return 'WARN' + } } if (!statusData || !statusData.componentStatuses) { diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 0c8f621009f..09e89b4b984 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -94,26 +94,31 @@ function updateServerCount(elementId, status) { return; } - const total = Number(status.serverCount); + let total = Number(status.serverCount); const problem = Number(status.problemServerCount || 0); - const responding = Math.max(0, total - problem); + let responding = Math.max(0, total - problem); - $element.text(`${responding}/${total}`); +if (elementId === 'sserverStatusCount'){ + total = 3; + responding = 0; +} + +$element.text(`${responding}/${total}`); } function getServerCounts(component) { - const total = Number(component.serverCount); - const problem = Number(component.problemServerCount || 0); - const responding = Math.max(0, total - problem); +const total = Number(component.serverCount); +const problem = Number(component.problemServerCount || 0); +const responding = Math.max(0, total - problem); - return [responding, total]; +return [responding, total]; } /** - * Updates the notifications of the servers dropdown notification as well as the individual server notifications. - * @param {JSON} statusData object containing the status info for the servers - */ +* Updates the notifications of the servers dropdown notification as well as the individual server notifications. +* @param {JSON} statusData object containing the status info for the servers +*/ function updateServerNotifications(statusData) { const managerGoalState = statusData.managerGoalState; const isSafeMode = managerGoalState === 'SAFE_MODE'; From 1580a42f9755928ff051217e17d91e9a879ce618 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Fri, 9 Oct 2026 12:27:37 -0500 Subject: [PATCH 08/11] Remove test code from navbar.js --- .../apache/accumulo/monitor/resources/js/navbar.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 09e89b4b984..2f8f95a497b 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -94,16 +94,11 @@ function updateServerCount(elementId, status) { return; } - let total = Number(status.serverCount); + const total = Number(status.serverCount); const problem = Number(status.problemServerCount || 0); - let responding = Math.max(0, total - problem); + const responding = Math.max(0, total - problem); -if (elementId === 'sserverStatusCount'){ - total = 3; - responding = 0; -} - -$element.text(`${responding}/${total}`); + $element.text(`${responding}/${total}`); } function getServerCounts(component) From f9d2bc114ee7e3e43601791abb2a1a004a7a9a61 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Fri, 9 Oct 2026 14:13:34 -0500 Subject: [PATCH 09/11] Send correct parameter into getServerCounts --- .../apache/accumulo/monitor/resources/js/functions.js | 6 ++---- .../org/apache/accumulo/monitor/resources/js/navbar.js | 9 ++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js index 1605c477712..832f239e9ad 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js @@ -577,11 +577,9 @@ function getStoredStatusData() { function getComponentStatus(statusData, componentType) { const status = statusData.componentStatuses[componentType]; - // trying to get the component's server counts - const respondingServers = getServerCounts(status).at(0); - const totalServers = getServerCounts(status).at(1); - if (componentType === 'SCAN_SERVER'){ + const respondingServers = getServerCounts(status).at(0); + const totalServers = getServerCounts(status).at(1); if (respondingServers === totalServers) { return 'OK'; } else if (respondingServers === 0 && totalServers > 0) { diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 2f8f95a497b..7b427face94 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -103,11 +103,10 @@ function updateServerCount(elementId, status) { function getServerCounts(component) { -const total = Number(component.serverCount); -const problem = Number(component.problemServerCount || 0); -const responding = Math.max(0, total - problem); - -return [responding, total]; + const total = Number(component.serverCount); + const problem = Number(component.problemServerCount || 0); + const responding = Math.max(0, total - problem); + return [responding, total]; } /** From 8d0aa40f828b75e6f4e18e2e6b4958f8a40b2ef8 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Fri, 9 Oct 2026 14:18:37 -0500 Subject: [PATCH 10/11] Fix spacing --- .../org/apache/accumulo/monitor/resources/js/navbar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 7b427face94..8bfe5fec675 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -110,9 +110,9 @@ function getServerCounts(component) } /** -* Updates the notifications of the servers dropdown notification as well as the individual server notifications. -* @param {JSON} statusData object containing the status info for the servers -*/ + * Updates the notifications of the servers dropdown notification as well as the individual server notifications. + * @param {JSON} statusData object containing the status info for the servers + */ function updateServerNotifications(statusData) { const managerGoalState = statusData.managerGoalState; const isSafeMode = managerGoalState === 'SAFE_MODE'; From 92d667a30dcd7a7a678dd66f0e45c83d7cede051 Mon Sep 17 00:00:00 2001 From: avillarreal Date: Fri, 9 Oct 2026 14:19:27 -0500 Subject: [PATCH 11/11] Fix more spacing --- .../org/apache/accumulo/monitor/resources/js/navbar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js index 8bfe5fec675..bb0bb9ebb84 100644 --- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js +++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/navbar.js @@ -110,9 +110,9 @@ function getServerCounts(component) } /** - * Updates the notifications of the servers dropdown notification as well as the individual server notifications. - * @param {JSON} statusData object containing the status info for the servers - */ + * Updates the notifications of the servers dropdown notification as well as the individual server notifications. + * @param {JSON} statusData object containing the status info for the servers + */ function updateServerNotifications(statusData) { const managerGoalState = statusData.managerGoalState; const isSafeMode = managerGoalState === 'SAFE_MODE';