feat(webapp): edit a unit's settings by serial: preview, send, read back

The Config tab by serial is now the unit's edit form, headed 'On the
unit <serial> -- read HH:MM' and built from the server's editable
fields.  Preview runs a dry run and shows old -> new, notes and anything
that blocks the change; Send (confirm) sends exactly what was previewed,
with its revision, then shows what the unit now holds and re-reads it.
An edit after a preview disables Send until the next preview.  The
by-host form loses its write button; the read stays.  Logic in
device_routing.js (Node-tested), glue in sfm_webapp.js, no inline JS.

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-03 21:57:17 -05:00
1 parent e8eabee4a2
commit 385716d8e1
7 files changed
+351 -77

No files matched your search

+11 -2
View File
@@ -1020,8 +1020,18 @@
<div id="tab-config" class="tab-pane">
<div id="cfg-settings" style="display:none; margin-bottom:12px">
<div class="cfg-section-title">On the unit (read by serial)</div>
<div class="cfg-section-title" id="cfg-settings-title">On the unit (read by serial)</div>
<div class="dev-table" id="cfg-settings-table"></div>
<!-- Phase 5: change the unit's settings by serial -- Preview, then Send (audited, read back). -->
<div class="cfg-section-title" id="cfg-edit-title" hidden>Change settings on this unit</div>
<div class="cfg-grid" id="cfg-edit" hidden></div>
<div class="cfg-actions" id="cfg-edit-actions" hidden>
<button class="btn btn-ghost" id="cfg-preview-btn" disabled>Preview</button>
<button class="btn btn-success" id="cfg-send-btn" disabled>Send to Unit</button>
<span id="cfg-edit-note"></span>
</div>
<div class="dev-table" id="cfg-preview"></div>
<div class="dev-table" id="cfg-result"></div>
</div>
<div class="cfg-grid" id="cfg-form">
@@ -1129,7 +1139,6 @@
<div class="cfg-actions">
<button class="btn btn-ghost" id="cfg-read-btn" onclick="readConfig()" disabled>Read from Device</button>
<button class="btn btn-success" id="cfg-write-btn" onclick="writeConfig()" disabled>Write to Device</button>
<button class="btn btn-ghost" onclick="clearConfigForm()">Clear Form</button>
<span id="cfg-status"></span>
</div>