feat(devices): add "Update agent" control to device detail (VAPP-60) #69

Merged
David merged 1 commit from feat/VAPP-60-update-agent-button into main 2026-07-01 01:18:02 +02:00
Owner

Summary

Adds an "Update agent" control to the device detail view, wiring the Dioxus frontend to vervain-server's VS-73 pushAgentUpdate control action. The server side shipped in VS-73 but had no client, so operators had no UI to push an agent update; this closes that gap. Tracked as VAPP-60 (depends on VS-73).

Changes

  • New push_agent_update server function in src/server_fns/mod.rs, mirroring wake_device: opens the control channel, sends {"action":"pushAgentUpdate","nodeids":[device_id]}, awaits the for:"pushAgentUpdate" ack, maps not-authorized to a fn error, and otherwise returns the raw pushed:N current:N offline:N nobinary:N summary.
  • device_detail.rs: new "Update agent" item in the overflow "..." menu, rendered only when the device is Online (the agent must be connected to receive the chunk stream, matching the Run command gate). It opens a confirm dialog; confirming dispatches the push and shows a busy state.
  • The single-node ack summary is parsed into a human-readable result line (pushed / current / offline / nobinary) via update_summary_message, with a raw-string fallback.

Decisions

  • Placement is the overflow menu (not a prominent header button): a maintenance action fits there and keeps the header uncluttered.
  • The menu item is shown to all users and the server's not-authorized result surfaces as a clear in-dialog error. The server is the sole authority; device_detail.rs has no current-user fetch today, so no client-side admin lookup is added.

Testing

just pre-commit passes in the CI toolchain image: cargo fmt --check, cargo clippy --all-targets --features server -D warnings, cargo check --features server, cargo check --target wasm32-unknown-unknown, and cargo test --features server --bin vervain-app (24 passed).

🤖 Generated with Claude Code

## Summary Adds an "Update agent" control to the device detail view, wiring the Dioxus frontend to vervain-server's VS-73 `pushAgentUpdate` control action. The server side shipped in VS-73 but had no client, so operators had no UI to push an agent update; this closes that gap. Tracked as VAPP-60 (depends on VS-73). ## Changes - New `push_agent_update` server function in `src/server_fns/mod.rs`, mirroring `wake_device`: opens the control channel, sends `{"action":"pushAgentUpdate","nodeids":[device_id]}`, awaits the `for:"pushAgentUpdate"` ack, maps `not-authorized` to a fn error, and otherwise returns the raw `pushed:N current:N offline:N nobinary:N` summary. - `device_detail.rs`: new "Update agent" item in the overflow "..." menu, rendered only when the device is Online (the agent must be connected to receive the chunk stream, matching the Run command gate). It opens a confirm dialog; confirming dispatches the push and shows a busy state. - The single-node ack summary is parsed into a human-readable result line (pushed / current / offline / nobinary) via `update_summary_message`, with a raw-string fallback. ## Decisions - Placement is the overflow menu (not a prominent header button): a maintenance action fits there and keeps the header uncluttered. - The menu item is shown to all users and the server's `not-authorized` result surfaces as a clear in-dialog error. The server is the sole authority; `device_detail.rs` has no current-user fetch today, so no client-side admin lookup is added. ## Testing `just pre-commit` passes in the CI toolchain image: `cargo fmt --check`, `cargo clippy --all-targets --features server -D warnings`, `cargo check --features server`, `cargo check --target wasm32-unknown-unknown`, and `cargo test --features server --bin vervain-app` (24 passed). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(devices): add "Update agent" control to device detail
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 32s
Create release / Create release from merged PR (pull_request) Has been skipped
09a7c1d7a0
Add an "Update agent" item to the device detail overflow menu that pushes the latest configured-channel agent build to the currently-viewed device, wiring the frontend to vervain-server's VS-73 `pushAgentUpdate` control action which had no client until now.

New `push_agent_update` server fn in src/server_fns/mod.rs mirrors `wake_device`: it opens the control channel, sends `{"action":"pushAgentUpdate","nodeids":[device_id]}`, awaits the `for:"pushAgentUpdate"` ack, maps `not-authorized` to a fn error, and returns the raw `pushed:N current:N offline:N nobinary:N` summary otherwise.

The menu item renders only when the device is Online (the agent must be connected to receive the chunk stream, matching the Run command gate) and opens a confirm dialog. Confirming dispatches the push and parses the single-node summary into a human-readable result line (pushed / current / offline / nobinary), falling back to the raw string. A non-admin sees the server's not-authorized rejection as a clear error rather than a silent no-op; the server stays the sole authority, so no client-side admin lookup is added.

#VAPP-60

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
David merged commit 4baa9fe30c into main 2026-07-01 01:18:02 +02:00
David deleted branch feat/VAPP-60-update-agent-button 2026-07-01 01:18:02 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!69
No description provided.