Media Stack called every node local, and a host whose watchdogs never ran reported all clear
This commit is contained in:
@@ -1476,8 +1476,16 @@ function vvPollMonitor(live) {
|
||||
const issueCount = ctrNames.length + stabNames.length + storIssues
|
||||
+ (daemonHit ? 1 : 0) + (oom > 0 ? 1 : 0)
|
||||
+ (reboots > 0 ? 1 : 0) + (npmStrikes > 0 ? 1 : 0);
|
||||
const bannerCls = healthy ? 'vv-banner-ok' : (reboots || oom || daemonHit ? 'vv-banner-err' : 'vv-banner-warn');
|
||||
const bannerTxt = healthy ? '✓ All clear' : `⚠ ${issueCount} issue${issueCount !== 1 ? 's' : ''}`;
|
||||
// A host whose watchdogs have never executed has no verdict to report. Every strike set
|
||||
// reads absent state as zero, so "All clear" here would be standing in for no data —
|
||||
// which is the failure this card's own header warns about. Said plainly instead.
|
||||
const neverRan = wd.never_ran === true;
|
||||
const bannerCls = neverRan ? 'vv-banner-warn'
|
||||
: healthy ? 'vv-banner-ok'
|
||||
: (reboots || oom || daemonHit ? 'vv-banner-err' : 'vv-banner-warn');
|
||||
const bannerTxt = neverRan ? '○ Never run on this host'
|
||||
: healthy ? '✓ All clear'
|
||||
: `⚠ ${issueCount} issue${issueCount !== 1 ? 's' : ''}`;
|
||||
|
||||
let html = `<div class="vv-banner ${bannerCls}">${bannerTxt}`;
|
||||
if (reboots > 0) html += `<span style="font-size:10px;">${reboots} reboot${reboots !== 1 ? 's' : ''}/12h</span>`;
|
||||
@@ -1601,7 +1609,7 @@ function vvPollMonitor(live) {
|
||||
const wdCard = document.getElementById('vv-watchdog-card');
|
||||
if (wdCard) {
|
||||
wdCard.classList.remove('vv-accent-ok','vv-accent-warn','vv-accent-err');
|
||||
if (healthy) wdCard.classList.add('vv-accent-ok');
|
||||
if (healthy && !neverRan) wdCard.classList.add('vv-accent-ok');
|
||||
else if (reboots > 0 || oom > 0 || daemonHit) wdCard.classList.add('vv-accent-err');
|
||||
else wdCard.classList.add('vv-accent-warn');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user