Files
FabledSteward/fabledscryer/templates/hosts/uptime_widget.html
T
bvandeusen ced1eebe1d feat: maintenance windows, reports, uptime widget, alert improvements
- Add maintenance window scheduling to suppress alerts during planned
  downtime (model, routes, templates)
- Add weekly email/webhook reports with host summary (core/reports.py,
  Settings → Reports tab)
- Add host uptime history widget with per-check sparkline view
- Expand alert rules: dynamic metric catalog for plugin sources,
  per-rule HTMX field loading, maintenance window awareness
- Register additional dashboard widgets (uptime, SNMP, UniFi, UPS)
- Add Settings → Reports tab configuration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 08:15:30 -04:00

46 lines
1.8 KiB
HTML

{# hosts/uptime_widget.html — dashboard widget: SLA uptime summary #}
{% if not hosts %}
<div style="color:var(--text-muted);font-size:0.85rem;padding:0.5rem 0;">
No ping-enabled hosts configured.
</div>
{% else %}
<div style="display:grid;gap:2px;">
<div style="display:grid;grid-template-columns:1fr 52px 52px 52px;gap:0.35rem;font-size:0.72rem;color:var(--text-dim);padding:0 0 0.25rem;border-bottom:1px solid var(--border);">
<span>Host</span>
<span style="text-align:center;">24h</span>
<span style="text-align:center;">7d</span>
<span style="text-align:center;">30d</span>
</div>
{% for host in hosts %}
{% set ut = uptime.get(host.id, {}) %}
<div style="display:grid;grid-template-columns:1fr 52px 52px 52px;gap:0.35rem;align-items:center;padding:0.15rem 0;font-size:0.82rem;">
<span style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{{ host.name }}</span>
{% for window in ["24h", "7d", "30d"] %}
{% set pct = ut.get(window) %}
<span style="text-align:center;font-family:ui-monospace,monospace;font-size:0.78rem;">
{% if pct is none %}
<span style="color:var(--text-dim);"></span>
{% elif pct >= 99.9 %}
<span style="color:var(--green);">{{ "%.1f"|format(pct) }}%</span>
{% elif pct >= 99 %}
<span style="color:var(--yellow);">{{ "%.1f"|format(pct) }}%</span>
{% elif pct >= 95 %}
<span style="color:var(--orange);">{{ "%.1f"|format(pct) }}%</span>
{% else %}
<span style="color:var(--red);">{{ "%.1f"|format(pct) }}%</span>
{% endif %}
</span>
{% endfor %}
</div>
{% endfor %}
</div>
{% if share_token %}
<div style="margin-top:0.5rem;text-align:right;">
<a href="/hosts/uptime" style="font-size:0.75rem;color:var(--text-muted);">Full SLA →</a>
</div>
{% endif %}
{% endif %}