dashboard: surface the hive's hyperhive rev on the H0M3 start page
Adds hyperhive_rev to the dashboard's /api/state StateSnapshot, resolved via the same current_flake_rev helper get_agent_meta's per-agent hyperhive_rev already uses. home.js renders it next to the existing hive-identity line, truncated to the last 12 chars with the full value in title=, hidden when the flake ref isn't a local path pin. Requested by annika (infra.run) via dmatrix, hyperhive#2854.
This commit is contained in:
parent
6a6266cd5e
commit
761f4b8351
3 changed files with 22 additions and 0 deletions
|
|
@ -37,6 +37,13 @@ pub(super) struct StateSnapshot {
|
|||
/// "apply everything you've buffered".
|
||||
seq: u64,
|
||||
hostname: String,
|
||||
/// Current rev of the pinned `hyperhive` flake input, resolved the
|
||||
/// same way `get_agent_meta`'s per-agent `hyperhive_rev` is (see
|
||||
/// `auto_update::current_flake_rev`). `None` when the flake ref
|
||||
/// isn't a local path pin (e.g. a bare `github:` url) or the rev
|
||||
/// can't be resolved. Feeds the dashboard start page so an operator
|
||||
/// can tell what build a hive is running without shelling in.
|
||||
hyperhive_rev: Option<String>,
|
||||
any_stale: bool,
|
||||
containers: Vec<ContainerView>,
|
||||
transients: Vec<TransientView>,
|
||||
|
|
@ -382,6 +389,7 @@ pub(super) async fn api_state(
|
|||
axum::Json(StateSnapshot {
|
||||
seq,
|
||||
hostname,
|
||||
hyperhive_rev: crate::auto_update::current_flake_rev(&state.coord.hyperhive_flake),
|
||||
any_stale,
|
||||
containers,
|
||||
transients,
|
||||
|
|
|
|||
Loading…
Reference in a new issue