package web import ( "strings" "time" "git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi" "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" ) templ PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) { { s.Title } if a.InlineCSS != "" { @templ.Raw("") } else { } if s.Theme.Accent != "" { @templ.Raw("") } if s.Theme.CSS != "" { @templ.Raw("") }
if s.Theme.LogoURL != "" { { }

{ s.Title }

if s.Description != "" { }
if !a.StaleSince.IsZero() {

{ i18n.T(ctx, "page.stale", "Time", a.StaleSince.UTC().Format("2006-01-02 15:04")+" UTC") }

}

{ i18n.T(ctx, "page.status."+s.Status) }

@pageMaintenance(i18n.T(ctx, "page.maintenance_ongoing"), s.Ongoing(a.Now)) for _, sec := range s.Sections {
if sec.Name != "" {

{ sec.Name }

}
} @pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), s.Upcoming(a.Now))

{ i18n.T(ctx, "page.incidents") }

if len(s.Incidents) == 0 {

{ i18n.T(ctx, "page.no_incidents") }

} else { }
} templ pageMaintenance(heading string, items []agentapi.PageMaintenance) { if len(items) > 0 {

{ heading }

} }