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
@@ -0,0 +1,37 @@
|
||||
package web
|
||||
|
||||
// IncidentStatuses are the statuses an incident update gives, in their
|
||||
// usual order.
|
||||
var IncidentStatuses = []string{"investigating", "identified", "monitoring", "resolved"}
|
||||
|
||||
// incidentStatusClass colors an incident status: red while it is being
|
||||
// worked on, amber while watched, green once resolved.
|
||||
func incidentStatusClass(status string) string {
|
||||
switch status {
|
||||
case "resolved":
|
||||
return "text-up"
|
||||
case "monitoring":
|
||||
return "text-degraded"
|
||||
}
|
||||
return "text-down"
|
||||
}
|
||||
|
||||
// IncidentTimelineEntry is an update or one of the monitor's own events
|
||||
// on an incident's timeline.
|
||||
type IncidentTimelineEntry struct {
|
||||
At string
|
||||
// Kind is update, started or resolved.
|
||||
Kind string
|
||||
// Update fields.
|
||||
ID, Status, HTML, Author string
|
||||
Public bool
|
||||
}
|
||||
|
||||
// IncidentDetailView is the page of one incident.
|
||||
type IncidentDetailView struct {
|
||||
Row IncidentRow
|
||||
CanWrite bool
|
||||
Timeline []IncidentTimelineEntry
|
||||
// NextStatus preselects the status of the next update.
|
||||
NextStatus string
|
||||
}
|
||||
@@ -286,6 +286,9 @@ type IncidentRow struct {
|
||||
Duration string
|
||||
Open bool
|
||||
Cause []string
|
||||
// Title and Status are what the organization said about it.
|
||||
Title string
|
||||
Status string
|
||||
}
|
||||
|
||||
// MonitorDetailView is the data of a monitor page.
|
||||
@@ -496,15 +499,14 @@ templ incidentList(rows []IncidentRow, showMonitor bool) {
|
||||
for _, r := range rows {
|
||||
<li class="py-2.5">
|
||||
<div class="flex flex-wrap items-baseline gap-x-4 gap-y-1">
|
||||
if r.Open {
|
||||
<span class="font-medium text-down">{ i18n.T(ctx, "incidents.ongoing") }</span>
|
||||
} else {
|
||||
<span class="text-up">{ i18n.T(ctx, "incidents.resolved") }</span>
|
||||
@incidentStatusLabel(r.Status, r.Open)
|
||||
if r.Title != "" {
|
||||
<a href={ templ.SafeURL("/incidents/" + r.ID) } class="font-medium hover:underline">{ r.Title }</a>
|
||||
}
|
||||
if showMonitor {
|
||||
<a href={ templ.SafeURL("/monitors/" + r.MonitorID) } class="hover:underline">{ r.Monitor }</a>
|
||||
}
|
||||
<span class="font-mono text-xs text-muted">{ r.Started }</span>
|
||||
<a href={ templ.SafeURL("/incidents/" + r.ID) } class="font-mono text-xs text-muted hover:text-ink">{ r.Started }</a>
|
||||
<span class="ml-auto font-mono text-xs">{ r.Duration }</span>
|
||||
</div>
|
||||
if len(r.Cause) > 0 {
|
||||
@@ -1365,3 +1367,92 @@ func providerGroups(ps []ProviderOption) []string {
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// IncidentDetailPage tells the story of one incident and lets people with
|
||||
// incidents.write add to it.
|
||||
templ IncidentDetailPage(p Page, me Me, v IncidentDetailView) {
|
||||
@consoleShell(p, me) {
|
||||
<p class="mb-2 text-sm"><a href="/incidents" class="text-muted hover:text-ink">{ "← " + i18n.T(ctx, "incidents.all") }</a></p>
|
||||
<h1 class="mb-2 text-xl font-semibold">
|
||||
if v.Row.Title != "" {
|
||||
{ v.Row.Title }
|
||||
} else {
|
||||
{ v.Row.Monitor }
|
||||
}
|
||||
</h1>
|
||||
<div class="mb-8 flex flex-wrap items-baseline gap-x-4 gap-y-1 text-sm">
|
||||
@incidentStatusLabel(v.Row.Status, v.Row.Open)
|
||||
<a href={ templ.SafeURL("/monitors/" + v.Row.MonitorID) } class="hover:underline">{ v.Row.Monitor }</a>
|
||||
<span class="font-mono text-xs text-muted">{ v.Row.Started + " · " + v.Row.Duration }</span>
|
||||
</div>
|
||||
<div class="grid gap-12 md:grid-cols-[1fr_20rem]">
|
||||
<section>
|
||||
@sectionHeading("incident.timeline")
|
||||
<ol class="space-y-5 border-l border-rule pl-5">
|
||||
for _, e := range v.Timeline {
|
||||
<li>
|
||||
switch e.Kind {
|
||||
case "update":
|
||||
<p class="flex flex-wrap items-baseline gap-x-3 text-xs">
|
||||
@incidentStatusLabel(e.Status, true)
|
||||
<span class="font-mono text-muted">{ e.At }</span>
|
||||
if e.Author != "" {
|
||||
<span class="text-muted">{ e.Author }</span>
|
||||
}
|
||||
if !e.Public {
|
||||
<span class="border border-rule px-1 text-muted">{ i18n.T(ctx, "incident.internal") }</span>
|
||||
}
|
||||
if v.CanWrite {
|
||||
<button type="button" data-delete={ "/org/incidents/" + v.Row.ID + "/updates/" + e.ID } data-confirm={ i18n.T(ctx, "incident.delete_confirm") } class="ml-auto text-muted hover:text-down">{ i18n.T(ctx, "incident.delete") }</button>
|
||||
}
|
||||
</p>
|
||||
<div class="legal-text mt-1 text-sm">
|
||||
@templ.Raw(e.HTML)
|
||||
</div>
|
||||
case "resolved":
|
||||
<p class="text-xs"><span class="text-up">{ i18n.T(ctx, "incident.recovered") }</span> <span class="font-mono text-muted">{ e.At }</span></p>
|
||||
default:
|
||||
<p class="text-xs"><span class="text-down">{ i18n.T(ctx, "incident.began") }</span> <span class="font-mono text-muted">{ e.At }</span></p>
|
||||
if len(v.Row.Cause) > 0 {
|
||||
<p class="mt-1 font-mono text-xs text-muted">{ strings.Join(v.Row.Cause, " · ") }</p>
|
||||
}
|
||||
}
|
||||
</li>
|
||||
}
|
||||
</ol>
|
||||
</section>
|
||||
if v.CanWrite {
|
||||
<aside>
|
||||
@sectionHeading("incident.post_update")
|
||||
<form data-api={ "/org/incidents/" + v.Row.ID + "/updates" } data-next={ "/incidents/" + v.Row.ID }>
|
||||
@formError()
|
||||
<label class="mb-4 block">
|
||||
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "incident.status") }</span>
|
||||
<select name="status" class="w-full border border-rule bg-transparent px-2 py-1.5 text-sm">
|
||||
for _, st := range IncidentStatuses {
|
||||
<option value={ st } selected?={ st == v.NextStatus }>{ i18n.T(ctx, "incident.status."+st) }</option>
|
||||
}
|
||||
</select>
|
||||
</label>
|
||||
<div class="mb-4">
|
||||
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "incident.message") }</span>
|
||||
@MarkdownEditor("message", "", 6, 5000, MarkdownInline)
|
||||
</div>
|
||||
@checkbox(i18n.T(ctx, "incident.public"), "public", true)
|
||||
<p class="-mt-2 mb-4 ml-6 text-xs text-muted">{ i18n.T(ctx, "incident.public_hint") }</p>
|
||||
@submit(i18n.T(ctx, "incident.post"))
|
||||
</form>
|
||||
<div class="mt-10">
|
||||
@sectionHeading("incident.title_heading")
|
||||
<form data-api={ "/org/incidents/" + v.Row.ID } data-method="patch" data-next={ "/incidents/" + v.Row.ID }>
|
||||
@formError()
|
||||
@valueField(i18n.T(ctx, "incident.title_label"), "title", v.Row.Title, i18n.T(ctx, "incident.title_placeholder"), false)
|
||||
<p class="-mt-2 mb-4 text-xs text-muted">{ i18n.T(ctx, "incident.title_hint") }</p>
|
||||
@submit(i18n.T(ctx, "common.save"))
|
||||
</form>
|
||||
</div>
|
||||
</aside>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
+1396
-797
File diff suppressed because it is too large.
Load diff
+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">
|
||||
|
||||
+228
-60
@@ -1363,68 +1363,72 @@ func publicIncidents(incidents []agentapi.PageIncident) templ.Component {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, inc := range incidents {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, "<li class=\"flex flex-wrap items-baseline gap-x-4 gap-y-1 py-2.5\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, "<li class=\"py-3\"><div class=\"flex flex-wrap items-baseline gap-x-4 gap-y-1\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if inc.ResolvedAt == nil {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "<span class=\"font-medium text-down\">")
|
||||
templ_7745c5c3_Err = incidentStatusLabel(inc.Status, inc.ResolvedAt == nil).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if inc.Title != "" {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "<span class=\"font-medium\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var62 string
|
||||
templ_7745c5c3_Var62, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.ongoing"))
|
||||
templ_7745c5c3_Var62, templ_7745c5c3_Err = templ.JoinStringErrs(inc.Title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 298, Col: 77}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 300, Col: 45}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var62))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, "</span> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "<span class=\"text-up\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, "</span> <span class=\"text-xs text-muted\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var63 string
|
||||
templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.resolved"))
|
||||
templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinStringErrs(inc.Component)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 300, Col: 64}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 301, Col: 56}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var63))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "</span> ")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "</span> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "<span>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var64 string
|
||||
templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(inc.Component)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 303, Col: 29}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, "</span> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, "<span>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var64 string
|
||||
templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(inc.Component)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 302, Col: 27}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "</span> <span class=\"ml-auto font-mono text-xs text-muted\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "<span class=\"ml-auto font-mono text-xs text-muted\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var65 string
|
||||
templ_7745c5c3_Var65, templ_7745c5c3_Err = templ.JoinStringErrs(inc.StartedAt.UTC().Format("2006-01-02 15:04"))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 304, Col: 55}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 306, Col: 56}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var65))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -1442,7 +1446,7 @@ func publicIncidents(incidents []agentapi.PageIncident) templ.Component {
|
||||
var templ_7745c5c3_Var66 string
|
||||
templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(inc.ResolvedAt.UTC().Format("15:04"))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 306, Col: 50}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 308, Col: 51}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -1453,17 +1457,66 @@ func publicIncidents(incidents []agentapi.PageIncident) templ.Component {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, "UTC</span></li>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, "UTC</span></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(inc.Updates) > 0 {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, "<ol class=\"ml-1 mt-3 space-y-3 border-l border-rule pl-4\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, u := range inc.Updates {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, "<li><p class=\"text-xs\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = incidentStatusLabel(u.Status, true).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, "<span class=\"font-mono text-muted\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var67 string
|
||||
templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + u.At.UTC().Format("2006-01-02 15:04") + " UTC")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 319, Col: 103}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, "</span></p><div class=\"legal-text mt-1\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.Raw(Markdown(u.Message)).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "</div></li>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, "</ol>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "</li>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, "</ul>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, "</ul>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, "</section>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "</section>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -1471,6 +1524,121 @@ func publicIncidents(incidents []agentapi.PageIncident) templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
// incidentStatusLabel names an incident's status: what the organization
|
||||
// said, or ongoing or resolved when it said nothing.
|
||||
func incidentStatusLabel(status string, open bool) templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||
return templ_7745c5c3_CtxErr
|
||||
}
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
defer func() {
|
||||
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err == nil {
|
||||
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||||
}
|
||||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
switch {
|
||||
case status != "":
|
||||
{
|
||||
templ_7745c5c3_ElementWriter := templ_7745c5c3_Buffer
|
||||
templ_7745c5c3_Buffer := templ.GetBuffer()
|
||||
var templ_7745c5c3_ElementScripts []templ.ComponentScript
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "<span class=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var69 = []any{"font-medium", incidentStatusClass(status)}
|
||||
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var69...)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var70 string
|
||||
templ_7745c5c3_Var70, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var69).String()).Resolve(ctx)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 1, Col: 0}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var70)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_ElementScripts...)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_ElementWriter)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, ">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var71 string
|
||||
templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident.status."+status))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 340, Col: 102}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var71))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "</span>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
case open:
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, "<span class=\"font-medium text-down\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var72 string
|
||||
templ_7745c5c3_Var72, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.ongoing"))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 342, Col: 73}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var72))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, "</span>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
default:
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "<span class=\"text-up\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var73 string
|
||||
templ_7745c5c3_Var73, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.resolved"))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 344, Col: 60}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var73))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "</span>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func pageMaintenance(heading string, items []agentapi.PageMaintenance) templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
@@ -1489,25 +1657,25 @@ func pageMaintenance(heading string, items []agentapi.PageMaintenance) templ.Com
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if len(items) > 0 {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, "<section class=\"mb-12\"><h2 class=\"mb-3 text-xs font-medium uppercase tracking-wider text-muted\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, "<section class=\"mb-12\"><h2 class=\"mb-3 text-xs font-medium uppercase tracking-wider text-muted\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var68 string
|
||||
templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(heading)
|
||||
var templ_7745c5c3_Var75 string
|
||||
templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.JoinStringErrs(heading)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 320, Col: 85}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 351, Col: 85}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var75))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, "</h2><ul class=\"divide-y divide-rule border-y border-rule text-sm\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "</h2><ul class=\"divide-y divide-rule border-y border-rule text-sm\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, m := range items {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "<li class=\"py-3\"><div class=\"flex flex-wrap items-baseline gap-x-4 gap-y-1\"><span class=\"flex items-center gap-2 font-medium\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, "<li class=\"py-3\"><div class=\"flex flex-wrap items-baseline gap-x-4 gap-y-1\"><span class=\"flex items-center gap-2 font-medium\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -1515,51 +1683,51 @@ func pageMaintenance(heading string, items []agentapi.PageMaintenance) templ.Com
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, " ")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, " ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var69 string
|
||||
templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title)
|
||||
var templ_7745c5c3_Var76 string
|
||||
templ_7745c5c3_Var76, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 327, Col: 17}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 358, Col: 17}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var76))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "</span> <span class=\"ml-auto font-mono text-xs text-muted\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, "</span> <span class=\"ml-auto font-mono text-xs text-muted\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var70 string
|
||||
templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinStringErrs(m.Start.UTC().Format("2006-01-02 15:04") + " – " + m.End.UTC().Format("15:04") + " UTC")
|
||||
var templ_7745c5c3_Var77 string
|
||||
templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.JoinStringErrs(m.Start.UTC().Format("2006-01-02 15:04") + " – " + m.End.UTC().Format("15:04") + " UTC")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 330, Col: 99}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 361, Col: 99}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var77))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, "</span></div><p class=\"ml-4 mt-1 text-xs text-muted\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 137, "</span></div><p class=\"ml-4 mt-1 text-xs text-muted\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var71 string
|
||||
templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(m.Components, ", "))
|
||||
var templ_7745c5c3_Var78 string
|
||||
templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(m.Components, ", "))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 333, Col: 80}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 364, Col: 80}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var71))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var78))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "</p>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, "</p>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if m.Description != "" {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "<div class=\"legal-text ml-4 mt-2 text-muted\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "<div class=\"legal-text ml-4 mt-2 text-muted\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -1567,17 +1735,17 @@ func pageMaintenance(heading string, items []agentapi.PageMaintenance) templ.Com
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "</div>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, "</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, "</li>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "</li>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "</ul></section>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "</ul></section>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user