diff --git a/internal/api/statuspage_groups.go b/internal/api/statuspage_groups.go index 694fc29..74d018b 100644 --- a/internal/api/statuspage_groups.go +++ b/internal/api/statuspage_groups.go @@ -256,7 +256,7 @@ func (s *Server) importStatusPageGroups(c *gin.Context) { pageID := uuid.MustParse(c.Param("id")) p := current(c) ctx := c.Request.Context() - var created []store.StatusPageGroup + var created []pageGroupView err := s.db.Tx(ctx, p.scope(), func(q *store.Queries) error { if _, err := q.GetStatusPage(ctx, pageID); err != nil { return err @@ -290,54 +290,66 @@ func (s *Server) importStatusPageGroups(c *gin.Context) { if err := q.ClearStatusPageGroups(ctx, pageID); err != nil { return err } - mapped := map[uuid.UUID]store.StatusPageGroup{} - var createErr error + // Large organizations have thousands of monitors and hundreds of + // groups, so both are written in a few statements: the groups one + // level of nesting at a time, as parents must exist before their + // children, the monitors all at once. + mapped := map[uuid.UUID]pageGroupView{} + var levels []store.CreateStatusPageGroupsParams posByParent := map[uuid.UUID]int32{} - tree.walk(func(g store.MonitorGroup, _ int) { - if createErr != nil || !needed[g.ID] { + tree.walk(func(g store.MonitorGroup, depth int) { + if !needed[g.ID] { return } - var parentKey uuid.UUID var parentID *uuid.UUID if g.ParentID != nil { if parent, ok := mapped[*g.ParentID]; ok { pid := parent.ID parentID = &pid - parentKey = pid } } + var parentKey uuid.UUID + if parentID != nil { + parentKey = *parentID + } pos := posByParent[parentKey] posByParent[parentKey] = pos + 1 - row, err := q.CreateStatusPageGroup(ctx, store.CreateStatusPageGroupParams{ - PageID: pageID, - OrgID: p.Org.ID, - ParentID: parentID, - Name: g.Name, - Position: pos, - }) - if err != nil { - createErr = err - return - } + row := pageGroupView{ID: uuid.New(), Name: g.Name, ParentID: parentID, Position: pos} mapped[g.ID] = row created = append(created, row) + for len(levels) <= depth { + levels = append(levels, store.CreateStatusPageGroupsParams{PageID: pageID, OrgID: p.Org.ID}) + } + l := &levels[depth] + l.Ids = append(l.Ids, row.ID) + l.ParentIds = append(l.ParentIds, parentKey) + l.Names = append(l.Names, row.Name) + l.Positions = append(l.Positions, row.Position) }) - if createErr != nil { - return createErr + for _, l := range levels { + if len(l.Ids) == 0 { + continue + } + if err := q.CreateStatusPageGroups(ctx, l); err != nil { + return err + } } + set := store.SetStatusPageMonitorGroupsParams{PageID: pageID} for _, m := range listed { - var gid *uuid.UUID + var gid uuid.UUID section := "" if m.MonitorGroupID != nil { if g, ok := mapped[*m.MonitorGroupID]; ok { - id := g.ID - gid = &id + gid = g.ID section = g.Name } } - if err := q.SetStatusPageMonitorGroup(ctx, store.SetStatusPageMonitorGroupParams{ - PageID: pageID, MonitorID: m.MonitorID, GroupID: gid, Section: section, - }); err != nil { + set.MonitorIds = append(set.MonitorIds, m.MonitorID) + set.GroupIds = append(set.GroupIds, gid) + set.Sections = append(set.Sections, section) + } + if len(set.MonitorIds) > 0 { + if err := q.SetStatusPageMonitorGroups(ctx, set); err != nil { return err } } @@ -351,11 +363,10 @@ func (s *Server) importStatusPageGroups(c *gin.Context) { internalError(c, err) return } - out := make([]pageGroupView, 0, len(created)) - for _, g := range created { - out = append(out, pageGroupView{ID: g.ID, Name: g.Name, ParentID: g.ParentID, Position: g.Position}) + if created == nil { + created = []pageGroupView{} } - c.JSON(http.StatusOK, gin.H{"groups": out}) + c.JSON(http.StatusOK, gin.H{"groups": created}) } // resolvePageMonitorGroup returns the status page group ID and section label diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json index 42986e4..3fcce6d 100644 --- a/internal/i18n/locales/de.json +++ b/internal/i18n/locales/de.json @@ -1310,6 +1310,7 @@ "pages.monitors_filter": "Monitore filtern", "pages.monitors_all": "Alle hinzufügen", "pages.monitors_none": "Alle entfernen", + "pages.monitors_range": "{from}–{to} von {total}", "pages.no_group": "Ohne Gruppe", "pages.open": "Öffnen", "pages.own_servers": "Die Statusseiten dieser Organisation liefern nur ihre eigenen Statusseiten-Server aus, nicht die der Plattform. Ruf sie über die Adresse deiner Server auf oder verbinde eine eigene Domain, die auf sie zeigt.", diff --git a/internal/i18n/locales/en.json b/internal/i18n/locales/en.json index 35e314a..816113f 100644 --- a/internal/i18n/locales/en.json +++ b/internal/i18n/locales/en.json @@ -1310,6 +1310,7 @@ "pages.monitors_filter": "Filter monitors", "pages.monitors_all": "Add all", "pages.monitors_none": "Remove all", + "pages.monitors_range": "{from}–{to} of {total}", "pages.no_group": "No group", "pages.open": "Open", "pages.own_servers": "Your organization's own status page servers serve its pages; the platform's do not. Open them at the address of your servers or connect a custom domain pointing at them.", diff --git a/internal/store/querier.go b/internal/store/querier.go index 27ca4e5..beec538 100644 --- a/internal/store/querier.go +++ b/internal/store/querier.go @@ -90,6 +90,10 @@ type Querier interface { CreateSSOProvider(ctx context.Context, arg CreateSSOProviderParams) (SsoProvider, error) CreateStatusPage(ctx context.Context, arg CreateStatusPageParams) (StatusPage, error) CreateStatusPageGroup(ctx context.Context, arg CreateStatusPageGroupParams) (StatusPageGroup, error) + // Creates many groups of a page at once, with ids the caller chose. Parents + // must exist before their children are created; a nil parent id (all + // zeros) means none. + CreateStatusPageGroups(ctx context.Context, arg CreateStatusPageGroupsParams) error CreateSupportTicket(ctx context.Context, arg CreateSupportTicketParams) (SupportTicket, error) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) DailyBuckets(ctx context.Context, arg DailyBucketsParams) ([]DailyBucketsRow, error) @@ -395,7 +399,9 @@ type Querier interface { SetPlatformSetting(ctx context.Context, arg SetPlatformSettingParams) error // Changing the domain drops a previous verification and its checks. SetStatusPageDomain(ctx context.Context, arg SetStatusPageDomainParams) (StatusPage, error) - SetStatusPageMonitorGroup(ctx context.Context, arg SetStatusPageMonitorGroupParams) error + // Files many monitors of a page at once; a nil group id (all zeros) files + // a monitor under none. + SetStatusPageMonitorGroups(ctx context.Context, arg SetStatusPageMonitorGroupsParams) error SetSupportTicketStatus(ctx context.Context, arg SetSupportTicketStatusParams) (int64, error) SetUserAdmin(ctx context.Context, arg SetUserAdminParams) (int64, error) SetUserLocale(ctx context.Context, arg SetUserLocaleParams) error diff --git a/internal/store/queries/status_pages.sql b/internal/store/queries/status_pages.sql index 8ca4b17..1184d98 100644 --- a/internal/store/queries/status_pages.sql +++ b/internal/store/queries/status_pages.sql @@ -100,9 +100,23 @@ DELETE FROM status_page_monitors WHERE page_id = $1; INSERT INTO status_page_monitors (page_id, monitor_id, org_id, section, group_id, label, position) VALUES ($1, $2, $3, $4, $5, $6, $7); --- name: SetStatusPageMonitorGroup :exec -UPDATE status_page_monitors SET group_id = $3, section = $4 -WHERE page_id = $1 AND monitor_id = $2; +-- name: SetStatusPageMonitorGroups :exec +-- Files many monitors of a page at once; a nil group id (all zeros) files +-- a monitor under none. +UPDATE status_page_monitors spm +SET group_id = nullif(v.group_id, '00000000-0000-0000-0000-000000000000'::uuid), section = v.section +FROM (SELECT unnest(sqlc.arg(monitor_ids)::uuid[]) AS monitor_id, unnest(sqlc.arg(group_ids)::uuid[]) AS group_id, + unnest(sqlc.arg(sections)::text[]) AS section) AS v +WHERE spm.page_id = sqlc.arg(page_id) AND spm.monitor_id = v.monitor_id; + +-- name: CreateStatusPageGroups :exec +-- Creates many groups of a page at once, with ids the caller chose. Parents +-- must exist before their children are created; a nil parent id (all +-- zeros) means none. +INSERT INTO status_page_groups (id, page_id, org_id, parent_id, name, position) +SELECT v.id, sqlc.arg(page_id), sqlc.arg(org_id), nullif(v.parent_id, '00000000-0000-0000-0000-000000000000'::uuid), v.name, v.position +FROM (SELECT unnest(sqlc.arg(ids)::uuid[]) AS id, unnest(sqlc.arg(parent_ids)::uuid[]) AS parent_id, + unnest(sqlc.arg(names)::text[]) AS name, unnest(sqlc.arg(positions)::int[]) AS position) AS v; -- name: ListStatusPageGroups :many SELECT * FROM status_page_groups diff --git a/internal/store/status_pages.sql.go b/internal/store/status_pages.sql.go index 38d49aa..1cf9d3a 100644 --- a/internal/store/status_pages.sql.go +++ b/internal/store/status_pages.sql.go @@ -150,6 +150,37 @@ func (q *Queries) CreateStatusPageGroup(ctx context.Context, arg CreateStatusPag return i, err } +const createStatusPageGroups = `-- name: CreateStatusPageGroups :exec +INSERT INTO status_page_groups (id, page_id, org_id, parent_id, name, position) +SELECT v.id, $1, $2, nullif(v.parent_id, '00000000-0000-0000-0000-000000000000'::uuid), v.name, v.position +FROM (SELECT unnest($3::uuid[]) AS id, unnest($4::uuid[]) AS parent_id, + unnest($5::text[]) AS name, unnest($6::int[]) AS position) AS v +` + +type CreateStatusPageGroupsParams struct { + PageID uuid.UUID + OrgID uuid.UUID + Ids []uuid.UUID + ParentIds []uuid.UUID + Names []string + Positions []int32 +} + +// Creates many groups of a page at once, with ids the caller chose. Parents +// must exist before their children are created; a nil parent id (all +// zeros) means none. +func (q *Queries) CreateStatusPageGroups(ctx context.Context, arg CreateStatusPageGroupsParams) error { + _, err := q.db.Exec(ctx, createStatusPageGroups, + arg.PageID, + arg.OrgID, + arg.Ids, + arg.ParentIds, + arg.Names, + arg.Positions, + ) + return err +} + const deleteStatusPage = `-- name: DeleteStatusPage :execrows DELETE FROM status_pages WHERE id = $1 ` @@ -563,24 +594,29 @@ func (q *Queries) SetStatusPageDomain(ctx context.Context, arg SetStatusPageDoma return i, err } -const setStatusPageMonitorGroup = `-- name: SetStatusPageMonitorGroup :exec -UPDATE status_page_monitors SET group_id = $3, section = $4 -WHERE page_id = $1 AND monitor_id = $2 +const setStatusPageMonitorGroups = `-- name: SetStatusPageMonitorGroups :exec +UPDATE status_page_monitors spm +SET group_id = nullif(v.group_id, '00000000-0000-0000-0000-000000000000'::uuid), section = v.section +FROM (SELECT unnest($2::uuid[]) AS monitor_id, unnest($3::uuid[]) AS group_id, + unnest($4::text[]) AS section) AS v +WHERE spm.page_id = $1 AND spm.monitor_id = v.monitor_id ` -type SetStatusPageMonitorGroupParams struct { - PageID uuid.UUID - MonitorID uuid.UUID - GroupID *uuid.UUID - Section string +type SetStatusPageMonitorGroupsParams struct { + PageID uuid.UUID + MonitorIds []uuid.UUID + GroupIds []uuid.UUID + Sections []string } -func (q *Queries) SetStatusPageMonitorGroup(ctx context.Context, arg SetStatusPageMonitorGroupParams) error { - _, err := q.db.Exec(ctx, setStatusPageMonitorGroup, +// Files many monitors of a page at once; a nil group id (all zeros) files +// a monitor under none. +func (q *Queries) SetStatusPageMonitorGroups(ctx context.Context, arg SetStatusPageMonitorGroupsParams) error { + _, err := q.db.Exec(ctx, setStatusPageMonitorGroups, arg.PageID, - arg.MonitorID, - arg.GroupID, - arg.Section, + arg.MonitorIds, + arg.GroupIds, + arg.Sections, ) return err } diff --git a/internal/web/assets/app.js b/internal/web/assets/app.js index eafb946..dba3412 100644 --- a/internal/web/assets/app.js +++ b/internal/web/assets/app.js @@ -241,7 +241,7 @@ if (checkAll) { const on = checkAll.dataset.checkAll === "on"; checkAll.closest("form")?.querySelectorAll(checkAll.dataset.checkTarget).forEach((box) => { - if (box.closest("[data-row]")?.hidden) return; + if (box.closest("[data-row]")?.hasAttribute("data-filtered-out")) return; box.checked = on; if (on) addRowFields(box); }); @@ -341,15 +341,72 @@ if (ev.target.matches('[data-row] [data-field="include"]') && ev.target.checked) addRowFields(ev.target); }); - // [data-filter-rows] hides the rows of the list it names whose text does - // not contain what is typed. + // Lists with data-page-size show that many of their rows at a time, of + // those a filter leaves; the [data-row-pager] naming the list turns the + // pages. The other rows stay in the DOM, so forms still send them. + // Selects with data-lazy-options hold their chosen option only; the full + // list comes from the form's row template once the row is shown or used. + const fillOptions = (sel) => { + const tpl = sel.closest("form")?.querySelector("template[data-row-fields]"); + const full = tpl?.content.querySelector(`select[data-field="${sel.dataset.field}"]`); + if (!full) return; + const value = sel.value; + sel.replaceChildren(...[...full.options].map((o) => o.cloneNode(true))); + sel.value = value; + sel.removeAttribute("data-lazy-options"); + }; + document.addEventListener("focusin", (ev) => { + if (ev.target.matches?.("select[data-lazy-options]")) fillOptions(ev.target); + }); + const showRowPage = (list, page) => { + const rows = [...list.querySelectorAll(":scope > [data-row]")]; + const size = Number(list.dataset.pageSize) || rows.length || 1; + const shown = rows.filter((row) => !row.hasAttribute("data-filtered-out")); + const pages = Math.max(1, Math.ceil(shown.length / size)); + page = Math.min(Math.max(0, page), pages - 1); + list.dataset.page = String(page); + for (const row of rows) row.hidden = true; + for (const row of shown.slice(page * size, (page + 1) * size)) { + row.hidden = false; + row.querySelectorAll("select[data-lazy-options]").forEach(fillOptions); + } + for (const nav of document.querySelectorAll(`[data-row-pager="#${list.id}"]`)) { + nav.hidden = pages < 2; + nav.querySelector('[data-row-page="prev"]').disabled = page === 0; + nav.querySelector('[data-row-page="next"]').disabled = page >= pages - 1; + const status = nav.querySelector("[data-row-page-status]"); + if (status) { + const values = { + from: shown.length ? page * size + 1 : 0, + to: Math.min((page + 1) * size, shown.length), + total: shown.length, + }; + status.textContent = status.dataset.template.replace(/\{(\w+)\}/g, (m, k) => values[k] ?? m); + } + } + }; + for (const list of document.querySelectorAll("[data-page-size][id]")) showRowPage(list, 0); + document.addEventListener("click", (ev) => { + const btn = ev.target.closest("[data-row-page]"); + if (!btn) return; + const list = document.querySelector(btn.closest("[data-row-pager]").dataset.rowPager); + showRowPage(list, Number(list.dataset.page || 0) + (btn.dataset.rowPage === "next" ? 1 : -1)); + }); + + // [data-filter-rows] hides the rows of the list it names whose text, or + // that of their [data-filter-text], does not contain what is typed. document.addEventListener("input", (ev) => { const input = ev.target.closest("[data-filter-rows]"); if (!input) return; const needle = input.value.trim().toLowerCase(); - for (const row of document.querySelectorAll(input.dataset.filterRows + " > [data-row]")) { - row.hidden = needle !== "" && !row.textContent.toLowerCase().includes(needle); + const list = document.querySelector(input.dataset.filterRows); + for (const row of list.querySelectorAll(":scope > [data-row]")) { + const text = (row.querySelector("[data-filter-text]") ?? row).textContent; + const out = needle !== "" && !text.toLowerCase().includes(needle); + row.toggleAttribute("data-filtered-out", out); + row.hidden = out; } + if (list.dataset.pageSize) showRowPage(list, 0); }); // Only the settings of the selected check type are shown and submitted. diff --git a/internal/web/statuspages.templ b/internal/web/statuspages.templ index c2b9f6e..43671f1 100644 --- a/internal/web/statuspages.templ +++ b/internal/web/statuspages.templ @@ -320,11 +320,11 @@ templ StatusPageEditor(p Page, me Me, e PageEditor) { @pageMonitorFields(e, PageMonitorOption{}) -
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var90 string - templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_intro")) + var templ_7745c5c3_Var95 string + templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_intro")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 347, Col: 75} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 356, Col: 75} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var90)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 156, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if e.Domain != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "● ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "
● ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } switch e.VerifiedBy { case "cname": - var templ_7745c5c3_Var93 string - templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_verified_by_cname")) + var templ_7745c5c3_Var98 string + templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_verified_by_cname")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 360, Col: 58} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 369, Col: 58} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } case "txt": - var templ_7745c5c3_Var94 string - templ_7745c5c3_Var94, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_verified_by_txt")) + var templ_7745c5c3_Var99 string + templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_verified_by_txt")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 362, Col: 56} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 371, Col: 56} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var94)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var99)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } default: - var templ_7745c5c3_Var95 string - templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verified")) + var templ_7745c5c3_Var100 string + templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verified")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 364, Col: 54} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 373, Col: 54} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if e.MissingSince != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var96 string - templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_missing", "Since", e.MissingSince, "Date", e.SwitchOffAt)) + var templ_7745c5c3_Var101 string + templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_missing", "Since", e.MissingSince, "Date", e.SwitchOffAt)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 368, Col: 146} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 377, Col: 146} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else if e.VerifiedBy != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var97 string - templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_keep")) + var templ_7745c5c3_Var102 string + templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_keep")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 370, Col: 73} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 379, Col: 73} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var97)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var102)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } } else if e.CNAMEValue != "" && !e.OwnServers { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var98 string - templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_cname_step")) + var templ_7745c5c3_Var103 string + templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_cname_step")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 373, Col: 51} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 382, Col: 51} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1967,33 +2038,33 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 176, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var100 string - templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_alt", "Target", e.CNAMEValue)) + var templ_7745c5c3_Var105 string + templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_alt", "Target", e.CNAMEValue)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 378, Col: 95} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 387, Col: 95} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var105)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2005,25 +2076,25 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 179, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var101 string - templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verify")) + var templ_7745c5c3_Var106 string + templ_7745c5c3_Var106, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_verify")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 383, Col: 52} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 392, Col: 52} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var106)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2036,79 +2107,79 @@ func StatusPageEditor(p Page, me Me, e PageEditor) templ.Component { return templ_7745c5c3_Err } if e.OwnServers { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 175, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var102 string - templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_own")) + var templ_7745c5c3_Var107 string + templ_7745c5c3_Var107, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_own")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 387, Col: 56} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 396, Col: 56} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var102)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var107)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 176, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 183, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var103 string - templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_unknown")) + var templ_7745c5c3_Var108 string + templ_7745c5c3_Var108, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_cname_unknown")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 389, Col: 60} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 398, Col: 60} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var108)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 178, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 184, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 179, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 185, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var104 string - templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_apex")) + var templ_7745c5c3_Var109 string + templ_7745c5c3_Var109, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_apex")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 391, Col: 72} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 400, Col: 72} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var109)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 186, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var105 string - templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_tls", "Count", e.DomainChangesPerDay)) + var templ_7745c5c3_Var110 string + templ_7745c5c3_Var110, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.domain_step_tls", "Count", e.DomainChangesPerDay)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 393, Col: 107} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 402, Col: 107} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var105)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var123 string - templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.subscribers_counts", "Confirmed", e.SubscribersConfirmed, "Pending", e.SubscribersPending)) + var templ_7745c5c3_Var132 string + templ_7745c5c3_Var132, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.subscribers_counts", "Confirmed", e.SubscribersConfirmed, "Pending", e.SubscribersPending)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 442, Col: 137} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 468, Col: 137} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var123)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var132)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if e.SubscriberLimit > 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var124 string - templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.subscribers_limit", "Max", e.SubscriberLimit)) + var templ_7745c5c3_Var133 string + templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.subscribers_limit", "Max", e.SubscriberLimit)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 444, Col: 104} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 470, Col: 104} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var124)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var133)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 208, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } if len(e.Subscribers) == 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var125 string - templ_7745c5c3_Var125, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.subscribers_none")) + var templ_7745c5c3_Var134 string + templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.subscribers_none")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 447, Col: 72} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 473, Col: 72} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var125)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var134)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 211, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var132 string - templ_7745c5c3_Var132, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.subscribers_more", "Count", len(e.Subscribers))) + var templ_7745c5c3_Var141 string + templ_7745c5c3_Var141, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.subscribers_more", "Count", len(e.Subscribers))) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 462, Col: 107} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/statuspages.templ`, Line: 488, Col: 107} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var132)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var141)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, "