diff --git a/internal/api/agent.go b/internal/api/agent.go index a65f6a2..e1a3dd3 100644 --- a/internal/api/agent.go +++ b/internal/api/agent.go @@ -32,6 +32,7 @@ const ( func (s *Server) mountAgentAPI(r gin.IRouter) { g := r.Group("/agent/v1", s.agentAuth()) g.GET("/hello", s.agentHello) + g.GET("/pages", requireAgentKind("statuspage"), s.agentPage) checker := g.Group("", requireAgentKind("checker")) checker.POST("/jobs", s.agentJobs) checker.POST("/results", s.agentResults) diff --git a/internal/api/console.go b/internal/api/console.go index 3fd63de..deb2bfd 100644 --- a/internal/api/console.go +++ b/internal/api/console.go @@ -31,6 +31,8 @@ func (s *Server) registerConsole(r gin.IRouter) { r.GET("/monitors/:id/edit", s.orgPage("monitors.edit", authz.MonitorsWrite, s.monitorEditor)) r.GET("/incidents", s.orgPage("incidents.title", authz.IncidentsRead, s.incidentsView)) r.GET("/settings/channels", s.orgPage("channels.title", authz.NotificationsRead, s.channelsView)) + r.GET("/statuspages", s.orgPage("pages.title", "", s.statusPagesView)) + r.GET("/statuspages/:id", s.orgPage("pages.title", "", s.statusPageEditor)) } // dashboard is the landing page. Unlike other console pages it renders for @@ -426,3 +428,85 @@ func (s *Server) channelsView(c *gin.Context, p *principal, page web.Page, me we } return web.ChannelsPage(page, me, v), nil } + +func (s *Server) pageURL(p store.StatusPage) string { + if p.CustomDomain != nil && p.DomainVerifiedAt != nil { + return "https://" + *p.CustomDomain + "/" + } + return strings.TrimSuffix(s.cfg.StatusPageURL, "/") + "/" + p.Slug +} + +func (s *Server) statusPagesView(c *gin.Context, p *principal, page web.Page, me web.Me) (templ.Component, error) { + ctx := c.Request.Context() + var rows []store.StatusPage + err := s.db.Tx(ctx, p.scope(), func(q *store.Queries) error { + var err error + rows, err = q.ListStatusPages(ctx) + return err + }) + if err != nil { + return nil, err + } + v := web.PagesView{CanWrite: p.Grants.Can(authz.StatusPagesWrite)} + for _, r := range rows { + if !p.Grants.Can(authz.StatusPagesRead, pageResource(r.ID)) { + continue + } + v.Pages = append(v.Pages, web.PageRow{ + ID: r.ID.String(), Title: r.Title, Slug: r.Slug, Published: r.Published, + URL: s.pageURL(r), Domain: deref(r.CustomDomain), + }) + } + return web.StatusPagesPage(page, me, v), nil +} + +func (s *Server) statusPageEditor(c *gin.Context, p *principal, page web.Page, me web.Me) (templ.Component, error) { + id, err := uuid.Parse(c.Param("id")) + if err != nil || !p.Grants.Can(authz.StatusPagesWrite, pageResource(id)) { + return notFoundPage(c) + } + ctx := c.Request.Context() + var ( + row store.StatusPage + listed []store.StatusPageMonitorsRow + monitors []store.Monitor + ) + err = s.db.Tx(ctx, p.scope(), func(q *store.Queries) error { + var err error + if row, err = q.GetStatusPage(ctx, id); err != nil { + return err + } + if listed, err = q.StatusPageMonitors(ctx, id); err != nil { + return err + } + monitors, err = q.ListMonitors(ctx) + return err + }) + if errors.Is(err, pgx.ErrNoRows) { + return notFoundPage(c) + } + if err != nil { + return nil, err + } + v := viewStatusPage(row) + e := web.PageEditor{ + ID: row.ID.String(), Title: row.Title, Slug: row.Slug, Description: row.Description, + Published: row.Published, Accent: v.Theme.Accent, LogoURL: v.Theme.LogoURL, CSS: v.Theme.CSS, + URL: s.pageURL(row), Domain: deref(row.CustomDomain), DomainVerified: v.DomainVerified, + } + if v.DomainRecord != nil { + e.RecordName, e.RecordValue = v.DomainRecord.Name, v.DomainRecord.Value + } + // Listed monitors keep their order; the rest follow alphabetically. + seen := map[uuid.UUID]bool{} + for _, l := range listed { + seen[l.MonitorID] = true + e.Monitors = append(e.Monitors, web.PageMonitorOption{ID: l.MonitorID.String(), Name: l.MonitorName, Included: true, Section: l.Section, Label: l.Label}) + } + for _, m := range monitors { + if !seen[m.ID] { + e.Monitors = append(e.Monitors, web.PageMonitorOption{ID: m.ID.String(), Name: m.Name}) + } + } + return web.StatusPageEditor(page, me, e), nil +} diff --git a/internal/api/export_test.go b/internal/api/export_test.go new file mode 100644 index 0000000..479680e --- /dev/null +++ b/internal/api/export_test.go @@ -0,0 +1,4 @@ +package api + +// LookupTXT lets tests replace DNS lookups for domain verification. +var LookupTXT = &lookupTXT diff --git a/internal/api/server.go b/internal/api/server.go index f9141b0..1931d86 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -127,6 +127,16 @@ func (s *Server) Mount(r gin.IRouter) { admin.POST("/agents", s.adminCreateAgent) admin.DELETE("/agents/:id", s.adminDeleteAgent) + org.GET("/statuspages", s.listStatusPages) + org.POST("/statuspages", can(authz.StatusPagesWrite), s.createStatusPage) + page := org.Group("/statuspages/:id") + page.PUT("", canPage(authz.StatusPagesWrite), s.updateStatusPage) + page.DELETE("", canPage(authz.StatusPagesWrite), s.deleteStatusPage) + page.PUT("/monitors", canPage(authz.StatusPagesWrite), s.setPageMonitors) + page.PUT("/domain", canPage(authz.StatusPagesWrite), s.setPageDomain) + page.POST("/domain/verify", canPage(authz.StatusPagesWrite), s.verifyPageDomain) + page.GET("/export", canPage(authz.StatusPagesRead), s.exportStatusPage) + org.GET("/incidents", can(authz.IncidentsRead), s.listIncidents) org.GET("/channels", can(authz.NotificationsRead), s.listChannels) diff --git a/internal/api/statuspages.go b/internal/api/statuspages.go new file mode 100644 index 0000000..d3714fb --- /dev/null +++ b/internal/api/statuspages.go @@ -0,0 +1,560 @@ +package api + +import ( + "context" + "crypto/rand" + "encoding/hex" + "encoding/json" + "errors" + "net" + "net/http" + "net/url" + "regexp" + "slices" + "strings" + "time" + + "github.com/gin-gonic/gin" + "github.com/google/uuid" + "github.com/jackc/pgx/v5" + + "git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi" + "git.zb-server.de/ZB-Server/uptimesebi/internal/authz" + "git.zb-server.de/ZB-Server/uptimesebi/internal/store" + "git.zb-server.de/ZB-Server/uptimesebi/internal/tenant" + "git.zb-server.de/ZB-Server/uptimesebi/internal/web" +) + +const ( + historyDays = 90 + incidentLookback = 14 * 24 * time.Hour + // verifyPrefix is the label under which customers publish the TXT record + // proving control of a custom domain. + verifyPrefix = "_uptimesebi." +) + +var ( + slugRE = regexp.MustCompile(`^[a-z0-9][a-z0-9-]{1,62}$`) + accentRE = regexp.MustCompile(`^#[0-9a-fA-F]{6}$`) + domainRE2 = regexp.MustCompile(`^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$`) +) + +// buildSnapshot computes what the public sees of page. +func (s *Server) buildSnapshot(ctx context.Context, page store.StatusPage) (agentapi.PageSnapshot, error) { + snap := agentapi.PageSnapshot{ + Slug: page.Slug, Title: page.Title, Description: page.Description, + Sections: []agentapi.Section{}, Incidents: []agentapi.PageIncident{}, GeneratedAt: time.Now(), + } + _ = json.Unmarshal(page.Theme, &snap.Theme) + var ( + listed []store.StatusPageMonitorsRow + latest []store.LatestResultsRow + open []store.Incident + daily []store.DailyBucketsForMonitorsRow + incidents []store.Incident + ) + now := time.Now() + err := s.db.Tx(ctx, tenant.Org(page.OrgID, uuid.Nil), func(q *store.Queries) error { + var err error + if listed, err = q.StatusPageMonitors(ctx, page.ID); err != nil { + return err + } + ids := make([]uuid.UUID, len(listed)) + for i, m := range listed { + ids[i] = m.MonitorID + } + if latest, err = q.LatestResults(ctx, page.OrgID); err != nil { + return err + } + if open, err = q.OpenIncidents(ctx); err != nil { + return err + } + if daily, err = q.DailyBucketsForMonitors(ctx, store.DailyBucketsForMonitorsParams{ + OrgID: page.OrgID, Ids: ids, Bucket: now.AddDate(0, 0, -historyDays), + }); err != nil { + return err + } + incidents, err = q.IncidentsForMonitors(ctx, store.IncidentsForMonitorsParams{Ids: ids, Since: ptr(now.Add(-incidentLookback))}) + return err + }) + if err != nil { + return snap, err + } + failing := map[uuid.UUID]int{} + reported := map[uuid.UUID]int{} + for _, l := range latest { + reported[l.MonitorID]++ + if !l.Ok { + failing[l.MonitorID]++ + } + } + down := map[uuid.UUID]bool{} + for _, i := range open { + down[i.MonitorID] = true + } + days := map[uuid.UUID][]web.Bucket{} + for _, d := range daily { + days[d.MonitorID] = append(days[d.MonitorID], web.Bucket{Start: d.Bucket, Total: d.Total, OK: d.OkCount}) + } + names := map[uuid.UUID]string{} + worst := agentapi.PageOperational + allUnknown := true + for _, m := range listed { + name := m.Label + if name == "" { + name = m.MonitorName + } + names[m.MonitorID] = name + comp := agentapi.Component{Name: name, Uptime: web.Uptime(days[m.MonitorID]), Days: dayHistory(days[m.MonitorID], now)} + switch { + case down[m.MonitorID]: + comp.Status = agentapi.PageOutage + case !m.Enabled || reported[m.MonitorID] == 0: + comp.Status = agentapi.PageUnknown + case failing[m.MonitorID] > 0: + comp.Status = agentapi.PageDegraded + default: + comp.Status = agentapi.PageOperational + } + if comp.Status != agentapi.PageUnknown { + allUnknown = false + } + worst = worse(worst, comp.Status) + if n := len(snap.Sections); n == 0 || snap.Sections[n-1].Name != m.Section { + snap.Sections = append(snap.Sections, agentapi.Section{Name: m.Section}) + } + last := &snap.Sections[len(snap.Sections)-1] + last.Components = append(last.Components, comp) + } + snap.Status = worst + if allUnknown { + snap.Status = agentapi.PageUnknown + } + for _, i := range incidents { + snap.Incidents = append(snap.Incidents, agentapi.PageIncident{Component: names[i.MonitorID], StartedAt: i.StartedAt, ResolvedAt: i.ResolvedAt}) + } + return snap, nil +} + +// worse returns the more severe state; unknown components do not make the +// whole page look broken. +func worse(a, b string) string { + rank := map[string]int{agentapi.PageOperational: 0, agentapi.PageUnknown: 0, agentapi.PageDegraded: 1, agentapi.PageOutage: 2} + if rank[b] > rank[a] { + return b + } + return a +} + +func dayHistory(buckets []web.Bucket, now time.Time) []agentapi.Day { + byDay := map[string]web.Bucket{} + for _, b := range buckets { + byDay[b.Start.UTC().Format(time.DateOnly)] = b + } + out := make([]agentapi.Day, historyDays) + start := now.UTC().AddDate(0, 0, -(historyDays - 1)) + for i := range out { + d := start.AddDate(0, 0, i).Format(time.DateOnly) + out[i] = agentapi.Day{Date: d, Uptime: -1} + if b, ok := byDay[d]; ok && b.Total > 0 { + out[i].Uptime = float64(b.OK) / float64(b.Total) + } + } + return out +} + +// agentPage serves a page snapshot to status page servers. Org-owned +// servers only receive their own org's pages. +func (s *Server) agentPage(c *gin.Context) { + ctx := c.Request.Context() + var host, slug *string + if h := strings.ToLower(strings.TrimSpace(c.Query("host"))); h != "" { + host = &h + } else if sl := strings.ToLower(strings.TrimSpace(c.Query("slug"))); sl != "" { + slug = &sl + } else { + fail(c, http.StatusBadRequest, "invalid_input") + return + } + var page store.StatusPage + err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error { + var err error + page, err = q.FindPublishedPage(ctx, store.FindPublishedPageParams{Host: host, Slug: slug}) + return err + }) + a := agentOf(c) + if errors.Is(err, pgx.ErrNoRows) || (err == nil && a.OrgID != nil && *a.OrgID != page.OrgID) { + fail(c, http.StatusNotFound, "not_found") + return + } + if err != nil { + internalError(c, err) + return + } + snap, err := s.buildSnapshot(ctx, page) + if err != nil { + internalError(c, err) + return + } + c.JSON(http.StatusOK, snap) +} + +type statusPageRequest struct { + Slug string `json:"slug" binding:"required,max=63"` + Title string `json:"title" binding:"required,max=200"` + Description string `json:"description" binding:"max=2000"` + Published bool `json:"published"` + Theme agentapi.Theme `json:"theme"` +} + +func (r *statusPageRequest) normalize() string { + r.Slug = strings.ToLower(strings.TrimSpace(r.Slug)) + r.Title = strings.TrimSpace(r.Title) + r.Description = strings.TrimSpace(r.Description) + t := &r.Theme + t.Accent, t.LogoURL = strings.TrimSpace(t.Accent), strings.TrimSpace(t.LogoURL) + switch { + case !slugRE.MatchString(r.Slug): + return "invalid_slug" + case r.Title == "": + return "invalid_input" + case t.Accent != "" && !accentRE.MatchString(t.Accent): + return "invalid_theme" + case len(t.CSS) > 20000 || strings.Contains(t.CSS, " element; "") || strings.Contains(string(html), `rel="stylesheet"`) { + t.Errorf("export = %d %q, want self-contained HTML", resp.StatusCode, resp.Header.Get("Content-Disposition")) + } + }) + + t.Run("console pages", func(t *testing.T) { + for path, want := range map[string]string{"/statuspages": "Acme Status", "/statuspages/" + pageID: `data-field="monitor_id"`} { + st, final, html := owner.page(path) + if st != http.StatusOK || final != path || !strings.Contains(html, want) { + t.Errorf("GET %s = %d at %s, contains %q: %t", path, st, final, want, strings.Contains(html, want)) + } + } + }) + + t.Run("permission scoped to one page", func(t *testing.T) { + st, body := owner.do("POST", "/api/v1/org/statuspages", map[string]any{"slug": uniq("second-"), "title": "Second"}) + if st != http.StatusCreated { + t.Fatalf("create page = %d %v", st, body) + } + second := body["id"].(string) + owner.do("POST", "/api/v1/org/roles", map[string]any{"name": "Page editor", "permissions": []string{"statuspages.write"}}) + editor := e.joinVia(t, owner.invite("pe@"+uniq("pe")+".test", owner.roleID("viewer"))) + st, body = owner.do("POST", "/api/v1/org/members/"+owner.userID(editorEmail(editor))+"/roles", map[string]any{ + "role_id": owner.roleID("Page editor"), "resource_type": "status_page", "resource_id": pageID, + }) + expect(t, "assign scoped role", st, body, http.StatusCreated, "") + st, body = editor.do("PUT", "/api/v1/org/statuspages/"+pageID, map[string]any{"slug": slug, "title": "Acme Status", "published": true}) + expect(t, "edit page in scope", st, body, http.StatusOK, "") + st, body = editor.do("PUT", "/api/v1/org/statuspages/"+second, map[string]any{"slug": "x-second", "title": "x"}) + expect(t, "edit page out of scope", st, body, http.StatusNotFound, "not_found") + }) +} + +func editorEmail(b *browser) string { + _, me := b.do("GET", "/api/v1/me", nil) + return me["email"].(string) +} diff --git a/internal/config/config.go b/internal/config/config.go index 208567f..6dd7c43 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -84,6 +84,9 @@ type API struct { // e.g. smtp://user:pass@host:587?from=alerts@example.com. Empty disables // email channels. SMTPURL string `env:"UPTIME_SMTP_URL"` + // StatusPageURL is where the platform's status page servers are + // reachable; the console links pages as /. + StatusPageURL string `env:"UPTIME_STATUSPAGE_URL" envDefault:"http://localhost:8082"` } // SSOAllowPrivate resolves SSOPrivateNetworks. @@ -141,6 +144,9 @@ type StatusPage struct { Common Agent Listen string `env:"UPTIME_STATUSPAGE_LISTEN" envDefault:":8082"` + // Hosts are the host names that serve pages by slug, e.g. + // status.example.com. Any other host is treated as a custom domain. + Hosts []string `env:"UPTIME_STATUSPAGE_HOSTS" envSeparator:"," envDefault:"localhost"` } // Load parses the environment into a T, applying envDefault tags. diff --git a/internal/i18n/i18n_test.go b/internal/i18n/i18n_test.go index bcf74a9..403782a 100644 --- a/internal/i18n/i18n_test.go +++ b/internal/i18n/i18n_test.go @@ -149,10 +149,12 @@ func TestEveryMailEventHasTexts(t *testing.T) { func TestDynamicFamilies(t *testing.T) { en := catalogKeys(t)["en"] families := map[string][]string{ - "status.": {"up", "degraded", "down", "unknown", "paused"}, - "monitors.type_": {"http", "tcp", "tls", "dns", "icmp"}, - "channels.type_": {"webhook", "email"}, - "agents.kind_": {"checker", "statuspage"}, + "status.": {"up", "degraded", "down", "unknown", "paused"}, + "monitors.type_": {"http", "tcp", "tls", "dns", "icmp"}, + "channels.type_": {"webhook", "email"}, + "agents.kind_": {"checker", "statuspage"}, + "page.status.": {"operational", "degraded", "outage", "unknown"}, + "page.component.": {"operational", "degraded", "outage", "unknown"}, } for prefix, values := range families { for _, v := range values { diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json index c8df993..353fdb0 100644 --- a/internal/i18n/locales/de.json +++ b/internal/i18n/locales/de.json @@ -70,6 +70,8 @@ "error.already_member": "Diese Person ist bereits Mitglied.", "error.channel_test_failed": "Die Testbenachrichtigung konnte nicht zugestellt werden.", "error.channel_type_immutable": "Der Typ eines Kanals kann nicht geändert werden.", + "error.domain_not_verified": "Der TXT-Eintrag wurde noch nicht gefunden. DNS-Änderungen brauchen manchmal etwas Zeit.", + "error.domain_taken": "Diese Domain nutzt bereits eine andere Statuspage.", "error.email_not_configured": "E-Mail ist auf diesem Server nicht verfügbar.", "error.email_taken": "Diese E-Mail-Adresse ist bereits registriert.", "error.forbidden": "Dafür fehlt dir die Berechtigung.", @@ -84,6 +86,7 @@ "error.invalid_input": "Eingaben prüfen.", "error.invalid_interval": "Das Intervall muss mindestens {{.Min}} Sekunden und höchstens einen Tag betragen.", "error.invalid_method": "Nur GET- und HEAD-Anfragen werden unterstützt.", + "error.invalid_monitor": "Einer der Monitore existiert nicht oder ist doppelt aufgeführt.", "error.invalid_permissions": "Mindestens eine Berechtigung auswählen.", "error.invalid_record": "Nicht unterstützter DNS-Record-Typ.", "error.invalid_region": "Unbekannte Region.", @@ -91,6 +94,7 @@ "error.invalid_resolver": "Der Resolver muss als host:port angegeben werden.", "error.invalid_slug": "Kurzname: 2–63 Zeichen, a–z, 0–9 und Bindestrich.", "error.invalid_target": "Das Ziel passt nicht zu diesem Check-Typ.", + "error.invalid_theme": "Die Theme-Einstellungen sind ungültig: Akzent als #rrggbb, Logo als https-URL, CSS ohne \" v.trim()).filter(Boolean)); else set(el.name, el.value); } + // Forms with data-rows="name" send the checked [data-row] elements as an + // array of objects built from their [data-field] inputs. + if (form.dataset.rows) { + out[form.dataset.rows] = [...form.querySelectorAll("[data-row]")] + .filter((row) => row.querySelector('[data-field="include"]')?.checked) + .map((row) => { + const obj = {}; + for (const f of row.querySelectorAll("[data-field]")) { + if (f.dataset.field !== "include") obj[f.dataset.field] = f.value; + } + return obj; + }); + } return out; }; @@ -86,7 +99,9 @@ totpStep.querySelector("input")?.focus(); return; } - location.assign(form.dataset.next || location.href); + let next = form.dataset.next || location.href; + if (form.dataset.nextFrom) next += res.data?.[form.dataset.nextFrom] ?? ""; + location.assign(next); } catch (err) { showError(form, message(err)); } finally { @@ -119,6 +134,7 @@ try { await api.post(post.dataset.post); alert(post.dataset.ok); + if (post.dataset.reload !== undefined) location.reload(); } catch (err) { alert(message(err)); } finally { diff --git a/internal/web/console.templ b/internal/web/console.templ index f054213..615cac5 100644 --- a/internal/web/console.templ +++ b/internal/web/console.templ @@ -46,6 +46,9 @@ templ consoleShell(p Page, me Me) { { me.Orgs[0].Name } } ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -355,7 +374,7 @@ func consoleShell(p Page, me Me) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -367,7 +386,7 @@ func consoleShell(p Page, me Me) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -404,7 +423,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool) templ.Componen } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var18 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var19 := 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 { @@ -416,51 +435,51 @@ func Security(p Page, me Me, identities []Identity, canLink bool) templ.Componen }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var19 string - templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.title")) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 97, Col: 72} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var20 string - templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.heading")) + templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.title")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 99, Col: 114} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 100, Col: 72} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var21 string + templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.heading")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 102, Col: 114} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if me.TOTP { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "

● ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "

● ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var21 string - templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.active")) + var templ_7745c5c3_Var22 string + templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.active")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 101, Col: 98} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 104, Col: 98} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -468,25 +487,25 @@ func Security(p Page, me Me, identities []Identity, canLink bool) templ.Componen 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, 39, "

