VAPP-26: Server administration page: version, config view, backup, server console #22

Merged
David merged 1 commit from feat/server-admin-page-vapp-26 into main 2026-06-07 19:39:20 +02:00
Owner

VAPP-26: Server administration page

Adds a site-admin Server page at /admin that surfaces the four admin-only control actions the console never used: serverversion, serverconfig (read-only config dump), serverBackup (back up now), and serverconsole. Frame shapes were verified against vervain-server's crates/meshcentral-web/src/user_session.rs dispatch.

Server fns (src/server_fns/mod.rs)

All four use control::ADMIN_ONLY_TIMEOUT, so a non-admin (the server silently drops the action) gets the explanatory error quickly rather than a 10s hang.

  • get_server_version() joins the serverversion reply tags into a label (empty until the server-update feature lands upstream).
  • get_server_config() returns the serverconfig data text, or None when the server has no config file.
  • server_backup() acks serverBackup with the written path as result (not "ok"); the no-database, not-configured, and leading error: sentinels are mapped to inline errors instead of being treated as success.
  • server_console(command) sends serverconsole and returns the reply value.

Page (src/components/pages/admin.rs)

  • Version, config, and relay stats (reused from get_relay_stats) load in one server future, so a non-admin sees a single explanatory error for the page rather than four broken cards (the Plugins/Relays admin-only timeout precedent).
  • Configuration is a read-only monospace pane with a note that runtime editing is unsupported by vervain-server.
  • Backup is a "Back up now" button with a busy state; it reports the written path or the server's error inline.
  • Console keeps a session-local scrollback of command/reply pairs (not persisted); unknown commands render the server's own response.

Also: new /admin route, sidebar "Server" entry below Relays, topbar title, and PartialEq on RelayStats so it can pass as a component prop.

Acceptance criteria

  • /admin renders version, config dump (read-only), backup button, and console for a site admin
  • Backup reports success (path) or the server's error inline
  • Console commands send and render replies in a scrollback; unknown commands surface the server's response
  • Non-admin users get a single explanatory error instead of broken cards
  • just check passes

🤖 Generated with Claude Code

## VAPP-26: Server administration page Adds a site-admin **Server** page at `/admin` that surfaces the four admin-only control actions the console never used: `serverversion`, `serverconfig` (read-only config dump), `serverBackup` (back up now), and `serverconsole`. Frame shapes were verified against vervain-server's `crates/meshcentral-web/src/user_session.rs` dispatch. ### Server fns (`src/server_fns/mod.rs`) All four use `control::ADMIN_ONLY_TIMEOUT`, so a non-admin (the server silently drops the action) gets the explanatory error quickly rather than a 10s hang. - `get_server_version()` joins the `serverversion` reply `tags` into a label (empty until the server-update feature lands upstream). - `get_server_config()` returns the `serverconfig` `data` text, or `None` when the server has no config file. - `server_backup()` acks `serverBackup` with the written path as `result` (not `"ok"`); the `no-database`, `not-configured`, and leading `error:` sentinels are mapped to inline errors instead of being treated as success. - `server_console(command)` sends `serverconsole` and returns the reply `value`. ### Page (`src/components/pages/admin.rs`) - Version, config, and relay stats (reused from `get_relay_stats`) load in one server future, so a non-admin sees **a single explanatory error** for the page rather than four broken cards (the Plugins/Relays admin-only timeout precedent). - **Configuration** is a read-only monospace pane with a note that runtime editing is unsupported by vervain-server. - **Backup** is a "Back up now" button with a busy state; it reports the written path or the server's error inline. - **Console** keeps a session-local scrollback of command/reply pairs (not persisted); unknown commands render the server's own response. Also: new `/admin` route, sidebar "Server" entry below Relays, topbar title, and `PartialEq` on `RelayStats` so it can pass as a component prop. ### Acceptance criteria - [x] `/admin` renders version, config dump (read-only), backup button, and console for a site admin - [x] Backup reports success (path) or the server's error inline - [x] Console commands send and render replies in a scrollback; unknown commands surface the server's response - [x] Non-admin users get a single explanatory error instead of broken cards - [x] `just check` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(admin): server administration page
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 56s
Create release / Create release from merged PR (pull_request) Has been skipped
7742cda1d1
Add a site-admin Server page at /admin surfacing the four admin-only control actions the console never used: serverversion, serverconfig (read-only config dump), serverBackup (back up now), and serverconsole.

Server fns over the control channel with the admin-only timeout: get_server_version (joins the serverversion tags), get_server_config (the config.json text, None when absent), server_backup (acks with the written path; the no-database / not-configured / error: sentinels surface inline rather than treating them as success), and server_console (one command, returns the reply text). Frame shapes verified against vervain-server's user_session.rs dispatch.

The page loads version, config, and stats (reused from get_relay_stats) in one server future so a non-admin, for whom every action is silently dropped, gets a single explanatory error instead of four broken cards (the Plugins/Relays admin-only timeout pattern). The config pane is read-only monospace with a note that runtime editing is unsupported; backup reports the path or the server error inline; the console keeps a session-local scrollback of command/reply pairs. New /admin route, sidebar "Server" entry below Relays, and topbar title. RelayStats gains PartialEq so it can pass as a component prop.

#VAPP-26

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
David merged commit d05519d9b1 into main 2026-06-07 19:39:20 +02:00
David deleted branch feat/server-admin-page-vapp-26 2026-06-07 19:39:20 +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!22
No description provided.