From c4cb979dfb2dfd30b4c6551f731264a493682485 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 12:00:12 -0400 Subject: [PATCH] feat(webapp): the status panel shows the unit's clock and event count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task 3's brief asked for them and they were missed: with a serial, the panel now shows UnitStatus.device_time and event_count, "—" where null (Series 3 reports both as null). Without a serial the two fields stay hidden. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/sfm_webapp.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sfm/sfm_webapp.html b/sfm/sfm_webapp.html index b7c251f..3141c17 100644 --- a/sfm/sfm_webapp.html +++ b/sfm/sfm_webapp.html @@ -916,6 +916,14 @@ Memory free — + +
@@ -1929,6 +1937,15 @@ function updateMonitorPanel(s) { const kb = (bytes, k) => bytes != null ? Math.round(bytes / 1024) : k; const totalKb = kb(s.memory_total_bytes, s.memory_total_kb); const freeKb = kb(s.memory_free_bytes, s.memory_free_kb); + // The unit's clock and event count come only in the shared shape (serial + // mode); Series 3 reports both as null. + const shared = 'monitoring' in s; + for (const [id, v] of [['mon-time', s.device_time ? s.device_time.replace('T', ' ') : '—'], + ['mon-events', s.event_count ?? '—']]) { + const el = document.getElementById(id); + if (shared) el.textContent = v; + el.parentElement.style.display = shared ? '' : 'none'; + } if (volts != null) batEl.textContent = `${volts.toFixed(2)} V`; if (totalKb != null) memTEl.textContent = `${totalKb} KB`; if (freeKb != null) memFEl.textContent = `${freeKb} KB`;