dashboard: distinct "gave up" badge for a crash-looped container
Frontend half of the two-PR split on the systemd restart-bound work
(clause 2): once a container's unit hits systemd's bounded restart
limit and stops on its own, that read exactly like a deliberate stop
("not running") — no way to tell "gave up" from "off on purpose".
Renders ContainerView.failed as a distinct red "gave up" badge on the
container row, in place of the muted "not running" badge. Both states
have running: false; failed is the new orthogonal fact that tells them
apart, same "independent flags, no state machine" shape as
paused/needs_update/needs_login. An older backend without the field
serves failed: undefined, which reads falsy, so this degrades cleanly
to the existing single "not running" badge.
Frontend-only — no Rust changes. Safe to merge in either order
relative to the backend PR carrying ContainerView.failed itself.
This commit is contained in:
parent
d3ac4de8fb
commit
b785f96d30
2 changed files with 34 additions and 10 deletions
|
|
@ -892,12 +892,22 @@ fetch entirely.
|
|||
**When the container is stopped** (`ContainerView.running = false`),
|
||||
the async `dashboard-state` fetch is skipped entirely (the agent
|
||||
web server is down), so the badge chain is replaced by a single
|
||||
muted `■ not running` badge, the nav strip is empty, and status
|
||||
text / rate-limited / ctx badges are suppressed. The agent icon
|
||||
goes straight to the dimmed `/favicon.svg` fallback instead of
|
||||
attempting a doomed load from the container's URL. Static fields
|
||||
— `needs_update`, `deployed_sha`, `pending_reminders`, `parent`,
|
||||
`config` link — remain visible regardless of run state.
|
||||
badge, the nav strip is empty, and status text / rate-limited / ctx
|
||||
badges are suppressed. The agent icon goes straight to the dimmed
|
||||
`/favicon.svg` fallback instead of attempting a doomed load from the
|
||||
container's URL. Static fields — `needs_update`, `deployed_sha`,
|
||||
`pending_reminders`, `parent`, `config` link — remain visible
|
||||
regardless of run state.
|
||||
**Which single badge (hyperhive#3139):** `ContainerView.failed`
|
||||
(systemd `ActiveState=failed` — the unit exhausted its bounded
|
||||
restarts and gave up on its own) draws a red `✖ gave up` badge;
|
||||
otherwise a plain muted `■ not running` — a container an operator
|
||||
stopped deliberately. Both states read `running: false`; `failed` is
|
||||
the orthogonal fact (a fifth one alongside `paused`/`needs_update`/
|
||||
`needs_login`, same "independent flags, no state machine" shape —
|
||||
see `ContainerView`'s own doc comment) that tells them apart. An
|
||||
older backend without the field serves `failed: undefined`, which
|
||||
reads falsy — degrades cleanly to the single `not running` badge.
|
||||
When the container is running, status badges follow — `⊘ rate
|
||||
limited` (red, while the harness is parked after a 429), `needs
|
||||
login`, `needs update` — plus **one `◐ pending-state…` pill per
|
||||
|
|
|
|||
Loading…
Reference in a new issue