Files
FabledSteward/steward/templates/alerts/history.html
T
bvandeusenandClaude Opus 5.5 dc22a35e9d
CI / lint (push) Successful in 3s
CI / integration (push) Successful in 50s
CI / unit (push) Successful in 1m7s
CI / publish (push) Successful in 1m4s
feat(alerts): alert history page — transitions, deliveries, mutes and actions (#5066)
#5066 "Alert history page". /alerts/history lists every alert transition
in a range (1h–30d, the shared range picker), newest first, all rules or
one (?rule=). Each row: from → to, the value against the rule's condition
("no data" for a silent one), email and webhook sent or failed with the
error, "muted · <window>" (and "notified when the window ended") taken out
of the event note, other notes, and a link to the Ansible run an action
started. Range and rule changes swap only the rows (HTMX). Viewer role.

The Alerts page links each rule's history and the whole history. The query
moves to alert_svc.history, which MCP get_alert_history now uses too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 14:06:04 -04:00

33 lines
1.6 KiB
HTML

{% extends "base.html" %}
{% from "_macros.html" import crumbs %}
{% block title %}Alert History — Steward{% endblock %}
{% block breadcrumb %}{{ crumbs([("Alerts", "/alerts/"), ("History", "")]) }}{% endblock %}
{% block content %}
<div style="display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:0.75rem;margin-bottom:1.25rem;">
<h1 class="page-title" style="margin-bottom:0;">Alert History</h1>
<div style="display:flex;align-items:center;gap:0.75rem;flex-wrap:wrap;">
<select id="history-rule" name="rule" aria-label="Rule"
hx-get="/alerts/history" hx-target="#history-rows" hx-include="#time-range"
hx-trigger="change" hx-push-url="false"
onchange="var u=new URL(window.location); this.value ? u.searchParams.set('rule', this.value) : u.searchParams.delete('rule'); history.replaceState({}, '', u);">
<option value="">All rules</option>
{% for r in rules %}
<option value="{{ r.id }}" {% if chosen and chosen.id == r.id %}selected{% endif %}>{{ r.name }}</option>
{% endfor %}
</select>
{% include "_time_range.html" %}
</div>
</div>
<p style="color:var(--text-muted);font-size:0.88rem;margin-bottom:1.25rem;">
Every change of state, newest first: what the value was against the rule's condition, whether
the email and webhook went out, and the Ansible run an action started.
</p>
<div id="history-rows"
hx-get="/alerts/history" hx-trigger="rangeChange from:body"
hx-include="#time-range, #history-rule" hx-swap="innerHTML">
{% include "alerts/_history_rows.html" %}
</div>
{% endblock %}