Files
gandalf/templates/events.html
T
jaredandClaude Opus 5.5 9d561db703
Lint / JS (eslint) (push) Successful in 6s
Lint / Python (flake8) (push) Successful in 1m56s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 2m3s
Test / Python Tests (pytest) (push) Successful in 1m0s
Lint / Python (flake8) (pull_request) Successful in 48s
Lint / JS (eslint) (pull_request) Successful in 6s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Security / Python Security (bandit) (pull_request) Successful in 2m7s
Test / Python Tests (pytest) (pull_request) Successful in 2m6s
Add an alert history page and tie /health staleness to the poll interval
/events lists every alert from the last 24 hours to 90 days, open or
cleared, with how long each lasted, failed checks and its ticket. Filters
(device, type, severity, state, range) live in the URL, so device pages
and tickets link straight to a device's history. A "Recurring" table
lists alerts that fired more than once on the same target. On phones the
rows become cards.

/api/events/history backs it (100 per page). The existing /api/events is
unchanged.

/health and the dashboard's monitor indicator now call the monitor
stalled after five missed polls (at least 10 minutes) instead of a fixed
20, and /health reports the monitor's age.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 20:29:09 -05:00

67 lines
2.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}Alert History – GANDALF{% endblock %}
{% block content %}
<div class="lt-page-header">
<div>
<h1 class="lt-page-title">Alert History</h1>
<p class="g-page-sub">Every alert Gandalf raised, including the ones that cleared on their own. Resolved alerts are kept 90 days.</p>
</div>
</div>
<form class="cs-filters ev-filters" id="ev-filters" role="search" aria-label="Filter alert history">
<input type="search" class="lt-input" id="ev-target" name="target" placeholder="Device, host, port or interface"
aria-label="Filter by device" autocomplete="off">
<select class="lt-select" id="ev-range" name="range" aria-label="Time range">
<option value="24h">Last 24 hours</option>
<option value="7d" selected>Last 7 days</option>
<option value="30d">Last 30 days</option>
<option value="90d">Last 90 days</option>
</select>
<select class="lt-select" id="ev-type" name="type" aria-label="Alert type">
<option value="">All alert types</option>
</select>
<select class="lt-select" id="ev-severity" name="severity" aria-label="Severity">
<option value="">All severities</option>
<option value="critical">Critical</option>
<option value="warning">Warning</option>
<option value="info">Info</option>
</select>
<select class="lt-select" id="ev-status" name="status" aria-label="State">
<option value="all">Open and cleared</option>
<option value="active">Open now</option>
<option value="resolved">Cleared</option>
</select>
<button type="button" class="lt-btn lt-btn-secondary lt-btn-sm" id="ev-clear" hidden>Clear filters</button>
</form>
<div id="ev-summary" class="cs-summary" aria-live="polite"></div>
<section class="g-section" id="ev-flappers-section" hidden>
<div class="g-section-header">
<h2 class="g-section-title">Recurring</h2>
</div>
<p class="cs-hint">The same alert on the same target more than once in this range. Something that keeps coming back usually has one cause worth finding.</p>
<div class="lt-frame">
<span class="lt-frame-bl">&#x255A;</span><span class="lt-frame-br">&#x255D;</span>
<div id="ev-flappers"></div>
</div>
</section>
<section class="g-section">
<div class="g-section-header">
<h2 class="g-section-title">Alerts</h2>
<span class="g-section-badge" id="ev-count">0</span>
</div>
<div class="lt-frame">
<span class="lt-frame-bl">&#x255A;</span><span class="lt-frame-br">&#x255D;</span>
<div id="ev-table"><div class="lt-empty-state lt-empty-state--sm"><div class="lt-empty-state-title">Loading…</div></div></div>
</div>
<div class="ev-pager" id="ev-pager"></div>
</section>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='events.js') }}"></script>
{% endblock %}