Files
FabledSteward/fabledscryer/templates/alerts/maintenance.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

77 lines
2.7 KiB
HTML

{% extends "base.html" %}
{% block title %}Maintenance Windows — Fabled Scryer{% endblock %}
{% block content %}
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;">
<h1 class="page-title" style="margin-bottom:0;">Maintenance Windows</h1>
<div style="display:flex;gap:0.5rem;">
<a class="btn btn-ghost" href="/alerts/">← Alerts</a>
<a class="btn" href="/alerts/maintenance/new">New Window</a>
</div>
</div>
<p style="color:var(--text-muted);font-size:0.88rem;margin-bottom:1.5rem;">
During an active window, alert rule evaluation is suppressed for the matching scope.
Metrics are still recorded — only notifications are silenced.
</p>
{% if windows %}
<div class="card-flush">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Scope</th>
<th>Start</th>
<th>End</th>
<th style="text-align:center;">Status</th>
<th></th>
</tr>
</thead>
<tbody>
{% for w in windows %}
{% set is_active = w.start_at <= now and w.end_at >= now %}
{% set is_upcoming = w.start_at > now %}
<tr>
<td style="font-weight:500;">{{ w.name }}</td>
<td style="font-size:0.85rem;color:var(--text-muted);">
{% if w.scope_source is none %}
<span title="All alert rules">All alerts</span>
{% elif w.scope_resource is none %}
<span>{{ w.scope_source }}/*</span>
{% else %}
<span>{{ w.scope_source }}/{{ w.scope_resource }}</span>
{% endif %}
</td>
<td style="font-size:0.85rem;font-family:ui-monospace,monospace;">
{{ w.start_at.strftime("%Y-%m-%d %H:%M") }} UTC
</td>
<td style="font-size:0.85rem;font-family:ui-monospace,monospace;">
{{ w.end_at.strftime("%Y-%m-%d %H:%M") }} UTC
</td>
<td style="text-align:center;">
{% if is_active %}
<span class="badge badge-yellow">active</span>
{% elif is_upcoming %}
<span class="badge badge-dim">upcoming</span>
{% else %}
<span style="color:var(--text-dim);font-size:0.8rem;">expired</span>
{% endif %}
</td>
<td class="td-actions">
<form method="post" action="/alerts/maintenance/{{ w.id }}/delete" style="display:inline;">
<button type="submit" class="btn btn-sm btn-danger"
onclick="return confirm('Delete window &quot;{{ w.name }}&quot;?')">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="card" style="text-align:center;padding:3rem;">
<p style="color:var(--text-muted);">No maintenance windows configured.</p>
</div>
{% endif %}
{% endblock %}