= 3)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var22...) + var templ_7745c5c3_Var23 = []any{"mb-6 text-sm", templ.KV("text-down", me.RecoveryCodesLeft < 3), templ.KV("text-muted", me.RecoveryCodesLeft >= 3)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var23...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var23 string - templ_7745c5c3_Var23, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var22).String()).Resolve(ctx) + var templ_7745c5c3_Var24 string + templ_7745c5c3_Var24, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var23).String()).Resolve(ctx) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -500,33 +519,33 @@ func Security(p Page, me Me, identities []Identity, canLink bool) templ.Componen } templ.ReleaseBuffer(templ_7745c5c3_Buffer) } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, ">") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var24 string - templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.left", "Count", me.RecoveryCodesLeft)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 103, Col: 75} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var25 string - templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.regenerate")) + templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.left", "Count", me.RecoveryCodesLeft)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 106, Col: 116} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 106, Col: 75} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var26 string + templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.regenerate")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 109, Col: 116} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -550,20 +569,20 @@ func Security(p Page, me Me, identities []Identity, canLink bool) templ.Componen if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var26 string - templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.disable")) + var templ_7745c5c3_Var27 string + templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.disable")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 116, Col: 109} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 119, Col: 109} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -583,51 +602,51 @@ func Security(p Page, me Me, identities []Identity, canLink bool) templ.Componen if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "

● ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var27 string - templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.inactive")) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 125, Col: 105} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var30 string - templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.heading")) + var templ_7745c5c3_Var31 string + templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.heading")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 142, Col: 113} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 145, Col: 113} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if len(identities) == 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var31 string - templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.none")) + var templ_7745c5c3_Var32 string + templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.none")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 144, Col: 73} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 147, Col: 73} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "
    ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "
      ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, id := range identities { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "
    • ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var32 string - templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(id.Provider) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 148, Col: 69} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "
    • ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var33 string - templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(id.Email) + templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(id.Provider) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 148, Col: 131} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 151, Col: 69} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "
    • ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var34 string + templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(id.Email) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 151, Col: 131} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "
    ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } if canLink { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "\" class=\"inline-block 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_Var36 string + templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.link")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 156, Col: 190} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var18), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var19), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -794,33 +813,33 @@ func recoveryOutput() templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -845,46 +864,46 @@ func policyBanner(msgID, actionID, href string) templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var40 string - templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, msgID)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 172, Col: 23} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var41 string - templ_7745c5c3_Var41, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(href)).ResolveURL(ctx) + templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, msgID)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 173, Col: 32} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 175, Col: 23} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var41) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "\" class=\"underline underline-offset-2\">") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "\" class=\"underline underline-offset-2\">") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var43 string + templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, actionID)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 176, Col: 95} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/web/statuspages.templ b/internal/web/statuspages.templ new file mode 100644 index 0000000..4e1ce37 --- /dev/null +++ b/internal/web/statuspages.templ @@ -0,0 +1,182 @@ +package web + +import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" + +// PageRow is a status page in the list. +type PageRow struct { + ID string + Title string + Slug string + Published bool + URL string + Domain string +} + +// PagesView is the data of the status page list. +type PagesView struct { + Pages []PageRow + CanWrite bool +} + +templ StatusPagesPage(p Page, me Me, v PagesView) { + @consoleShell(p, me) { + @settingsHeading("pages.title", "pages.intro") + if len(v.Pages) > 0 { + + } + if v.CanWrite { +
