From 17a1a83bdf5767039a48f8d87497ce82b3975bbd Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 9 Jun 2026 21:29:50 +0000 Subject: [PATCH] feat(slm): point dashboard live tile at /monitor too Finishes the live-view pivot: the SLM dashboard's live-chart tile now uses the fan-out /monitor feed (multi-viewer, L1/L10) instead of the DRD /stream, and skips heartbeat / unreachable frames so they don't blank the metrics or spike the chart. Co-Authored-By: Claude Opus 4.8 (1M context) --- templates/sound_level_meters.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/sound_level_meters.html b/templates/sound_level_meters.html index 697f6e7..3055db9 100644 --- a/templates/sound_level_meters.html +++ b/templates/sound_level_meters.html @@ -280,7 +280,7 @@ function startDashboardStream() { } const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; - const wsUrl = `${wsProtocol}//${window.location.host}/api/slmm/${window.selectedUnitId}/live`; + const wsUrl = `${wsProtocol}//${window.location.host}/api/slmm/${window.selectedUnitId}/monitor`; window.dashboardWebSocket = new WebSocket(wsUrl); @@ -293,6 +293,10 @@ function startDashboardStream() { window.dashboardWebSocket.onmessage = function(event) { try { const data = JSON.parse(event.data); + // /monitor sends keepalive 'heartbeat' frames (no metrics) and a per-frame + // 'feed_status'; skip heartbeats and offline frames so they don't blank the + // metrics or spike the chart with zeros. + if (data.heartbeat || data.feed_status === 'unreachable') return; updateDashboardMetrics(data); updateDashboardChart(data); } catch (error) {