From 26be492dc79ebf3297ab910e4c22928ef27b422e Mon Sep 17 00:00:00 2001 From: nate Date: Thu, 9 Apr 2026 20:30:22 +0400 Subject: [PATCH] fix: outage indicator --- apps/status/src/views/page.ejs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/status/src/views/page.ejs b/apps/status/src/views/page.ejs index 72776e7..7438489 100644 --- a/apps/status/src/views/page.ejs +++ b/apps/status/src/views/page.ejs @@ -59,17 +59,23 @@ // Paused monitors are operator-declared maintenance — they don't count // toward "down" or "degraded", but we surface a small note in the banner // when at least one is in maintenance so visitors aren't confused. - let overall = 'up'; let paused_count = 0; + let down_count = 0; + let active_count = 0; + let has_degraded = false; for (const m of monitors) { if (m.current_state === 'paused') { paused_count++; continue; } + active_count++; const partial = m.region_states.some(r => r.state === 'down') && m.region_states.some(r => r.state === 'up'); - if (m.current_state === 'down') { overall = 'down'; break; } - if (partial && overall !== 'down') overall = 'degraded'; + if (m.current_state === 'down') down_count++; + else if (partial) has_degraded = true; } + const overall = down_count === 0 && !has_degraded ? 'up' + : active_count > 0 && down_count === active_count ? 'down' + : 'degraded'; let overallText = overall === 'up' ? 'All systems operational' - : overall === 'degraded' ? 'Some systems degraded' - : 'Major outage in progress'; + : overall === 'down' ? 'Major outage in progress' + : 'Partial outage'; if (paused_count > 0) { overallText += ' — ' + paused_count + (paused_count === 1 ? ' service' : ' services') + ' under maintenance'; }