0.31.1: make dashboard metrics honest

- Container card now compares compose-only counts across hosts: agents
  report compose_running in /agent/system (pre-0.31.1 agents fall back to
  the all-containers number); card retitled, ResourceBar stat labelled
  'Containers (all)'.
- Uptime is sampled every 5 min (background loop + opportunistic on read)
  and charted as daily averages instead of a once-a-day snapshot; no
  sample is written when no compose containers exist (was: fake 100%).
  Legacy daily entries in uptime.jsonl still count; file pruned at startup.
- Funnel stage 'monitored' is now per-stack and real: stacks with an
  enabled local auto-update policy (was: global webhook-exists toggle).
  Frontend label renamed to 'Auto-managed'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
menzelj
2026-06-12 08:13:16 +00:00
co-authored by Claude Fable 5
parent 1609b8bcc3
commit 11effdc2ca
7 changed files with 127 additions and 41 deletions
+10 -8
View File
@@ -172,14 +172,16 @@ as intuitive as Dockge, as capable as Portainer for Compose workflows.
(`bg`/`card`/`accent`) are remapped onto the tokens so all pages reskin
consistently. Typeface: Schibsted Grotesk (bundled, offline-friendly).
- **Stack Health funnel** — the dashboard centrepiece. Five stages
(`discovered → running → healthy → updated → monitored`) from
`GET /api/dashboard/funnel` (30 s server cache, `?refresh=true` to bust).
SVG waterfall with alternating gradient / diagonal-hatch bars, value chips
and hover conversion/drop-off tooltips.
- **Summary widgets** from `GET /api/dashboard/summary`: containers-running
card with per-host breakdown and an "Insights" chip (healthy-rate %), a
30-day uptime line chart (daily samples appended to `DATA_DIR/uptime.jsonl`),
and an ops contribution grid from audit-log activity with the peak weekday.
(`discovered → running → healthy → updated → auto-managed`) from
`GET /api/dashboard/funnel` (30 s server cache, `?refresh=true` to bust;
the last stage — API key `monitored` — counts stacks with an enabled
auto-update policy). SVG waterfall with alternating gradient /
diagonal-hatch bars, value chips and hover conversion/drop-off tooltips.
- **Summary widgets** from `GET /api/dashboard/summary`: compose-containers
card with per-host breakdown (agents report a compose-only count) and an
"Insights" chip (healthy-rate %), a 30-day uptime line chart (sampled every
5 min into `DATA_DIR/uptime.jsonl`, charted as daily averages), and an ops
contribution grid from audit-log activity with the peak weekday.
A 30/7-day range selector slices both series client-side.
- **Explore prompt bar** under the funnel: typed queries or `/running`,
`/stopped`, `/attention` tags deep-link to the Stacks page, which now