feat(sfm): the page's Call Home tab by serial -- state and audited On / Off (phase 4)

device_routing.js (Node-tested): call_home_state / call_home_on / call_home_off
routes (serial required); controlsFor gains callHomeChange (by serial, a
confirmed Series 3 or 4) and callHomeRead now covers a Series 4 by serial;
serialPanes gains callHomeForm / callHomeBox; callHomeRows renders the switch
(On / Off / 'Unknown (byte 5 = 0xNN)'), dial string and series;
changeErrorText takes the whole label ('Start monitoring', 'Enable call-home').

sfm_webapp.js: by serial the Call Home tab hides the legacy multi-field form
(Series 3 by host only) and shows the unit's switch with On / Off.  Each asks
confirm(), sends one audited change, reports it with changeSummary /
changeErrorText, then re-reads quietly so the change's own result stays on
screen.  A different unit's switch is never left showing.  The new buttons are
wired with addEventListener, not onclick= (no inline JS).

Checked in jsdom against the real page: placeholder, read, Off (confirm, the
disable route, 'confirmed -- enabled -> disabled'), a serial edit clearing it,
legacy mode unchanged, no script errors.

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-11-02 17:05:00 -05:00
1 parent 06fa56db09
commit 84c142f36c
4 files changed
+151 -23

No files matched your search

+12 -1
View File
@@ -1141,6 +1141,16 @@
═══════════════════════════════════════════════════════════════════ -->
<div id="tab-call-home" class="tab-pane">
<div id="ch-serial" style="display:none; margin-bottom:12px">
<div class="cfg-section-title">On the unit (by serial)</div>
<div class="dev-table" id="ch-state"></div>
<div class="cfg-actions" style="margin-top:8px">
<button class="btn btn-success" id="ch-on-btn" disabled>Call-home On</button>
<button class="btn btn-ghost" id="ch-off-btn" disabled>Call-home Off</button>
</div>
</div>
<div id="ch-legacy">
<div class="cfg-grid">
<!-- Enable / dial -->
@@ -1243,11 +1253,12 @@
</div>
</div>
</div>
<div class="cfg-actions">
<button class="btn btn-ghost" id="ch-read-btn" onclick="readCallHome()" disabled>Read from Device</button>
<button class="btn btn-success" id="ch-write-btn" onclick="writeCallHome()" disabled>Write to Device</button>
<button class="btn btn-ghost" onclick="clearCallHomeForm()">Clear Form</button>
<button class="btn btn-ghost" id="ch-clear-btn" onclick="clearCallHomeForm()">Clear Form</button>
<span id="ch-status"></span>
<span id="ch-series-note" style="color:var(--text-dim)"></span>
</div>