From cba1a3b044f0319b7e6d53cb3b6cb16c618ee5df Mon Sep 17 00:00:00 2001 From: kianiadee Date: Wed, 27 May 2026 22:14:24 +0300 Subject: [PATCH] Strip SLO from frontend: remove _renderSlos, sloRoot param, slo-* CSS, and the 'Stale' tile (which was derived from the SLO freshness count). Backend still computes slo_status for future use; UI just ignores it. --- web/fleet-core.js | 23 +---------------------- web/index-live.html | 14 +------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/web/fleet-core.js b/web/fleet-core.js index c5ad26b..187d3c5 100644 --- a/web/fleet-core.js +++ b/web/fleet-core.js @@ -318,12 +318,11 @@ function _popupHtml(props) { /* ---------- render ---------- */ -export function renderView(map, payload, { summaryRoot, sloRoot } = {}) { +export function renderView(map, payload, { summaryRoot } = {}) { if (!payload || !payload.geojson) return; const src = map.getSource(VEHICLE_SOURCE); if (src) src.setData(payload.geojson); if (summaryRoot) _renderSummary(summaryRoot, payload.summary || {}); - if (sloRoot) _renderSlos(sloRoot, payload.slo_status || {}); } function _renderSummary(root, summary) { @@ -332,7 +331,6 @@ function _renderSummary(root, summary) { { label: 'Moving', value: summary.moving ?? '—' }, { label: 'Parked', value: summary.parked ?? '—' }, { label: 'Offline', value: summary.offline ?? '—' }, - { label: 'Stale', value: summary.below_freshness_slo ?? '—' }, ]; root.innerHTML = tiles .map(t => ` @@ -342,25 +340,6 @@ function _renderSummary(root, summary) { `).join(''); } -function _renderSlos(root, slos) { - const entries = Object.entries(slos); - if (entries.length === 0) { - root.innerHTML = '
SLO data not yet available
'; - return; - } - root.innerHTML = entries.map(([metric, info]) => { - const status = info.status || 'unknown'; - const current = info.current ?? '—'; - const threshold = info.threshold ?? '—'; - return ` -
- ${metric} - ${current} / ${threshold} - ${status} -
`; - }).join(''); -} - /* ---------- filters (multi-select dropdowns) ---------- */ /** diff --git a/web/index-live.html b/web/index-live.html index a8409b7..07a383f 100644 --- a/web/index-live.html +++ b/web/index-live.html @@ -35,7 +35,7 @@ } button.logout:hover { color: var(--text); border-color: var(--text); } - /* ─────────── top dashboard band: tiles + slos + filters ─────────── */ + /* ─────────── top dashboard band: tiles + filters ─────────── */ .top-band { display: grid; grid-template-columns: minmax(260px,1fr) minmax(280px,auto); @@ -58,18 +58,6 @@ .tile-label { font-size: 9px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; } .tile-value { font-size: 18px; font-weight: 600; line-height: 1.1; } - .slo { - display: grid; grid-template-columns: 1fr auto auto; gap: 8px; - padding: 3px 8px; border-radius: 4px; font-size: 11px; - background: var(--panel-2); - } - .slo-name { color: var(--muted); } - .slo-status { text-transform: uppercase; font-size: 9px; letter-spacing: 0.06em; } - .slo-green .slo-status { color: var(--accent); } - .slo-red .slo-status { color: var(--bad); } - .slo-unknown .slo-status { color: var(--muted); } - .slo-empty { color: var(--muted); font-size: 11px; } - /* ─────────── multi-select filter widget ─────────── */ .ms { position: relative; min-width: 180px; } .ms-btn {