History (#5316): - Transitions fold into episodes (steward/alerts/episodes.py): each stretch out of quiet, the worst state it reached, how long it lasted, its worst reading against the rule ('3m 21s (fires above 3m)'), who was told across its changes, and its Ansible runs. The changes themselves fold under it. - An episode cut by paging says so ('cleared later (above)', 'earlier'). - For one rule: a verdict ('Fired 4 times in the last 7d, 1h 2m in all') and no Rule column. Notified and Action show only when the range has any. Tests: - The confirm guard looks for a confirm( call, not the word in the comment that says it is gone (lesson #4365). - The Hosts viewer test looks for the add-host dialog by id, since every page now carries the confirm dialog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.3 KiB
HTML
25 lines
1.3 KiB
HTML
{% extends "base.html" %}
|
|
{% from "_macros.html" import crumbs, page_header %}
|
|
{% block title %}Alert History — Steward{% endblock %}
|
|
{% block breadcrumb %}{{ crumbs([("Alerts", "/alerts/"), ("History", "")]) }}{% endblock %}
|
|
{% block content %}
|
|
{% call page_header("Alert history", "Each time a rule left quiet, newest first: what it reached and for how long, its worst reading, and who was told.") %}
|
|
<select id="history-rule" name="rule" aria-label="Rule" class="input" style="width:auto;"
|
|
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" %}
|
|
{% endcall %}
|
|
|
|
<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 %}
|