feat(webapp): the status panel shows the unit's clock and event count

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-10-29 12:00:12 -04:00
1 parent a709d2388d
commit c4cb979dfb
1 file changed
+17
+17
View File
@@ -916,6 +916,14 @@
<span class="mon-label">Memory free</span>
<span class="mon-value" id="mon-mem-free">—</span>
</div>
<div class="mon-field" style="display:none" title="The unit's own clock">
<span class="mon-label">Unit time</span>
<span class="mon-value" id="mon-time">—</span>
</div>
<div class="mon-field" style="display:none" title="Read only where it is cheap (Series 4)">
<span class="mon-label">Events</span>
<span class="mon-value" id="mon-events">—</span>
</div>
<div class="mon-spacer"></div>
<button class="btn" id="mon-refresh-btn" onclick="refreshMonitorStatus()" title="Refresh monitoring status">↻ Status</button>
<button class="btn" id="mon-start-btn" onclick="startMonitoring()" title="Start monitoring">▶ Start</button>
@@ -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`;