{# HTMX fragment — included in both /ping/ page and dashboard widget #} {% macro pill_bg(p) %} {%- if p is none or p.status.value == 'down' or p.response_time_ms is none -%} #6a1515 {%- elif p.response_time_ms <= good_ms -%} #1a6632 {%- elif p.response_time_ms <= warn_ms -%} #6b5c00 {%- else -%} #7a3800 {%- endif -%} {% endmacro %} {% macro pill_title(p) %} {%- if p is none -%}No data {%- elif p.status.value == 'down' -%}Down — {{ p.probed_at.strftime('%H:%M:%S') }} UTC {%- else -%}{{ "%.1f"|format(p.response_time_ms) }} ms — {{ p.probed_at.strftime('%H:%M:%S') }} UTC {%- endif -%} {% endmacro %} {% if hosts %} {% for host in hosts %} {% set host_pings = pings_by_host.get(host.id, []) %} {% set last = host_pings[-1] if host_pings else none %}
No ping-enabled hosts. Add hosts →
{% endif %}