}
}
templ PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) {
@publicShell(s, a, s.Title) {
if s.Theme.LogoURL != "" {
}
{ s.Title }
if s.Description != "" {
@templ.Raw(Markdown(s.Description))
}
@publicStaleNotice(a)
{ i18n.T(ctx, "page.status."+s.Status) }
@pageMaintenance(i18n.T(ctx, "page.maintenance_ongoing"), s.Ongoing(a.Now))
if cp := PageComponents(s.Sections, a.Page, a.PageSize, a.Query); len(s.Sections) > 0 {
if cp.Pages > 1 || cp.Query != "" {
@publicComponentSearch(cp, a)
}
for _, sec := range cp.Sections {
@publicSection(sec, s, a)
}
if cp.Matches == 0 {
{ i18n.T(ctx, "page.search_none") }
}
@publicComponentPager(cp, a)
}
@publicIncidents(s.Incidents)
@pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), s.Upcoming(a.Now))
if s.Subscribe && a.ComponentBase != "" {
@publicSubscribe(s, a)
}
}
}
// publicSubscribe offers email subscriptions to the page's incidents.
templ publicSubscribe(s agentapi.PageSnapshot, a PublicAssets) {
{ i18n.T(ctx, "page.subscribe.title") }
{ i18n.T(ctx, "page.subscribe.intro") }
{ i18n.T(ctx, "page.subscribe.privacy") }
}
// PublicNoticePage tells a visitor of the page the outcome of a
// subscription request, or asks to confirm one with form.
templ PublicNoticePage(s agentapi.PageSnapshot, a PublicAssets, title, message string, form *NoticeForm) {
@publicShell(s, a, title+" · "+s.Title) {
}
}
// publicComponentSearch finds components on pages listing too many to scan.
templ publicComponentSearch(cp ComponentPage, a PublicAssets) {
}
// publicComponentPager turns the pages of components.
templ publicComponentPager(cp ComponentPage, a PublicAssets) {
if cp.Pages > 1 {
}
}
// publicSection renders an unnamed root component list or a collapsible nested
// group matching the monitor dashboard hierarchy.
templ publicSection(sec agentapi.Section, s agentapi.PageSnapshot, a PublicAssets) {
if sec.Name == "" {
@publicComponentList(sec.Components, s, a)
} else {
@statusDot(SectionStatus(sec))
{ sec.Name }{ strconv.Itoa(SectionTotal(sec)) }{ i18n.T(ctx, "page.component."+string(secStatusName(sec))) }
@publicComponentList(sec.Components, s, a)
for _, child := range sec.Children {
@publicSection(child, s, a)
}
}
}
func secStatusName(sec agentapi.Section) string {
if sec.Status != "" {
return sec.Status
}
states := make([]string, len(sec.Components))
for i, c := range sec.Components {
states[i] = c.Status
}
return agentapi.Summarize(states)
}
templ publicComponentList(comps []agentapi.Component, s agentapi.PageSnapshot, a PublicAssets) {
if len(comps) > 0 {
}
}
// incidentStatusLabel names an incident's status: what the organization
// 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 st.Key == "custom":
{ st.Name }
case st.Key != "":
{ i18n.T(ctx, "incident.status."+st.Key) }
case open:
{ i18n.T(ctx, "incidents.ongoing") }
default:
{ i18n.T(ctx, "incidents.resolved") }
}
}
templ pageMaintenance(heading string, items []agentapi.PageMaintenance) {
if len(items) > 0 {
}
}
// PublicNotFoundPage answers visitors of a status page that does not exist,
// and of the bare status page domain, with a link to the home page if set.
templ PublicNotFoundPage(cssHref, home string) {
{ i18n.T(ctx, "page.not_found_title") }
@faviconLinks()