{# The machine strip. Rendered on its own so it can be replaced whole without touching the rest of the page: the /events stream pushes this fragment as its named "machine" event and the sse-swap below swaps it in, where an hx-get timer used to poll for the same markup every five seconds. Everything here is set in mono with tabular figures, so a number changing does not make the row jump. #} {% import "_macros.html" as m %}
{{ machine.hostname }} {{ m.stat("up", machine.uptime) }} load {# data-metric lets panel.js refresh this figure from the 2-second metrics snapshot between the 5-second strip swaps. #} {{ "%.2f" | format(machine.load[0]) }} {# A sparkline shows the shape of the last few minutes, which a single number cannot. #} {{ m.capacity("mem", machine.memory_used, machine.memory_total, machine.memory_used_human, machine.memory_total_human) }} {{ m.capacity("disk", machine.disk_used, machine.disk_total, machine.disk_used_human, machine.disk_total_human) }} {% if machine.units_failed %} {{ machine.units_failed }} failed {% endif %} {% if machine.units_busy %} {{ machine.units_busy }} working {% endif %} {{ machine.units_active }} running