feat(statuspage): show the open incident's status next to its component
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 10m19s
ci / test (pull_request) Successful in 13m1s
ci / build (pull_request) Successful in 16m3s
ci / image (pull_request) Successful in 4m54s

The component list names the status of the component's newest unresolved
incident the organization gave one, built-in or own with its color.

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-24 07:09:50 +01:00
1 parent 45123ff93a
commit 316bdeb223
4 files changed
+190 -146

No files matched your search

+9 -3
View File
@@ -138,10 +138,10 @@ templ publicComponentList(comps []agentapi.Component, s agentapi.PageSnapshot, a
<li class="py-3">
if href := ComponentHref(a.ComponentBase, comp, s.ShowDetails); href != "" {
<a href={ templ.SafeURL(href) } class="block rounded-sm transition hover:bg-rule/30">
@publicComponentBody(comp, true)
@publicComponentBody(comp, s, true)
</a>
} else {
@publicComponentBody(comp, false)
@publicComponentBody(comp, s, false)
if s.ShowDetails && comp.Details != nil {
<details class="mt-2 border-t border-rule pt-2 text-xs">
<summary class="cursor-pointer text-muted hover:text-ink">{ i18n.T(ctx, "page.details_expand") }</summary>
@@ -160,11 +160,17 @@ templ publicComponentList(comps []agentapi.Component, s agentapi.PageSnapshot, a
}
}
templ publicComponentBody(comp agentapi.Component, clickable bool) {
templ publicComponentBody(comp agentapi.Component, s agentapi.PageSnapshot, clickable bool) {
<div class="mb-2 flex items-center gap-2.5">
@statusDot(PageStatus(comp.Status))
<span class={ templ.KV("underline-offset-2 hover:underline", clickable) }>{ comp.Name }</span>
<span class="ml-auto flex items-center gap-2 text-sm text-muted">
if inc, ok := s.OpenIncidentStatus(comp.Name); ok {
<span class="text-xs">
@incidentStatusLabel(IncidentStatusInfo{Key: inc.Status, Name: inc.StatusName, Color: inc.StatusColor}, true)
</span>
<span aria-hidden="true">·</span>
}
<span>{ i18n.T(ctx, "page.component."+comp.Status) }</span>
if clickable {
<span aria-hidden="true" class="text-xs">→</span>
File diff suppressed because it is too large. Load diff