From 49869fd9f7d515c906b3fbe8b868984438998ca9 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 11 May 2026 12:05:08 -0400 Subject: [PATCH] fix: inspector stale data warning, remove dead supported_modes code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - inspector.html: show orange '⚠ Stale: HH:MM' with tooltip when link_stats data is >15 min old (previously just showed the time with no visual warning) - style.css: add .g-stale-warn helper class (orange, bold) for the stale indicator - diagnose.py: remove supported_modes accumulation from parse_ethtool() — field was collected but never consumed by analyze() or displayed anywhere Co-Authored-By: Claude Sonnet 4.6 --- diagnose.py | 2 -- static/style.css | 1 + templates/inspector.html | 9 ++++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/diagnose.py b/diagnose.py index 77552d0..2577fa0 100644 --- a/diagnose.py +++ b/diagnose.py @@ -221,8 +221,6 @@ class DiagnosticsRunner: data['auto_neg'] = (val.lower() == 'on') elif key == 'Link detected': data['link_detected'] = (val.lower() == 'yes') - elif 'Supported link modes' in key: - data.setdefault('supported_modes', []).append(val) return data @staticmethod diff --git a/static/style.css b/static/style.css index c41e7d9..592a307 100644 --- a/static/style.css +++ b/static/style.css @@ -217,6 +217,7 @@ .sev-pills { display: flex; gap: 4px; } .g-page-sub { font-size: .78em; color: var(--text-muted); margin-top: 4px; } .g-page-sub-aside { font-size: .78em; color: var(--text-muted); margin-left: 8px; } +.g-stale-warn { color: var(--orange); font-weight: 600; } /* ── Badge severity color variants (used with lt-badge) ───────────── */ .badge-critical { color: var(--red); border-color: var(--red); text-shadow: var(--glow-red); } diff --git a/templates/inspector.html b/templates/inspector.html index ed7e79e..a47d51c 100644 --- a/templates/inspector.html +++ b/templates/inspector.html @@ -428,7 +428,14 @@ function renderInspector(data) { const updEl = document.getElementById('inspector-updated'); if (updEl && data.updated) { - updEl.textContent = 'Updated: ' + new Date(data.updated + (data.updated.includes('Z') ? '' : 'Z')).toLocaleTimeString(); + const updMs = new Date(data.updated + (data.updated.includes('Z') ? '' : 'Z')); + const ageMin = (Date.now() - updMs) / 60000; + const timeStr = updMs.toLocaleTimeString(); + if (ageMin > 15) { + updEl.innerHTML = `⚠ Stale: ${timeStr}`; + } else { + updEl.textContent = 'Updated: ' + timeStr; + } } if (!Object.keys(switches).length) {