Feature: edit device remarks from the web console
The Go web console now stores a per-device remark and renders it as "hostname (remark)" on the card, the label displayName already supported. The card's "..." menu gets an Edit remark entry directly below Terminal; it opens a small dialog, and an empty value clears the label. Remarks live in device_notes.json next to users.json, independent of the device history and ACL, so offline records carry them too. The WebSocket command set_device_remark is admin-only and honors the device ACL (a private device of another owner is refused). Updates are audited as admin.device.remark and broadcast as devices_changed so every open console refreshes. Deleting a device drops its remark. The device_list reply reports remarkEdit only when a notes table is wired, so the shared page hides the entry on the MFC server, which does not implement it. A malformed or newer-version device_notes.json disables writes instead of letting the first save overwrite labels it could not parse; loaded values are re-sanitized and capped. Verified with go test ./..., vet, gofmt, and a node --check pass on the inline script. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
1bd7fa5b2d
commit
95d2bbc1b6
9 files changed
+741
-7
No files matched your search
@@ -38,6 +38,7 @@ const (
|
||||
auditDeviceTransfer = "admin.device.transfer"
|
||||
auditDeviceBind = "admin.device.bind"
|
||||
auditDeviceUnbind = "admin.device.unbind"
|
||||
auditDeviceRemark = "admin.device.remark"
|
||||
auditQuery = "admin.audit.query"
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user