From 7d144780df3dd1fd2713127d87e7c192ce239641 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 19 Jun 2026 23:01:56 -0400 Subject: [PATCH] fix(host_agent): TB/PB byte scaling + rebalance the full-metrics layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two issues on the host full-metrics view: - fmt_bytes capped at GB, so large filesystems read "25369.0 GB" instead of "24.8 TB". Add TB and PB tiers. - Interfaces/Disks/Temperatures shared one 3-column grid, so all three cards stretched to the Temperatures height — a 40-core CPU made one very tall column and left Interfaces/Disks with large empty space. Split them: Interfaces + Disks sit side-by-side at natural height (align-items:start); Temperatures becomes a full-width card whose readings flow into a compact multi-column grid (wide-and-short instead of one tall column). UI-only. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_016Jg27rgypiW2efULXJDtMC --- plugins/host_agent/templates/host_detail.html | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/plugins/host_agent/templates/host_detail.html b/plugins/host_agent/templates/host_detail.html index 9b18f86..14c63f3 100644 --- a/plugins/host_agent/templates/host_detail.html +++ b/plugins/host_agent/templates/host_detail.html @@ -12,6 +12,8 @@ {% endmacro %} {% macro fmt_bytes(v) %} {%- if v is none -%}— +{%- elif v >= 1125899906842624 -%}{{ "%.1f"|format(v / 1125899906842624) }} PB +{%- elif v >= 1099511627776 -%}{{ "%.1f"|format(v / 1099511627776) }} TB {%- elif v >= 1073741824 -%}{{ "%.1f"|format(v / 1073741824) }} GB {%- elif v >= 1048576 -%}{{ "%.0f"|format(v / 1048576) }} MB {%- else -%}{{ "%.0f"|format(v / 1024) }} KB @@ -148,16 +150,16 @@ {% endif %} -{# ── Interfaces / disks / sensors current detail ──────────────────────────── #} -{% if nets or disks_io or temps %} -
+{# ── Interfaces / disks (short panels, side by side at natural height) ─────── #} +{% if nets or disks_io %} +
{% if nets %}
Interfaces
{% for iface, m in nets.items() %} -
+
{{ iface }} - ↓ {{ fmt_bps(m.get('net_rx_bps')) }} · ↑ {{ fmt_bps(m.get('net_tx_bps')) }} + ↓ {{ fmt_bps(m.get('net_rx_bps')) }} · ↑ {{ fmt_bps(m.get('net_tx_bps')) }}
{% endfor %}
@@ -166,24 +168,29 @@
Disks
{% for dev, m in disks_io.items() %} -
+
{{ dev }} - rd {{ fmt_bps(m.get('disk_read_bps')) }} · wr {{ fmt_bps(m.get('disk_write_bps')) }} + rd {{ fmt_bps(m.get('disk_read_bps')) }} · wr {{ fmt_bps(m.get('disk_write_bps')) }}
{% endfor %}
{% endif %} - {% if temps %} -
-
Temperatures
+
+{% endif %} + +{# ── Temperatures (full width; cores flow into a compact multi-column grid so a + many-core CPU reads wide-and-short instead of one very tall column) ─────── #} +{% if temps %} +
+
Temperatures
+
{% for label, c in temps.items() %} -
- {{ label }} +
+ {{ label }} {% if c is not none %}{{ "%.0f"|format(c) }}°C{% else %}—{% endif %}
{% endfor %}
- {% endif %}
{% endif %}