feat(dashboard): phase C richer panels — host time-series graph + cpu sparklines
Milestone 72 phase C — bring the host-view graphs onto the dashboard:
- host_resource_history widget reworked into a real host-view chart: epoch-ms
linear axis (no Chart.js date adapter), themed like the host-detail charts,
maintainAspectRatio:false so it fills the resized panel, unique canvas per
widget instance (wid), and empty states ("pick a host" / "no metrics yet").
Was previously unusable — it had a broken time axis and no way to choose a host.
- Add a "host" param type: the edit form renders a live dropdown of hosts
(dashboard routes now pass the host list to the editor); the chosen host_id is
stored in config and fed to the widget.
- Hosts-overview widget gains a per-row CPU sparkline (last hour) via the shared
sparkline_svg helper — the host-view at-a-glance trend, on the main widget.
Charts/sparklines render only in the browser, so CI can't exercise them — needs
an operator visual check.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+10
-3
@@ -279,13 +279,20 @@ WIDGET_REGISTRY: dict[str, dict] = {
|
||||
},
|
||||
"host_resource_history": {
|
||||
"key": "host_resource_history",
|
||||
"label": "Host Agent — History",
|
||||
"description": "CPU/memory/disk history for one host",
|
||||
"label": "Host Agent — History Graph",
|
||||
"description": "CPU / memory / disk time-series graph for one host (the host-view chart, on your dashboard)",
|
||||
"hx_url": "/plugins/host_agent/widget/history",
|
||||
"detail_url": "/plugins/host_agent/fleet/",
|
||||
"detail_url": "/hosts/",
|
||||
"plugin": "host_agent",
|
||||
"poll": True,
|
||||
"params": [
|
||||
# type "host" → the edit form renders a live dropdown of hosts.
|
||||
{
|
||||
"key": "host_id",
|
||||
"label": "Host",
|
||||
"type": "host",
|
||||
"default": "",
|
||||
},
|
||||
{
|
||||
"key": "hours",
|
||||
"label": "Time range",
|
||||
|
||||
Reference in New Issue
Block a user