From ebc67723d2ff7a228d6ed9b45528278321f4b78b Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 17 Jun 2026 16:31:27 -0400 Subject: [PATCH] feat(host_agent): horizontal zebra-striped fleet widget rows Restore the host_agent fleet-glance widget to one horizontal row per host (name left, metric cells + sparklines right) instead of the multi-column block grid, and zebra-stripe odd rows so adjacent hosts read as distinct. Names still wrap rather than hard-truncate. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../host_agent/templates/widget_table.html | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/plugins/host_agent/templates/widget_table.html b/plugins/host_agent/templates/widget_table.html index a403a0c..30fac53 100644 --- a/plugins/host_agent/templates/widget_table.html +++ b/plugins/host_agent/templates/widget_table.html @@ -1,37 +1,41 @@ -{# host_agent widget — fleet glance. Per host: name on its own line (never - truncated), then a row of metric cells (cpu/mem/disk/load), each value with a - trend sparkline beneath it — the host-page AGENT panel, on the dashboard. #} +{# host_agent widget — fleet glance. One horizontal row per host, zebra-striped + so adjacent hosts read as distinct groupings: health dot + host name on the + left, metric cells (cpu/mem/disk/load) each with a trend sparkline laid out + horizontally on the right. The name wraps (never hard-truncated) but the row + stays horizontal. #} {% from "_macros.html" import metric_style %} {% if rows %} {% macro metric_cell(label, value, fmt, svg, style="", title="") %} -
-
{{ label }}
+
+
{{ label }}
{% if value is not none %}{{ fmt|format(value) }}{% else %}—{% endif %}
{{ svg | safe }}
{% endmacro %} -
+
{% for r in rows %} {% set stale = r.stale %} -
- {# Line 1 — health dot + full host name (own line) + last seen #} -
+
+ {# Left — health dot + full host name (wraps, never truncated) + last seen #} +
- {% if session.user_id %} - {{ r.host.name }} - {% else %} - {{ r.host.name }} - {% endif %} - - {{ r.reg.last_seen_at.strftime("%H:%M:%S") if r.reg.last_seen_at else "never" }} + + {% if session.user_id %} + {{ r.host.name }} + {% else %} + {{ r.host.name }} + {% endif %} + + {{ r.reg.last_seen_at.strftime("%H:%M:%S") if r.reg.last_seen_at else "never" }} +
- {# Line 2 — metric cells with value + trend; wraps instead of truncating #} -
+ {# Right — metric cells with value + trend, laid out horizontally #} +
{{ metric_cell("cpu", r.cpu_pct, "%.0f%%", r.sparks.cpu, metric_style(r.cpu_pct), "Average CPU utilization") }} {{ metric_cell("mem", r.mem_used_pct, "%.0f%%", r.sparks.mem, metric_style(r.mem_used_pct), "Memory in use") }} {{ metric_cell("disk /", r.disk_root, "%.0f%%", r.sparks.disk, metric_style(r.disk_root), "Root filesystem (/) usage") }}