+ @sectionHeading("pages.create") +
+ @formError() + @valueField(i18n.T(ctx, "pages.page_title"), "title", "", "Acme status", true) + @valueField(i18n.T(ctx, "pages.slug"), "slug", "", "acme", true) + @submit(i18n.T(ctx, "pages.create")) +
+
+ } + } +} + +// PageMonitorOption is a monitor in the page editor. +type PageMonitorOption struct { + ID string + Name string + Included bool + Section string + Label string +} + +// PageEditor is the data of the status page editor. +type PageEditor struct { + ID string + Title string + Slug string + Description string + Published bool + Accent string + LogoURL string + CSS string + URL string + Domain string + DomainVerified bool + RecordName string + RecordValue string + Monitors []PageMonitorOption +} + +templ StatusPageEditor(p Page, me Me, e PageEditor) { + @consoleShell(p, me) { +

← { i18n.T(ctx, "pages.title") }

+
+

{ e.Title }

+ + if e.Published { + { i18n.T(ctx, "pages.open") } ↗ + } + { i18n.T(ctx, "pages.export") } + +
+
+
+ @sectionHeading("pages.settings") +
+ @formError() + @valueField(i18n.T(ctx, "pages.page_title"), "title", e.Title, "", true) + @valueField(i18n.T(ctx, "pages.slug"), "slug", e.Slug, "", true) + + @checkbox(i18n.T(ctx, "pages.published"), "published", e.Published) +

