feat: maintenance windows and Markdown descriptions
Monitors and groups get one-off or recurring maintenance. While it is in progress, failures neither open incidents nor alert, so the SLA is not affected; successes still resolve earlier incidents. The console shows monitors under maintenance and lists windows on a new page and on monitor pages. Status pages announce maintenance in progress and planned for the next two weeks and mark affected components; the occurrences are part of the snapshot and evaluated when the page is shown, so this also works from cache during an API outage. Maintenance and status page descriptions are rendered as Markdown. Closes #71 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
259b3b8e05
commit
43b0a35f20
28 files changed
+3918
-894
No files matched your search
@@ -103,6 +103,7 @@ templ statusDot(s Status) {
|
||||
templ.KV("bg-degraded", s == StatusDegraded),
|
||||
templ.KV("bg-down", s == StatusDown),
|
||||
templ.KV("bg-unknown", s == StatusUnknown),
|
||||
templ.KV("bg-maintenance", s == StatusMaintenance),
|
||||
templ.KV("border border-unknown", s == StatusPaused) }
|
||||
title={ i18n.T(ctx, "status."+string(s)) }
|
||||
></span>
|
||||
@@ -140,7 +141,7 @@ templ Dashboard(p Page, me Me, v DashboardView) {
|
||||
<h1 class="text-lg font-semibold">{ i18n.T(ctx, "console.monitors.title") }</h1>
|
||||
<div class="flex items-center gap-5 font-mono text-xs text-muted">
|
||||
@rangeSwitch(v.Ranges)
|
||||
for _, s := range []Status{StatusUp, StatusDegraded, StatusDown, StatusPaused} {
|
||||
for _, s := range []Status{StatusUp, StatusDegraded, StatusDown, StatusMaintenance, StatusPaused} {
|
||||
if v.Counts[s] > 0 {
|
||||
<span class="flex items-center gap-1.5">
|
||||
@statusDot(s)
|
||||
@@ -243,6 +244,16 @@ type MonitorDetailView struct {
|
||||
Recent []ResultRow
|
||||
Incidents []IncidentRow
|
||||
CanWrite bool
|
||||
// Maintenance lists current and upcoming maintenance.
|
||||
Maintenance []MaintenanceItem
|
||||
}
|
||||
|
||||
// MaintenanceItem is one occurrence of planned maintenance.
|
||||
type MaintenanceItem struct {
|
||||
Title string
|
||||
When string
|
||||
Description string
|
||||
Active bool
|
||||
}
|
||||
|
||||
templ MonitorDetail(p Page, me Me, v MonitorDetailView) {
|
||||
@@ -295,6 +306,12 @@ templ MonitorDetail(p Page, me Me, v MonitorDetailView) {
|
||||
<p class="mt-2 text-xs text-muted">{ i18n.T(ctx, "monitors.by_region_hint") }</p>
|
||||
</section>
|
||||
}
|
||||
if len(v.Maintenance) > 0 {
|
||||
<section class="mb-10">
|
||||
@sectionHeading("maintenance.title")
|
||||
@maintenanceList(v.Maintenance)
|
||||
</section>
|
||||
}
|
||||
<section class="mb-10">
|
||||
@sectionHeading("monitors.sla_table")
|
||||
<dl class="grid grid-cols-3 gap-px border border-rule bg-rule sm:grid-cols-9">
|
||||
|
||||
Reference in new issue
Block a user