feat(device-detail): wire tabs to live per-device data #9
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/device-detail-tabs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wires the device-detail tabs to live per-device data over the control channel, completing the static placeholders left by #8.
What changed
getsysinfoinventory: OS, kernel, arch, CPU, memory, uptime, load, drives table, non-loopback network interfaces, plus the node's five most recent events. A cache miss (noinfo) renders "no inventory yet"; the server primes the cache from the agent on first miss, so the snapshot appears on the next visit.msg/userSessions. Two-phase flow: the server acks routing first, so "device is offline" and "agent-console rights required" surface as immediate friendly errors instead of timeouts; the agent's reply is matched bytype+nodeid.powertimelinedecoded from the compact[state, start_secs, state, dur_secs, ...]wire shape into on/off segments, newest first, the open segment labelled "now".control.rsgrowssend()+await_where(predicate, verbatim timeout message);request_with_timeoutnow layers on those. Relayed agentmsgframes all shareaction: "msg"and need predicate matching.Routing bug fixed along the way
Real node ids are
node/<domain>/<short>; the slashes dropped/devices/:device_idinto the catch-all 404 (the canned fixture ids had no slashes, so this never showed). Device links now carry the bare short id andget_devicematches full id or short-id suffix.Verification
just checkclean (fmt, clippy -D warnings, server + wasm cargo check, tests).meshctrl,/meshsettingsconfig sealed into adev-insecurebuild of vervain-agent, agent connected and registered as a node. Then, against the built app with a session cookie: device list shows the live node (Online, platform, address), detail page renders via short id, and all four tab server fns returned live data over HTTP: real hardware inventory (after cache priming), actual utmp sessions from the agent, the nodeconnect event, and one power-on segment since connect. Verification servers, agent, and temp data torn down afterwards.Notes
userSessionsreply splits login time oddly (login_time: "Jun 5",remote_host: "19:30"): that is vervain-agent's utmp parsing, shown verbatim here; worth a separate agent-side issue.