diff --git a/static/app.js b/static/app.js index 3fe4e00..d9e4e9d 100644 --- a/static/app.js +++ b/static/app.js @@ -89,6 +89,14 @@ function updateStatusBar(summary, lastCheck, daemonOk) { alertBadge.style.display = total ? '' : 'none'; } + // Update stat cards + const scCrit = document.getElementById('stat-critical-val'); + const scWarn = document.getElementById('stat-warning-val'); + if (scCrit) scCrit.textContent = critCount; + if (scWarn) scWarn.textContent = warnCount; + const statCritCard = document.getElementById('stat-critical'); + if (statCritCard) statCritCard.classList.toggle('lt-stat-card--alert', critCount > 0); + // Stale data banner: warn if last_check is older than 15 minutes let staleBanner = document.getElementById('stale-banner'); if (lastCheck) { @@ -112,6 +120,9 @@ function updateStatusBar(summary, lastCheck, daemonOk) { } function updateHostGrid(hosts) { + const scHosts = document.getElementById('stat-hosts-val'); + if (scHosts) scHosts.textContent = Object.keys(hosts).length; + for (const [name, host] of Object.entries(hosts)) { const card = document.querySelector(`.host-card[data-host="${CSS.escape(name)}"]`); if (!card) continue; diff --git a/static/style.css b/static/style.css index a0670d3..ef97346 100644 --- a/static/style.css +++ b/static/style.css @@ -995,6 +995,17 @@ .diag-pulse-link a { color: var(--cyan); } .diag-pulse-link a:hover { text-shadow: var(--glow-cyan); } +/* ── Stat card alert variant (pulsing border when critical > 0) ─── */ +.lt-stat-card--alert { + border-color: var(--red) !important; + box-shadow: 0 0 8px rgba(255,45,85,.25) !important; + animation: topo-pulse-down 2s ease-in-out infinite; +} +.lt-stat-card--alert::before { background: var(--red); box-shadow: var(--glow-red); } + +/* ── lt-frame inside g-section: no extra bottom margin ────────────── */ +.g-section > .lt-frame { margin-bottom: 0; } + /* ── Responsive ───────────────────────────────────────────────────── */ @media (max-width: 768px) { .host-grid { grid-template-columns: 1fr; } diff --git a/templates/index.html b/templates/index.html index cefd5f9..2a9663d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -26,6 +26,42 @@ + +
| Sev | -Type | -Target | -Detail | -Resolved | -Duration | -
|---|---|---|---|---|---|
| {{ e.severity }} | -{{ e.event_type | replace('_', ' ') }} | -{{ e.target_name }} | -{{ e.target_detail or '–' }} | -- {{ e.resolved_at }} - | -– | -