{# hosts/uptime_widget.html — dashboard widget: SLA uptime summary #} {% if not hosts %}
No ping-enabled hosts configured.
{% else %}
Host 24h 7d 30d
{% for host in hosts %} {% set ut = uptime.get(host.id, {}) %}
{% if session.user_id %} {{ host.name }} {% else %} {{ host.name }} {% endif %} {% for window in ["24h", "7d", "30d"] %} {% set pct = ut.get(window) %} {% if pct is none %} {% elif pct >= 99.9 %} {{ "%.1f"|format(pct) }}% {% elif pct >= 99 %} {{ "%.1f"|format(pct) }}% {% elif pct >= 95 %} {{ "%.1f"|format(pct) }}% {% else %} {{ "%.1f"|format(pct) }}% {% endif %} {% endfor %}
{% endfor %}
{% if share_token %}
Full SLA →
{% endif %} {% endif %}