{ i18n.T(ctx, "pages.theme") }

+ @valueField(i18n.T(ctx, "pages.accent"), "theme.accent", e.Accent, "#1f6feb", false) + @valueField(i18n.T(ctx, "pages.logo"), "theme.logo_url", e.LogoURL, "https://example.com/logo.svg", false) + + @submit(i18n.T(ctx, "common.save")) +
+ +
+
+
+ @sectionHeading("pages.components") +
+ @formError() + if len(e.Monitors) == 0 { +

{ i18n.T(ctx, "console.monitors.empty") }

+ } +
    + for _, m := range e.Monitors { +
  • + + { m.Name } + + + + + + +
  • + } +
+ @submit(i18n.T(ctx, "common.save")) +
+
+
+ @sectionHeading("pages.domain") +
+ @formError() + @valueField(i18n.T(ctx, "pages.domain_name"), "domain", e.Domain, "status.example.com", false) + @submit(i18n.T(ctx, "common.save")) +
+ if e.Domain != "" { +
+ if e.DomainVerified { +

● { i18n.T(ctx, "pages.domain_verified") }

+

{ i18n.T(ctx, "pages.domain_cname") }

+ } else { +

{ i18n.T(ctx, "pages.domain_instructions") }

+
+
TXT
+
{ e.RecordName }
+
{ i18n.T(ctx, "pages.value") }
+
{ e.RecordValue }
+
+ + } +
+ } +
+
+
+ } +} diff --git a/internal/web/statuspages_templ.go b/internal/web/statuspages_templ.go new file mode 100644 index 0000000..2fcf7f0 --- /dev/null +++ b/internal/web/statuspages_templ.go @@ -0,0 +1,966 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.1118 + +package web + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" + +// PageRow is a status page in the list. +type PageRow struct { + ID string + Title string + Slug string + Published bool + URL string + Domain string +} + +// PagesView is the data of the status page list. +type PagesView struct { + Pages []PageRow + CanWrite bool +} + +func StatusPagesPage(p Page, me Me, v PagesView) 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_Var2 := 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("pages.title", "pages.intro").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(v.Pages) > 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if v.CanWrite { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sectionHeading("pages.create").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = formError().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = valueField(i18n.T(ctx, "pages.page_title"), "title", "", "Acme status", true).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = valueField(i18n.T(ctx, "pages.slug"), "slug", "", "acme", true).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = submit(i18n.T(ctx, "pages.create")).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) + templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +// PageMonitorOption is a monitor in the page editor. +type PageMonitorOption struct { + ID string + Name string + Included bool + Section string + Label string +} + +// PageEditor is the data of the status page editor. +type PageEditor struct { + ID string + Title string + Slug string + Description string + Published bool + Accent string + LogoURL string + CSS string + URL string + Domain string + DomainVerified bool + RecordName string + RecordValue string + Monitors []PageMonitorOption +} + +func StatusPageEditor(p Page, me Me, e PageEditor) 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_Var11 := 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "

← ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var12 string + templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.title")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 90, Col: 115} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(e.Title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 92, Col: 46} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if e.Published { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.open")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 95, Col: 130} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " ↗ ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var17 string + templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.export")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 97, Col: 140} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sectionHeading("pages.settings").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = formError().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = valueField(i18n.T(ctx, "pages.page_title"), "title", e.Title, "", true).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = valueField(i18n.T(ctx, "pages.slug"), "slug", e.Slug, "", true).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkbox(i18n.T(ctx, "pages.published"), "published", e.Published).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var22 string + templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.theme")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 112, Col: 111} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = valueField(i18n.T(ctx, "pages.accent"), "theme.accent", e.Accent, "#1f6feb", false).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = valueField(i18n.T(ctx, "pages.logo"), "theme.logo_url", e.LogoURL, "https://example.com/logo.svg", false).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = submit(i18n.T(ctx, "common.save")).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sectionHeading("pages.components").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = formError().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(e.Monitors) == 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var30 string + templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.empty")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 135, Col: 81} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, m := range e.Monitors { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var32 string + templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(m.Name) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 141, Col: 23} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = submit(i18n.T(ctx, "common.save")).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sectionHeading("pages.domain").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = formError().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = valueField(i18n.T(ctx, "pages.domain_name"), "domain", e.Domain, "status.example.com", false).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = submit(i18n.T(ctx, "common.save")).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if e.Domain != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if e.DomainVerified { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "

● ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var40 string + templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_verified")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 164, Col: 82} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var41 string + templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_cname")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 165, Col: 78} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var42 string + templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_instructions")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 167, Col: 66} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "

TXT
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var43 string + templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(e.RecordName) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 170, Col: 45} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var44 string + templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.value")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 171, Col: 60} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var45 string + templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(e.RecordValue) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 172, Col: 46} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate