Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,24 @@ function getStoredStatusData() {
}

function getComponentStatus(statusData, componentType) {
const status = statusData.componentStatuses[componentType];

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) {
return 'ERROR';
} else if (respondingServers > 0 && respondingServers < totalServers){
return 'WARN'
}
}

Comment on lines 577 to +591

@Amemeda Amemeda Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created and implemented new function getServerCounts to get the current component's responding servers and total servers counts. I believe something like this is needed in order to properly set the expected status of only Scan Servers

if (!statusData || !statusData.componentStatuses) {
return 'ERROR';
}

var status = statusData.componentStatuses[componentType];
if (!status || !status.hasServers) {
return 'ERROR';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ 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
Expand Down