feat: own incident statuses with a color; incidents before maintenance
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 9m38s
ci / test (pull_request) Successful in 14m21s
ci / build (pull_request) Successful in 16m36s
ci / image (pull_request) Successful in 3m37s

Organizations add statuses of their own, with a name and a color, next
to the built-in ones (Settings, incident statuses; API under
/org/incident-statuses, managed with org.manage). Updates pick them by
ID; the console and status pages show them in their color. Renaming or
recoloring carries into the history; a status in use cannot be deleted
(409 status_in_use). API responses give status "custom" with status_id,
status_name and status_color.

Status pages now list recent incidents before planned maintenance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-23 23:49:58 +01:00
1 parent 43a04e99b1
commit 2409a919c3
26 files changed
+1257 -238

No files matched your search

+3
View File
@@ -249,6 +249,9 @@ templ SettingsIndex(p Page, me Me) {
@settingsLink("/settings/channels", "channels.title", "settings.channels")
}
@settingsLink("/groups", "groups.title", "settings.groups")
if me.Can["incidents.read"] {
@settingsLink("/settings/incident-statuses", "incident_statuses.title", "settings.incident_statuses")
}
if me.Can["members.read"] {
@settingsLink("/settings/members", "console.nav.members", "settings.members")
@settingsLink("/settings/roles", "console.nav.roles", "settings.roles")
+6
View File
@@ -1200,6 +1200,12 @@ func SettingsIndex(p Page, me Me) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if me.Can["incidents.read"] {
templ_7745c5c3_Err = settingsLink("/settings/incident-statuses", "incident_statuses.title", "settings.incident_statuses").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if me.Can["members.read"] {
templ_7745c5c3_Err = settingsLink("/settings/members", "console.nav.members", "settings.members").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
+20 -2
View File
@@ -4,6 +4,21 @@ package web
// usual order.
var IncidentStatuses = []string{"investigating", "identified", "monitoring", "resolved"}
// IncidentStatusInfo is an incident's status as shown: a built-in key, or
// "custom" with the organization's name and color.
type IncidentStatusInfo struct {
Key string
Name string
Color string
}
// CustomIncidentStatus is a status an organization added.
type CustomIncidentStatus struct {
ID string
Name string
Color string
}
// incidentStatusClass colors an incident status: red while it is being
// worked on, amber while watched, green once resolved.
func incidentStatusClass(status string) string {
@@ -23,8 +38,9 @@ type IncidentTimelineEntry struct {
// Kind is update, started or resolved.
Kind string
// Update fields.
ID, Status, HTML, Author string
Public bool
ID, HTML, Author string
Status IncidentStatusInfo
Public bool
}
// IncidentDetailView is the page of one incident.
@@ -34,4 +50,6 @@ type IncidentDetailView struct {
Timeline []IncidentTimelineEntry
// NextStatus preselects the status of the next update.
NextStatus string
// Custom are the organization's own statuses to choose from.
Custom []CustomIncidentStatus
}
+57 -1
View File
@@ -288,7 +288,7 @@ type IncidentRow struct {
Cause []string
// Title and Status are what the organization said about it.
Title string
Status string
Status IncidentStatusInfo
}
// MonitorDetailView is the data of a monitor page.
@@ -1432,6 +1432,9 @@ templ IncidentDetailPage(p Page, me Me, v IncidentDetailView) {
for _, st := range IncidentStatuses {
<option value={ st } selected?={ st == v.NextStatus }>{ i18n.T(ctx, "incident.status."+st) }</option>
}
for _, st := range v.Custom {
<option value={ st.ID } selected?={ st.ID == v.NextStatus }>{ st.Name }</option>
}
</select>
</label>
<div class="mb-4">
@@ -1456,3 +1459,56 @@ templ IncidentDetailPage(p Page, me Me, v IncidentDetailView) {
</div>
}
}
// IncidentStatusesPage lists the organization's own incident statuses and,
// for those who manage the organization, edits them.
templ IncidentStatusesPage(p Page, me Me, statuses []CustomIncidentStatus, canManage bool) {
@consoleShell(p, me) {
@settingsHeading("incident_statuses.title", "incident_statuses.intro")
<section class="mb-12 max-w-2xl">
@sectionHeading("incident_statuses.builtin")
<ul class="flex flex-wrap gap-4 text-sm">
for _, st := range IncidentStatuses {
<li>@incidentStatusLabel(IncidentStatusInfo{Key: st}, true)</li>
}
</ul>
</section>
<section class="mb-12 max-w-2xl">
@sectionHeading("incident_statuses.own")
if len(statuses) == 0 {
<p class="text-sm text-muted">{ i18n.T(ctx, "incident_statuses.none") }</p>
}
<ul class="divide-y divide-rule border-y border-rule">
for _, st := range statuses {
<li class="py-3">
if canManage {
<form data-api={ "/org/incident-statuses/" + st.ID } data-method="put" data-next="/settings/incident-statuses" class="flex flex-wrap items-center gap-3">
<input type="color" name="color" value={ st.Color } class="h-8 w-10 cursor-pointer border border-rule bg-transparent" aria-label={ i18n.T(ctx, "incident_statuses.color") }/>
<input type="text" name="name" value={ st.Name } maxlength="40" required class="min-w-0 flex-1 border border-rule bg-transparent px-2.5 py-1.5 text-sm outline-none focus:border-ink"/>
<button type="submit" class="border border-ink px-3 py-1.5 text-sm hover:bg-ink hover:text-paper">{ i18n.T(ctx, "common.save") }</button>
<button type="button" data-delete={ "/org/incident-statuses/" + st.ID } data-confirm={ i18n.T(ctx, "incident_statuses.delete_confirm") } class="text-sm text-muted hover:text-down">{ i18n.T(ctx, "incident.delete") }</button>
<p data-error class="hidden w-full text-xs text-down"></p>
</form>
} else {
@incidentStatusLabel(IncidentStatusInfo{Key: "custom", Name: st.Name, Color: st.Color}, true)
}
</li>
}
</ul>
if canManage {
<form data-api="/org/incident-statuses" data-next="/settings/incident-statuses" class="mt-6 flex flex-wrap items-end gap-3">
<label class="block">
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "incident_statuses.color") }</span>
<input type="color" name="color" value="#7c3aed" class="h-9 w-12 cursor-pointer border border-rule bg-transparent"/>
</label>
<label class="block min-w-0 flex-1">
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "sso.field.name") }</span>
<input type="text" name="name" maxlength="40" required placeholder={ i18n.T(ctx, "incident_statuses.placeholder") } class="w-full border border-rule bg-transparent px-2.5 py-1.5 text-sm outline-none focus:border-ink"/>
</label>
<button type="submit" class="bg-ink px-3 py-2 text-sm text-paper">{ i18n.T(ctx, "incident_statuses.add") }</button>
<p data-error class="hidden w-full text-xs text-down"></p>
</form>
}
</section>
}
}
+370 -35
View File
@@ -1114,7 +1114,7 @@ type IncidentRow struct {
Cause []string
// Title and Status are what the organization said about it.
Title string
Status string
Status IncidentStatusInfo
}
// MonitorDetailView is the data of a monitor page.
@@ -7175,25 +7175,67 @@ func IncidentDetailPage(p Page, me Me, v IncidentDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 596, "</option>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 596, "</option> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 597, "</select></label><div class=\"mb-4\"><span class=\"mb-1 block text-xs font-medium uppercase tracking-wider text-muted\">")
for _, st := range v.Custom {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 597, "<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var336 string
templ_7745c5c3_Var336, templ_7745c5c3_Err = templruntime.NewAttributeExpression(st.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1436, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var336)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 598, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if st.ID == v.NextStatus {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 599, " selected")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 600, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var337 string
templ_7745c5c3_Var337, templ_7745c5c3_Err = templ.JoinStringErrs(st.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1436, Col: 78}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var337))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 601, "</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 602, "</select></label><div class=\"mb-4\"><span class=\"mb-1 block text-xs font-medium uppercase tracking-wider text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var336 string
templ_7745c5c3_Var336, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident.message"))
var templ_7745c5c3_Var338 string
templ_7745c5c3_Var338, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident.message"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1438, Col: 121}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1441, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var336))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var338))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 598, "</span>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 603, "</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -7201,7 +7243,7 @@ func IncidentDetailPage(p Page, me Me, v IncidentDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 599, "</div>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 604, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -7209,20 +7251,20 @@ func IncidentDetailPage(p Page, me Me, v IncidentDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 600, "<p class=\"-mt-2 mb-4 ml-6 text-xs text-muted\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 605, "<p class=\"-mt-2 mb-4 ml-6 text-xs text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var337 string
templ_7745c5c3_Var337, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident.public_hint"))
var templ_7745c5c3_Var339 string
templ_7745c5c3_Var339, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident.public_hint"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1442, Col: 89}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1445, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var337))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var339))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 601, "</p>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 606, "</p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -7230,7 +7272,7 @@ func IncidentDetailPage(p Page, me Me, v IncidentDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 602, "</form><div class=\"mt-10\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 607, "</form><div class=\"mt-10\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -7238,33 +7280,33 @@ func IncidentDetailPage(p Page, me Me, v IncidentDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 603, "<form data-api=\"")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 608, "<form data-api=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var338 string
templ_7745c5c3_Var338, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/incidents/" + v.Row.ID).Resolve(ctx)
var templ_7745c5c3_Var340 string
templ_7745c5c3_Var340, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/incidents/" + v.Row.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1447, Col: 51}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1450, Col: 51}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var338)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var340)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 604, "\" data-method=\"patch\" data-next=\"")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 609, "\" data-method=\"patch\" data-next=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var339 string
templ_7745c5c3_Var339, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/incidents/" + v.Row.ID).Resolve(ctx)
var templ_7745c5c3_Var341 string
templ_7745c5c3_Var341, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/incidents/" + v.Row.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1447, Col: 110}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1450, Col: 110}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var339)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var341)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 605, "\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 610, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -7276,20 +7318,20 @@ func IncidentDetailPage(p Page, me Me, v IncidentDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 606, "<p class=\"-mt-2 mb-4 text-xs text-muted\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 611, "<p class=\"-mt-2 mb-4 text-xs text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var340 string
templ_7745c5c3_Var340, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident.title_hint"))
var templ_7745c5c3_Var342 string
templ_7745c5c3_Var342, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident.title_hint"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1450, Col: 84}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1453, Col: 84}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var340))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var342))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 607, "</p>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 612, "</p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -7297,12 +7339,12 @@ func IncidentDetailPage(p Page, me Me, v IncidentDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 608, "</form></div></aside>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 613, "</form></div></aside>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 609, "</div>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 614, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -7316,4 +7358,297 @@ func IncidentDetailPage(p Page, me Me, v IncidentDetailView) templ.Component {
})
}
// IncidentStatusesPage lists the organization's own incident statuses and,
// for those who manage the organization, edits them.
func IncidentStatusesPage(p Page, me Me, statuses []CustomIncidentStatus, canManage 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)
templ_7745c5c3_Var344 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
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)
templ_7745c5c3_Err = settingsHeading("incident_statuses.title", "incident_statuses.intro").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 615, "<section class=\"mb-12 max-w-2xl\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = sectionHeading("incident_statuses.builtin").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 616, "<ul class=\"flex flex-wrap gap-4 text-sm\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, st := range IncidentStatuses {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 617, "<li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = incidentStatusLabel(IncidentStatusInfo{Key: st}, true).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 618, "</li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 619, "</ul></section><section class=\"mb-12 max-w-2xl\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = sectionHeading("incident_statuses.own").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(statuses) == 0 {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 620, "<p class=\"text-sm text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var345 string
templ_7745c5c3_Var345, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident_statuses.none"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1479, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var345))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 621, "</p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 622, "<ul class=\"divide-y divide-rule border-y border-rule\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, st := range statuses {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 623, "<li class=\"py-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if canManage {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 624, "<form data-api=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var346 string
templ_7745c5c3_Var346, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/incident-statuses/" + st.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1485, Col: 57}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var346)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 625, "\" data-method=\"put\" data-next=\"/settings/incident-statuses\" class=\"flex flex-wrap items-center gap-3\"><input type=\"color\" name=\"color\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var347 string
templ_7745c5c3_Var347, templ_7745c5c3_Err = templruntime.NewAttributeExpression(st.Color).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1486, Col: 57}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var347)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 626, "\" class=\"h-8 w-10 cursor-pointer border border-rule bg-transparent\" aria-label=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var348 string
templ_7745c5c3_Var348, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "incident_statuses.color")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1486, Col: 177}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var348)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 627, "\"> <input type=\"text\" name=\"name\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var349 string
templ_7745c5c3_Var349, templ_7745c5c3_Err = templruntime.NewAttributeExpression(st.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1487, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var349)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 628, "\" maxlength=\"40\" required class=\"min-w-0 flex-1 border border-rule bg-transparent px-2.5 py-1.5 text-sm outline-none focus:border-ink\"> <button type=\"submit\" class=\"border border-ink px-3 py-1.5 text-sm hover:bg-ink hover:text-paper\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var350 string
templ_7745c5c3_Var350, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "common.save"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1488, Col: 134}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var350))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 629, "</button> <button type=\"button\" data-delete=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var351 string
templ_7745c5c3_Var351, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/incident-statuses/" + st.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1489, Col: 77}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var351)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 630, "\" data-confirm=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var352 string
templ_7745c5c3_Var352, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "incident_statuses.delete_confirm")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1489, Col: 142}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var352)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 631, "\" class=\"text-sm text-muted hover:text-down\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var353 string
templ_7745c5c3_Var353, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident.delete"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1489, Col: 220}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var353))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 632, "</button><p data-error class=\"hidden w-full text-xs text-down\"></p></form>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
templ_7745c5c3_Err = incidentStatusLabel(IncidentStatusInfo{Key: "custom", Name: st.Name, Color: st.Color}, true).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 633, "</li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 634, "</ul>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if canManage {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 635, "<form data-api=\"/org/incident-statuses\" data-next=\"/settings/incident-statuses\" class=\"mt-6 flex flex-wrap items-end gap-3\"><label class=\"block\"><span class=\"mb-1 block text-xs font-medium uppercase tracking-wider text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var354 string
templ_7745c5c3_Var354, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident_statuses.color"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1501, Col: 127}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var354))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 636, "</span> <input type=\"color\" name=\"color\" value=\"#7c3aed\" class=\"h-9 w-12 cursor-pointer border border-rule bg-transparent\"></label> <label class=\"block min-w-0 flex-1\"><span class=\"mb-1 block text-xs font-medium uppercase tracking-wider text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var355 string
templ_7745c5c3_Var355, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "sso.field.name"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1505, Col: 118}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var355))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 637, "</span> <input type=\"text\" name=\"name\" maxlength=\"40\" required placeholder=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var356 string
templ_7745c5c3_Var356, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "incident_statuses.placeholder")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1506, Col: 119}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var356)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 638, "\" class=\"w-full border border-rule bg-transparent px-2.5 py-1.5 text-sm outline-none focus:border-ink\"></label> <button type=\"submit\" class=\"bg-ink px-3 py-2 text-sm text-paper\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var357 string
templ_7745c5c3_Var357, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident_statuses.add"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1508, Col: 109}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var357))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 639, "</button><p data-error class=\"hidden w-full text-xs text-down\"></p></form>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 640, "</section>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var344), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
var _ = templruntime.GeneratedTemplate
+14 -8
View File
@@ -92,8 +92,8 @@ templ PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) {
}
</section>
}
@pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), s.Upcoming(a.Now))
@publicIncidents(s.Incidents)
@pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), s.Upcoming(a.Now))
}
}
@@ -244,8 +244,8 @@ templ PublicComponentPage(s agentapi.PageSnapshot, comp agentapi.Component, a Pu
<span>{ i18n.T(ctx, "page.today") }</span>
</div>
</section>
@pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), upcoming)
@publicIncidents(s.IncidentsForComponent(comp.Name))
@pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), upcoming)
}
}
@@ -295,7 +295,7 @@ templ publicIncidents(incidents []agentapi.PageIncident) {
for _, inc := range incidents {
<li class="py-3">
<div class="flex flex-wrap items-baseline gap-x-4 gap-y-1">
@incidentStatusLabel(inc.Status, inc.ResolvedAt == nil)
@incidentStatusLabel(IncidentStatusInfo{Key: inc.Status, Name: inc.StatusName, Color: inc.StatusColor}, inc.ResolvedAt == nil)
if inc.Title != "" {
<span class="font-medium">{ inc.Title }</span>
<span class="text-xs text-muted">{ inc.Component }</span>
@@ -315,7 +315,7 @@ templ publicIncidents(incidents []agentapi.PageIncident) {
for _, u := range inc.Updates {
<li>
<p class="text-xs">
@incidentStatusLabel(u.Status, true)
@incidentStatusLabel(IncidentStatusInfo{Key: u.Status, Name: u.StatusName, Color: u.StatusColor}, 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">
@@ -333,11 +333,17 @@ templ publicIncidents(incidents []agentapi.PageIncident) {
}
// incidentStatusLabel names an incident's status: what the organization
// said, or ongoing or resolved when it said nothing.
templ incidentStatusLabel(status string, open bool) {
// said, in its own color for its own statuses, or ongoing or resolved when
// it said nothing.
templ incidentStatusLabel(st IncidentStatusInfo, open bool) {
switch {
case status != "":
<span class={ "font-medium", incidentStatusClass(status) }>{ i18n.T(ctx, "incident.status."+status) }</span>
case st.Key == "custom":
<span class="inline-flex items-center gap-1.5 font-medium">
<span class="inline-block size-2 rounded-full" style={ "background-color:" + st.Color }></span>
{ st.Name }
</span>
case st.Key != "":
<span class={ "font-medium", incidentStatusClass(st.Key) }>{ i18n.T(ctx, "incident.status."+st.Key) }</span>
case open:
<span class="font-medium text-down">{ i18n.T(ctx, "incidents.ongoing") }</span>
default:
+129 -97
View File
@@ -381,11 +381,11 @@ func PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), s.Upcoming(a.Now)).Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = publicIncidents(s.Incidents).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = publicIncidents(s.Incidents).Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), s.Upcoming(a.Now)).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1134,11 +1134,11 @@ func PublicComponentPage(s agentapi.PageSnapshot, comp agentapi.Component, a Pub
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), upcoming).Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = publicIncidents(s.IncidentsForComponent(comp.Name)).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = publicIncidents(s.IncidentsForComponent(comp.Name)).Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), upcoming).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1367,7 +1367,7 @@ func publicIncidents(incidents []agentapi.PageIncident) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = incidentStatusLabel(inc.Status, inc.ResolvedAt == nil).Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = incidentStatusLabel(IncidentStatusInfo{Key: inc.Status, Name: inc.StatusName, Color: inc.StatusColor}, inc.ResolvedAt == nil).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1471,7 +1471,7 @@ func publicIncidents(incidents []agentapi.PageIncident) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = incidentStatusLabel(u.Status, true).Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = incidentStatusLabel(IncidentStatusInfo{Key: u.Status, Name: u.StatusName, Color: u.StatusColor}, true).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1525,8 +1525,9 @@ 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 {
// said, in its own color for its own statuses, or ongoing or resolved when
// it said nothing.
func incidentStatusLabel(st IncidentStatusInfo, 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 {
@@ -1544,30 +1545,61 @@ func incidentStatusLabel(status string, open bool) templ.Component {
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
switch {
case status != "":
case st.Key == "custom":
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "<span class=\"inline-flex items-center gap-1.5 font-medium\"><span class=\"inline-block size-2 rounded-full\" style=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var69 string
templ_7745c5c3_Var69, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues("background-color:" + st.Color)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 342, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "\"></span> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var70 string
templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinStringErrs(st.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 343, Col: 13}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, "</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
case st.Key != "":
{
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=\"")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "<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...)
var templ_7745c5c3_Var71 = []any{"font-medium", incidentStatusClass(st.Key)}
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var71...)
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)
var templ_7745c5c3_Var72 string
templ_7745c5c3_Var72, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var71).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)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var72)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "\"")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1581,56 +1613,56 @@ func incidentStatusLabel(status string, open bool) templ.Component {
}
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\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, ">")
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"))
templ_7745c5c3_Var73, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incident.status."+st.Key))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 344, Col: 60}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 346, Col: 102}
}
_, 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>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
case open:
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "<span class=\"font-medium text-down\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var74 string
templ_7745c5c3_Var74, 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: 348, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var74))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, "</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
default:
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "<span class=\"text-up\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var75 string
templ_7745c5c3_Var75, 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: 350, Col: 60}
}
_, 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, 134, "</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1657,25 +1689,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, 132, "<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, 135, "<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_Var75 string
templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.JoinStringErrs(heading)
var templ_7745c5c3_Var77 string
templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.JoinStringErrs(heading)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 351, Col: 85}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 357, Col: 85}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var75))
_, 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, 133, "</h2><ul class=\"divide-y divide-rule border-y border-rule text-sm\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, "</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, 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\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 137, "<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
}
@@ -1683,51 +1715,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, 135, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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: 358, Col: 17}
}
_, 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, 136, "</span> <span class=\"ml-auto font-mono text-xs text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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: 361, Col: 99}
}
_, 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, 137, "</span></div><p class=\"ml-4 mt-1 text-xs text-muted\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var78 string
templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(m.Components, ", "))
templ_7745c5c3_Var78, 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: 364, Col: 80}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/public.templ`, Line: 364, Col: 17}
}
_, 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, 138, "</p>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "</span> <span class=\"ml-auto font-mono text-xs text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var79 string
templ_7745c5c3_Var79, 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: 367, Col: 99}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var79))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, "</span></div><p class=\"ml-4 mt-1 text-xs text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var80 string
templ_7745c5c3_Var80, 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: 370, Col: 80}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var80))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "</p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if m.Description != "" {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "<div class=\"legal-text ml-4 mt-2 text-muted\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "<div class=\"legal-text ml-4 mt-2 text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1735,17 +1767,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, 140, "</div>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 143, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "</li>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, "</li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "</ul></section>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 145, "</ul></section>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}