{# host_agent widget — fleet glance, flex rows (no header wrap) #}
{% from "_macros.html" import metric_style %}
{% if rows %}
{% for r in rows %}
{% set stale = r.stale %}
{% set name_style = "flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500;" %}
{% if session.user_id %}
{{ r.host.name }}
{% else %}
{{ r.host.name }}
{% endif %}
{% if r.cpu_pct is not none %}
cpu {{ "%.0f"|format(r.cpu_pct) }}%
{% endif %}
{% if r.mem_used_pct is not none %}
mem {{ "%.0f"|format(r.mem_used_pct) }}%
{% endif %}
{% if r.disk_root is not none %}
disk / {{ "%.0f"|format(r.disk_root) }}%
{% endif %}
{% if r.load_1m is not none %}
load {{ "%.2f"|format(r.load_1m) }}
{% endif %}
{{ r.reg.last_seen_at.strftime("%H:%M:%S") if r.reg.last_seen_at else "never" }}