diff --git a/templates/admin_slmm.html b/templates/admin_slmm.html index c9056b1..2b88dcd 100644 --- a/templates/admin_slmm.html +++ b/templates/admin_slmm.html @@ -42,6 +42,18 @@ + +
+ Keepalive runs the 1 Hz DOD feed 24/7 (even with no viewer), which powers the live-chart + trail and continuous threshold alerts. Toggling persists and survives restarts. +
+Loading…
+No devices configured.
'; + return; + } + el.innerHTML = devices.map(dev => { + const on = !!dev.monitor_enabled; + const reach = dev.status ? dev.status.is_reachable : null; + const reachDot = reach === false + ? '' + : ''; + return ` +Failed to load devices: ${_esc(e.message)}
`; + } +} + +async function toggleMonitor(unitId, enable) { + const action = enable ? 'start' : 'stop'; + try { + const r = await fetch(`/api/slmm/${encodeURIComponent(unitId)}/monitor/${action}`, { method: 'POST' }); + if (!r.ok) throw new Error('HTTP ' + r.status); + await loadMonitors(); + } catch (e) { + alert('Toggle failed: ' + e.message); + } +} + loadSlmmOverview(); -setInterval(loadSlmmOverview, 30000); +loadMonitors(); +setInterval(() => { loadSlmmOverview(); loadMonitors(); }, 30000); {% endblock %}