}
}
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 v := PublicComponents(s.Sections, a); len(s.Sections) > 0 {
if v.Filterable() {
@publicComponentFilter(v, a)
}
for _, sec := range v.Sections {
@publicSection(sec, v, s, a)
}
if v.Filtered() && v.Matches == 0 {
if v.OnlyProblems && v.Query == "" {
{ i18n.T(ctx, "page.filter_no_problems") }
} else {
{ i18n.T(ctx, "page.search_none") }
}
}
}
@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) {
}
}
// publicComponentFilter searches the components of pages listing too many
// to scan, or narrows them to those with an outage.
templ publicComponentFilter(v ComponentView, a PublicAssets) {
}
// publicSectionPager turns the pages of a section's own components.
templ publicSectionPager(sec PublicSection, v ComponentView) {
if sec.Pages > 1 {
}
}
// publicSection renders an unnamed root component list or a collapsible nested
// group matching the monitor dashboard hierarchy.
templ publicSection(sec PublicSection, v ComponentView, s agentapi.PageSnapshot, a PublicAssets) {
if sec.Name == "" {
@publicComponentList(sec.Components, s, a)
@publicSectionPager(sec, v)
}
}
// 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()