feat(ui): rework router UI with tabs, terminal, SSH keys, and docs #38
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_router!38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_rework_router_ui"
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?
Summary
Rework the hero_router dashboard around a top-level tab layout (Home, Router, Terminal, Admin, Docs) and add the terminal / SSH-keys / docs features requested in issue #37. The existing dashboard body is preserved verbatim at
/router; all deep links continue to resolve through the Router shell.Related Issue
Closes #37
Changes
partials/tabs.html) wired intobase.html. The standalone Admin pill is removed;OpenRPC/ Agent / Router Logs / theme-toggle remain on the navbar./): welcome copy, security reminder, services-with-UI grid built from the cache, conditional whitelist-status banner./router): the old dashboard, unchanged in behaviour./router-logs,/service/:id/*,/agent/play/:id,/fragments/*all render the Router shell./terminal):src/server/terminal.rsspawns hero_proc jobs (tty: true,is_process: true,script: "nu") namedrouter_term_<uuid>, with a WebSocket PTY proxy adapted fromhero_proc_ui.ui.sockonly):GET/POST /api/terminal/sessions,DELETE /api/terminal/sessions/:id,GET /api/terminal/sessions/:id/pty. Matchingui.term.*JSON-RPC methods for parity.static/js/terminal.js(IIFE), xterm.js + FitAddon + CSS vendored from hero_proc_ui, session list with rename (localStorage) / delete / create, FitAddon + ResizeObserver + resize control frames,#session=<id>deep-linking.src/server/ssh_keys.rsprovides CRUD against~/.ssh/authorized_keyswith0700/0600perms and atomic rewrite on delete. Newui.sshKeys.{list,add,delete}JSON-RPC methods onui.sockonly./docs): renderscrates/hero_router/docs/router_overview.mdviapulldown-cmark, cached in aOnceLock. Content covers the dual-socket architecture, discovery, reverse-proxy path convention, reserved names, each tab, securing the router, and an operator FAQ.build_ui_routerextended to includerouter,terminal,docs,router-logs,agent,openrpc.json,rpc.scripts/smoke_tabs.shcurls each tab and asserts thenav-link activemarker.Architectural guarantees
ui.*RPC methods live onui.sock+ TCP only.rpc.sockis unchanged.BASE_PATHcompatibility preserved (existing<base href>pattern).Test Results
cargo build -p hero_router: PASS.cargo test -p hero_router: 15 total, 14 passed, 1 failed, 0 ignored. The single failure (python_codegen::integration_tests::test_generate_from_router_spec) is pre-existing ondevelopmentand unrelated to this PR.cargo clippy -p hero_router: 8 warnings, identical to thedevelopmentbaseline. Zero new warnings.Introduce a top-level tab layout (Home, Router, Terminal, Admin, Docs) on the router dashboard. The existing dashboard body is preserved verbatim under /router; existing deep links (/router-logs, /service/:id/*, /agent/play/:id, /fragments/*) continue to render the Router shell. - Home page lists services with a UI and shows a whitelist-status banner. - Terminal tab runs nu sessions as hero_proc jobs over a WebSocket PTY proxy adapted from hero_proc_ui; xterm.js + FitAddon vendored. - Admin tab gains a SSH authorized_keys CRUD card backed by new ui.sshKeys.{list,add,delete} JSON-RPC methods on ui.sock only. - Docs tab renders crates/hero_router/docs/router_overview.md through pulldown-cmark; content cached in a OnceLock. - scripts/smoke_tabs.sh curls each tab and asserts the active marker. All new routes and RPC methods live on ui.sock + TCP only; rpc.sock is unchanged. #37