feat: incident updates with a status, public or internal
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m54s
ci / test (pull_request) Successful in 12m15s
ci / build (pull_request) Successful in 11m0s
ci / image (pull_request) Successful in 4m23s
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m54s
ci / test (pull_request) Successful in 12m15s
ci / build (pull_request) Successful in 11m0s
ci / image (pull_request) Successful in 4m23s
Outages open and close with their monitor; now people can say what is going on. An incident gets an optional title and updates, each with a status (investigating, identified, monitoring, resolved) and a Markdown message, shown on status pages or kept as an internal note. The incident shows the latest update's status, resolved once its monitor recovered. The console lists title and status and has a page per incident with its timeline (outage, updates, recovery) and, for incidents.write in the monitor's group, forms to post updates and set the title. Status pages show title, status and public updates. API: GET/PATCH /org/incidents/:id, POST and DELETE /org/incidents/:id/updates; the incident list carries title and status; the organization export includes the updates. 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
6f0cf59406
commit
43a04e99b1
27 files changed
+2753
-908
No files matched your search
+44
-13
@@ -293,20 +293,38 @@ templ publicIncidents(incidents []agentapi.PageIncident) {
|
||||
} else {
|
||||
<ul class="divide-y divide-rule border-y border-rule text-sm">
|
||||
for _, inc := range incidents {
|
||||
<li class="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-2.5">
|
||||
if inc.ResolvedAt == nil {
|
||||
<span class="font-medium text-down">{ i18n.T(ctx, "incidents.ongoing") }</span>
|
||||
} else {
|
||||
<span class="text-up">{ i18n.T(ctx, "incidents.resolved") }</span>
|
||||
}
|
||||
<span>{ inc.Component }</span>
|
||||
<span class="ml-auto font-mono text-xs text-muted">
|
||||
{ inc.StartedAt.UTC().Format("2006-01-02 15:04") }
|
||||
if inc.ResolvedAt != nil {
|
||||
– { inc.ResolvedAt.UTC().Format("15:04") }
|
||||
<li class="py-3">
|
||||
<div class="flex flex-wrap items-baseline gap-x-4 gap-y-1">
|
||||
@incidentStatusLabel(inc.Status, inc.ResolvedAt == nil)
|
||||
if inc.Title != "" {
|
||||
<span class="font-medium">{ inc.Title }</span>
|
||||
<span class="text-xs text-muted">{ inc.Component }</span>
|
||||
} else {
|
||||
<span>{ inc.Component }</span>
|
||||
}
|
||||
UTC
|
||||
</span>
|
||||
<span class="ml-auto font-mono text-xs text-muted">
|
||||
{ inc.StartedAt.UTC().Format("2006-01-02 15:04") }
|
||||
if inc.ResolvedAt != nil {
|
||||
– { inc.ResolvedAt.UTC().Format("15:04") }
|
||||
}
|
||||
UTC
|
||||
</span>
|
||||
</div>
|
||||
if len(inc.Updates) > 0 {
|
||||
<ol class="ml-1 mt-3 space-y-3 border-l border-rule pl-4">
|
||||
for _, u := range inc.Updates {
|
||||
<li>
|
||||
<p class="text-xs">
|
||||
@incidentStatusLabel(u.Status, true)
|
||||
<span class="font-mono text-muted">{ " · " + u.At.UTC().Format("2006-01-02 15:04") + " UTC" }</span>
|
||||
</p>
|
||||
<div class="legal-text mt-1">
|
||||
@templ.Raw(Markdown(u.Message))
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
</ol>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
@@ -314,6 +332,19 @@ templ publicIncidents(incidents []agentapi.PageIncident) {
|
||||
</section>
|
||||
}
|
||||
|
||||
// incidentStatusLabel names an incident's status: what the organization
|
||||
// said, or ongoing or resolved when it said nothing.
|
||||
templ incidentStatusLabel(status string, open bool) {
|
||||
switch {
|
||||
case status != "":
|
||||
<span class={ "font-medium", incidentStatusClass(status) }>{ i18n.T(ctx, "incident.status."+status) }</span>
|
||||
case open:
|
||||
<span class="font-medium text-down">{ i18n.T(ctx, "incidents.ongoing") }</span>
|
||||
default:
|
||||
<span class="text-up">{ i18n.T(ctx, "incidents.resolved") }</span>
|
||||
}
|
||||
}
|
||||
|
||||
templ pageMaintenance(heading string, items []agentapi.PageMaintenance) {
|
||||
if len(items) > 0 {
|
||||
<section class="mb-12">
|
||||
|
||||
Reference in new issue
Block a user