Files
nasmon/internal/web/templates/alerts.html
T
a.gritsenkoandClaude Sonnet 5 09159a5f31 Initial import: nasmon health monitor, split out of home_nas
Go service (nasmon/) plus nfpm packaging (packaging/), carried over from
the home_nas monorepo. Adds rpm packaging alongside the existing deb
build (Fedora/RHEL/Rocky dependency names via nfpm overrides, per-format
systemd unit path, dpkg+rpm-compatible maintainer scripts) and a Gitea
Actions workflow that builds both formats on every push.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 10:24:34 +03:00

35 lines
2.2 KiB
HTML

{{define "content"}}
{{template "flash" .}}
{{with .Data}}
{{if .LastMailErr}}<div class="flash crit">Last mail delivery failed: {{.LastMailErr}}</div>{{end}}
<section class="card">
<h2>Alert log <span class="muted small">{{if .All}}everything{{else}}open + resolved in the last 7 days{{end}}</span></h2>
{{if not .List}}<p class="muted">Nothing has happened yet.</p>{{end}}
{{range .List}}
<div class="alert {{if .ResolvedAt}}resolved{{else if .Acked}}acked{{else}}{{.Level}}{{end}}">
{{if .ResolvedAt}}
<form method="post" action="/alerts/{{.ID}}/delete" class="x-form"><button type="submit" class="x" title="Remove from the log">&times;</button></form>
{{else if not .Acked}}
<form method="post" action="/alerts/{{.ID}}/ack" class="x-form"><button type="submit" class="x" title="Acknowledge: hide until it changes or resolves">&times;</button></form>
{{end}}
<div class="alert-title">
{{if .ResolvedAt}}<span class="badge">resolved</span>{{else if .Acked}}<span class="badge">acked</span>{{else}}<span class="badge {{.Level}}">{{.Level}}</span>{{end}}
{{.Title}}
</div>
<pre class="alert-detail">{{.Detail}}</pre>
<div class="muted small">
opened {{dt .OpenedAt}}
{{if .ResolvedAt}} · resolved {{dtp .ResolvedAt}}{{end}}
{{if .Acked}} · acknowledged {{dtp .AckedAt}} · <form method="post" action="/alerts/{{.ID}}/unack" class="inline x-form"><button type="submit" class="link">show again</button></form>{{end}}
{{if .LastNotifiedAt}} · mailed {{dtp .LastNotifiedAt}}{{else if not .ResolvedAt}} · <span class="warn-text">not mailed</span>{{end}}
· <span class="mono">{{.Key}}</span>
</div>
</div>
{{end}}
{{if .All}}<p class="small"><a href="/alerts">Hide resolved alerts older than 7 days</a></p>
{{else if .Hidden}}<p class="small"><a href="/alerts?all=1">Show all ({{.Hidden}} older resolved hidden)</a></p>{{end}}
<p class="muted small">&times; on an open alert acknowledges it: it leaves the dashboard and stops e-mail reminders until the problem changes (higher level, grown counters) or resolves by itself. &times; on a resolved alert removes it from the log; resolved alerts older than 90 days are removed automatically.</p>
</section>
{{end}}
{{end}}