feat: show monitor editors what the checker saw
The API keeps the latest success per monitor and region and failures, thinned to one per five minutes while the error stays the same, for UPTIME_RETENTION_EVIDENCE (30 days). Monitor pages link evidence from the recent checks; a page shows timing, redirect chain with headers, certificate and the body as text. Readers see none of it, since responses may contain personal data or secrets. Closes #79 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
8f5eb5d075
commit
126d3a2fce
16 files changed
+3026
-1054
No files matched your search
@@ -217,6 +217,8 @@ type ResultRow struct {
|
||||
OK bool
|
||||
Latency string
|
||||
Detail string
|
||||
// EvidenceURL links to what the checker saw, for editors.
|
||||
EvidenceURL string
|
||||
}
|
||||
|
||||
// IncidentRow is an incident in a list.
|
||||
@@ -248,6 +250,8 @@ type MonitorDetailView struct {
|
||||
Maintenance []MaintenanceItem
|
||||
// PingURL is set for heartbeat monitors the viewer may change.
|
||||
PingURL string
|
||||
// Evidence lists what checkers saw; only editors get it.
|
||||
Evidence []EvidenceRow
|
||||
}
|
||||
|
||||
// MaintenanceItem is one occurrence of planned maintenance.
|
||||
@@ -361,6 +365,9 @@ templ MonitorDetail(p Page, me Me, v MonitorDetailView) {
|
||||
@incidentList(v.Incidents, false)
|
||||
</section>
|
||||
}
|
||||
if len(v.Evidence) > 0 {
|
||||
@evidenceList(v.Evidence)
|
||||
}
|
||||
<section>
|
||||
@sectionHeading("monitors.recent")
|
||||
<table class="w-full text-left text-sm">
|
||||
@@ -377,7 +384,12 @@ templ MonitorDetail(p Page, me Me, v MonitorDetailView) {
|
||||
}
|
||||
</td>
|
||||
<td class="py-1.5 pr-4 font-mono text-xs">{ r.Latency }</td>
|
||||
<td class="py-1.5 font-mono text-xs text-muted">{ r.Detail }</td>
|
||||
<td class="py-1.5 font-mono text-xs text-muted">
|
||||
{ r.Detail }
|
||||
if r.EvidenceURL != "" {
|
||||
<a href={ templ.SafeURL(r.EvidenceURL) } class="ml-2 underline underline-offset-2 hover:text-ink">{ i18n.T(ctx, "evidence.show") }</a>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
Reference in new issue
Block a user