fix: inspector stale data warning, remove dead supported_modes code
Lint / Python (flake8) (push) Successful in 40s
Lint / JS (eslint) (push) Successful in 7s
Security / Python Security (bandit) (push) Successful in 39s
Test / Python Tests (pytest) (push) Successful in 55s
Lint / Notify on failure (push) Has been skipped
Lint / Deploy (push) Successful in 5s
Lint / Python (flake8) (push) Successful in 40s
Lint / JS (eslint) (push) Successful in 7s
Security / Python Security (bandit) (push) Successful in 39s
Test / Python Tests (pytest) (push) Successful in 55s
Lint / Notify on failure (push) Has been skipped
Lint / Deploy (push) Successful in 5s
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -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 = `<span class="g-stale-warn" title="Data is ${Math.floor(ageMin)} minutes old — monitor may be down">⚠ Stale: ${timeStr}</span>`;
|
||||
} else {
|
||||
updEl.textContent = 'Updated: ' + timeStr;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Object.keys(switches).length) {
|
||||
|
||||
Reference in New Issue
Block a user