fix(dashboard): inline cpu sparkline, history graph host label + stable y-axis
CI / lint (push) Successful in 2s
CI / unit (push) Successful in 7s
CI / integration (push) Successful in 2m16s
CI / publish (push) Successful in 54s

- Hosts-Overview: move the CPU sparkline inline next to the cpu % value it
  represents (was floated far right on the name line, reading as unrelated).
- Host Agent history widget: caption the chart with the host it represents
  (the panel title is generic) — links to the host hub.
- History widget: snap the y-axis to a stable 0..next-10%-band ceiling instead
  of auto-scaling to the exact peak, so the 'zoom' no longer jumps each poll.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 16:44:31 -04:00
parent ebc67723d2
commit 10808c1c5d
3 changed files with 26 additions and 8 deletions
+8
View File
@@ -465,8 +465,16 @@ async def widget_history():
# hundredsthousands of points — a noisy, unreadable line. Bucket-average to a
# readable point count, keeping the shape.
series = {k: _downsample(v) for k, v in series.items()}
# Stable y-axis ceiling. All three series are percentages, so snap the top up
# to the next 10% band (floor 20, cap 100). Auto-scaling to the exact peak made
# the chart "zoom" jump on every poll as the peak drifted a few %; snapping to
# a band keeps the axis steady across refreshes while still filling the panel.
peak = max((p[1] for s in series.values() for p in s), default=0.0)
y_max = min(100, max(20, ((int(peak) // 10) + 1) * 10))
return await render_template(
"widget_history.html", host=host, series=series, hours=hours, wid=wid,
y_max=y_max,
)