From c3aa3bea6f3ed457441d49511e71d6ecd63bb854 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Fri, 1 May 2026 17:15:48 -0400 Subject: [PATCH] TDS polish: lt-frame tables, lt-stats-grid link summary, settings-aware refresh - links.html: replace custom link-summary-panel with lt-stats-grid/lt-stat-card showing total interfaces, ports down, errors, and PoE load - suppressions.html: wrap active suppressions and history tables in lt-frame with lt-section-header labels - inspector.html: wire auto-refresh to gandalfSettings (respects interval pill), fix updated timestamp to use locale time Co-Authored-By: Claude Sonnet 4.6 --- templates/inspector.html | 13 +++- templates/links.html | 60 +++++++++------ templates/suppressions.html | 147 ++++++++++++++++++++---------------- 3 files changed, 130 insertions(+), 90 deletions(-) diff --git a/templates/inspector.html b/templates/inspector.html index a7ab94d..ab26b74 100644 --- a/templates/inspector.html +++ b/templates/inspector.html @@ -427,9 +427,10 @@ function renderInspector(data) { const main = document.getElementById('inspector-main'); const switches = data.unifi_switches || {}; - const upd = data.updated ? `Updated: ${data.updated}` : ''; const updEl = document.getElementById('inspector-updated'); - if (updEl) updEl.textContent = upd; + if (updEl && data.updated) { + updEl.textContent = 'Updated: ' + new Date(data.updated + (data.updated.includes('Z') ? '' : 'Z')).toLocaleTimeString(); + } if (!Object.keys(switches).length) { main.innerHTML = '

No switch data available. Monitor may still be initialising.

'; @@ -465,7 +466,13 @@ async function loadInspector() { } loadInspector(); -lt.autoRefresh.start(loadInspector, 60000); +var _inspInterval = (window.gandalfSettings && window.gandalfSettings.refreshInterval) || 60; +if (_inspInterval > 0) lt.autoRefresh.start(loadInspector, Math.max(_inspInterval, 15) * 1000); + +window.onGandalfSettingsChanged = function(s) { + lt.autoRefresh.stop(); + if (s.refreshInterval > 0) lt.autoRefresh.start(loadInspector, Math.max(s.refreshInterval, 15) * 1000); +}; lt.keys.on('Escape', () => { if (document.getElementById('inspector-panel').classList.contains('open')) closePanel(); }); diff --git a/templates/links.html b/templates/links.html index 0dcf13c..701930c 100644 --- a/templates/links.html +++ b/templates/links.html @@ -384,33 +384,51 @@ function buildLinkSummary(hosts, unifiSwitches) { if ((d.tx_errs_rate || 0) > 0 || (d.rx_errs_rate || 0) > 0) errIfaces++; } } + let swTotal = 0, swDown = 0; for (const sw of Object.values(unifiSwitches || {})) { for (const p of Object.values(sw.ports || {})) { totalPoe += p.poe_power || 0; + swTotal++; + if (!p.up) swDown++; } } - const hasAlerts = downIfaces > 0 || errIfaces > 0; - return ` -