devbox/internal/hub/dashboard/index.html
shoemoney 2d407d418a feat: hub live dashboard backend — state + SSE flow stream 📊🛰️
Optional, off by default: devbox-hub serve --dashboard [--dashboard-addr
127.0.0.1:8099]. A separate, loopback-by-default listener (never widens the
API surface; warns if bound non-loopback since it's unauthenticated read-only).

- internal/hub/dashboard: embedded UI (go:embed index.html) + GET /api/state
  (hub/totals/devices/shares snapshot) + GET /api/events (SSE live flow stream).
  A nil *Dashboard is Emit-safe so hub handlers call it unconditionally.
- meta reads for the snapshot: Devices(), ShareStats() (one rolled-up query),
  SumChunkBytes(). 'online' is activity-tracked since hub start (2-min window).
- hub emits 'join' (device enrolled) and 'push' (device→share, bytes/chunks/
  snapshot/new_head) flow events.
Tests: state reflects the DB + a push event reaches a live SSE subscriber +
nil-safe Emit. index.html here is a placeholder — the epic frontend lands next.
2026-06-23 12:35:36 -05:00

5 lines
284 B
HTML

<!doctype html><meta charset="utf-8"><title>devbox hub</title>
<!-- placeholder — replaced by the embedded live dashboard at build/integration time -->
<body style="background:#0b0e14;color:#cdd9e5;font:14px system-ui;padding:2rem">
📦 devbox hub dashboard — loading…
</body>