Fix fallback state key: FAILOVER → FALLBACK (was never matching)
This commit is contained in:
@@ -708,7 +708,7 @@ function vvPollMonitor() {
|
||||
|
||||
const stateMap = {
|
||||
NORMAL: ['#4caf50', '✓ Nominal'],
|
||||
FAILOVER: ['#f44336', '⚠ Failover active'],
|
||||
FALLBACK: ['#f44336', '⚠ Fallback active'],
|
||||
NO_INTERNET: ['#ff9800', '⚡ Internet lost'],
|
||||
DARK: ['#9e9e9e', '◌ Dark mode'],
|
||||
UNKNOWN: ['#444', '— No state file'],
|
||||
@@ -737,7 +737,7 @@ function vvPollMonitor() {
|
||||
|
||||
// ── State label + outage duration ──────────────────────────────────────
|
||||
let stateExtra = '';
|
||||
if (state === 'FAILOVER' || state === 'DARK') {
|
||||
if (state === 'FALLBACK' || state === 'DARK') {
|
||||
const start = parseInt(fb.failover_start ?? 0);
|
||||
if (start > 0) {
|
||||
const sec = Math.floor(Date.now() / 1000) - start;
|
||||
@@ -747,7 +747,7 @@ function vvPollMonitor() {
|
||||
fbHtml += `<div style="font-size:11px;color:${sColor};font-weight:500;margin-bottom:6px;">${sLabel}${stateExtra}</div>`;
|
||||
|
||||
// ── Handback strike progress ───────────────────────────────────────────
|
||||
if (state === 'FAILOVER' && strikes > 0) {
|
||||
if (state === 'FALLBACK' && strikes > 0) {
|
||||
const dots = Array.from({length: maxStrikes}, (_,i) =>
|
||||
`<span style="color:${i < strikes ? '#4caf50' : '#2a2a2a'};font-size:14px;line-height:1;">●</span>`
|
||||
).join('');
|
||||
@@ -759,7 +759,7 @@ function vvPollMonitor() {
|
||||
}
|
||||
|
||||
// ── Tier badges (FAILOVER only) ────────────────────────────────────────
|
||||
if (state === 'FAILOVER') {
|
||||
if (state === 'FALLBACK') {
|
||||
const t2 = fb.tier2_started === 'true';
|
||||
const t3 = fb.tier3_started === 'true';
|
||||
const t4 = fb.tier4_started === 'true';
|
||||
@@ -811,7 +811,7 @@ function vvPollMonitor() {
|
||||
fbCard.classList.remove('vv-accent-ok','vv-accent-warn','vv-accent-err');
|
||||
if (!enabled || ptSuspended) fbCard.classList.add('vv-accent-warn');
|
||||
else if (state === 'NORMAL') fbCard.classList.add('vv-accent-ok');
|
||||
else if (state === 'FAILOVER') fbCard.classList.add('vv-accent-err');
|
||||
else if (state === 'FALLBACK') fbCard.classList.add('vv-accent-err');
|
||||
else if (state !== 'UNKNOWN') fbCard.classList.add('vv-accent-warn');
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user