{# monitors/widget.html — the dashboard Monitors widget (#5250): a verdict, then one row per monitor, problems first with why and since when, under one header of latency and uptime over 24h / 7d / 30d. It replaced the separate Uptime / SLA widget, so uptime has one home. #} {% from "_macros.html" import status_dot %} {% if not total %}
No monitors configured.{% if session.user_id %} Add a monitor →{% endif %}
{% else %}
{%- if counts.down %}{{ counts.down }} of {{ total }} monitor{{ 's' if total != 1 }} down{% if counts.degraded %}, {{ counts.degraded }} degraded{% endif %}. {%- elif counts.degraded %}{{ counts.degraded }} of {{ total }} monitor{{ 's' if total != 1 }} degraded, the rest up. {%- elif counts.pending %}{{ counts.pending }} not checked yet, {{ counts.up }} up. {%- else %}All {{ counts.up }} monitor{{ 's' if counts.up != 1 }} up{% if counts.paused %}, {{ counts.paused }} paused{% endif %}.{% endif -%}
{% if problems or rest %} {% for d in problems + rest %} {% set m = d.monitor %}{% set latest = d.latest %} {% for k in ("24h", "7d", "30d") %}{% set u = d.uptime.get(k) %} {% endfor %} {% endfor %}
MonitorLatency24h7d30d
{{- status_dot(d.state) -}} {% if session.user_id %}{{ m.name }}{% else %}{{ m.name }}{% endif %} {%- if d.state == 'down' %}went down {{ d.down_since|ago if d.down_since else '' }}{% if d.down_reason %} · {{ d.down_reason }}{% endif %} {%- elif d.state == 'degraded' %}{% if latest and status_class(latest.response_ms, 'latency') == 'crit' %}slow replies{% else %}checks failing now and then{% endif %} {%- elif d.state == 'pending' %}not checked yet{% endif %} {%- if latest and latest.is_up and latest.response_ms is not none %}{{ "%.0f"|format(latest.response_ms) }} ms{% else %}—{% endif -%} {% if u is none %}—{% else %}{{ "%.2f"|format(u) }}%{% endif %}
{% endif %} {% if more %}
+{{ more }} more up{% if session.user_id %} · all monitors{% endif %}
{% endif %} {% endif %}