From b6c5dcc3977f9bc39283570995c461f99c4eff76 Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 31 May 2026 23:35:47 +0200 Subject: [PATCH] docs: update P33RS tab wiring to match domain-as-key reshape --- docs/web-ui/dashboard.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/web-ui/dashboard.md b/docs/web-ui/dashboard.md index c9e7daf6..6847e769 100644 --- a/docs/web-ui/dashboard.md +++ b/docs/web-ui/dashboard.md @@ -14,7 +14,7 @@ swap. **Chrome header** (fixed, overlays the active tab pane): - **Tab strip**: `◆ SW4RM ◆`, `◆ Y3R C4LL ◆`, `◆ SYST3M ◆`, - `◆ SCH3DUL3S ◆`, `◆ P33RS ◆` (hidden when no peers configured), + `◆ SCH3DUL3S ◆`, `◆ P33RS ◆` (hidden when `swarm.peers` is empty), `◆ M4TR1X ◆ →` (optional page link, see below), `◆ FL0W ◆ →` (page link), and `◆ S3TT1NGS ◆`. Count pills on SW4RM (container count), Y3R C4LL (pending approvals + questions), and SCH3DUL3S @@ -182,31 +182,34 @@ operator has one place for everything time-fired. Peer hives in this swarm. The tab is hidden when the `state.peer_hives` array from `/api/state` is empty (i.e. no -`services.hyperhive.peers` are configured). When at least +`services.hyperhive.swarm.peers` are configured). When at least one peer is present the `hidden` attribute is removed and the tab becomes active. **P33R H1V3S** — each peer renders as a card row: a hexagon icon -(`⬡`), the peer's configured label as the primary name, and the -peer dashboard URL as a clickable secondary link. Clicking the +(`⬡`), the peer's DNS domain as the primary name, and the peer +dashboard HTTPS URL as a clickable secondary link. Clicking the URL opens the peer hive's dashboard in a new tab. ### Backend wiring -The host daemon reads `services.hyperhive.peers` from the -nix config, serialises each entry as `{ name, url }` into -`state.peer_hives: Vec`, and includes the field -in the `/api/state` snapshot. `tabs.js` reads -`state.peer_hives` on every `refreshState` call and calls +The host daemon reads `services.hyperhive.swarm.peers` from the +nix config (an attrset keyed by peer domain), serialises each +entry as `{ name, url }` into `state.peer_hives: Vec`, +and includes the field in the `/api/state` snapshot. `tabs.js` +reads `state.peer_hives` on every `refreshState` call and calls `renderPeerHives(peers)`, which rebuilds the `#peers-section` div from scratch. -The `name` field is the operator-assigned label; `url` is the -peer's dashboard root URL (e.g. `http://domain/`). Both come -from the env var `HYPERHIVE_PEERS` (a JSON array of -`{ label, domain }` pairs) that the nix module writes into the -c0re container environment. `parse_peer_hives()` in `dashboard.rs` -converts `domain` to `url = http://{domain}/` for the frontend. +The `name` field is the peer's DNS domain (the attrset key); `url` +is `https://{domain}/`. Both are derived from the env var +`HYPERHIVE_PEERS` (a JSON array of `{ domain, cert_fingerprint }` +objects) that the nix module writes into the c0re container +environment. `cert_fingerprint` is null for CA-trusted (e.g. +Let's Encrypt) peers and non-null to pin a self-signed cert. +`parse_peer_hives()` in `dashboard.rs` converts each entry to the +`PeerHiveView { name: domain, url: "https://domain/" }` shape the +frontend reads. ## S3TT1NGS tab