From 43b0a35f208b05737d49ed3de11cc698a51a676a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?=
Date: Sun, 22 Nov 2026 10:38:31 +0100
Subject: [PATCH] feat: maintenance windows and Markdown descriptions
Monitors and groups get one-off or recurring maintenance. While it is in
progress, failures neither open incidents nor alert, so the SLA is not
affected; successes still resolve earlier incidents. The console shows
monitors under maintenance and lists windows on a new page and on
monitor pages. Status pages announce maintenance in progress and planned
for the next two weeks and mark affected components; the occurrences are
part of the snapshot and evaluated when the page is shown, so this also
works from cache during an API outage. Maintenance and status page
descriptions are rendered as Markdown.
Closes #71
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
---
internal/agentapi/pages.go | 97 ++
internal/api/alerting.go | 11 +
internal/api/audit.go | 3 +
internal/api/console.go | 68 +-
internal/api/maintenance.go | 581 ++++++++++
internal/api/maintenance_test.go | 174 +++
internal/api/server.go | 4 +
internal/api/statuspages.go | 87 +-
internal/i18n/i18n_test.go | 21 +-
internal/i18n/locales/de.json | 65 +-
internal/i18n/locales/en.json | 65 +-
internal/statuspage/statuspage.go | 2 +-
internal/statuspage/statuspage_test.go | 35 +
internal/web/assets/app.css | 1 +
internal/web/assets/app.js | 5 +
internal/web/charts.go | 3 +
internal/web/console.templ | 1 +
internal/web/console_templ.go | 455 ++++----
internal/web/maintenance.go | 27 +
internal/web/maintenance.templ | 217 ++++
internal/web/maintenance_templ.go | 1419 ++++++++++++++++++++++++
internal/web/monitors.templ | 19 +-
internal/web/monitors_templ.go | 715 ++++++------
internal/web/public.go | 14 +
internal/web/public.templ | 39 +-
internal/web/public_templ.go | 288 +++--
internal/web/statuspages.templ | 3 +-
internal/web/statuspages_templ.go | 393 +++----
28 files changed, 3918 insertions(+), 894 deletions(-)
create mode 100644 internal/api/maintenance.go
create mode 100644 internal/api/maintenance_test.go
create mode 100644 internal/web/maintenance.go
create mode 100644 internal/web/maintenance.templ
create mode 100644 internal/web/maintenance_templ.go
diff --git a/internal/agentapi/pages.go b/internal/agentapi/pages.go
index e71cb3e..f611bd0 100644
--- a/internal/agentapi/pages.go
+++ b/internal/agentapi/pages.go
@@ -14,6 +14,8 @@ const (
PageDegraded = "degraded"
PageOutage = "outage"
PageUnknown = "unknown"
+ // PageUnderMaintenance marks planned maintenance in progress.
+ PageUnderMaintenance = "maintenance"
)
// Theme customizes a page.
@@ -67,6 +69,101 @@ type PageSnapshot struct {
// They travel with the snapshot so they stay available during an API
// outage, which some jurisdictions require.
Legal []LegalDoc `json:"legal,omitempty"`
+ // Maintenance lists occurrences of planned maintenance from shortly
+ // before generation to two weeks ahead. Whether one is in progress is
+ // decided when the page is shown, see WithMaintenance, so a cached
+ // snapshot stays right while the API is unreachable.
+ Maintenance []PageMaintenance `json:"maintenance,omitempty"`
+}
+
+// PageMaintenance is one occurrence of planned maintenance.
+type PageMaintenance struct {
+ Title string `json:"title"`
+ // Description is Markdown.
+ Description string `json:"description,omitempty"`
+ Start time.Time `json:"start"`
+ End time.Time `json:"end"`
+ // Components are the names of the affected components.
+ Components []string `json:"components"`
+}
+
+// Summarize derives a page state from component states. Unknown components
+// do not make a page look broken, and a single failed component is a partial
+// problem: only when all fail is it an outage.
+func Summarize(states []string) string {
+ rank := map[string]int{PageOperational: 0, PageUnknown: 0, PageDegraded: 1, PageOutage: 2}
+ worst, allUnknown, allDown := PageOperational, true, len(states) > 0
+ for _, s := range states {
+ if rank[s] > rank[worst] {
+ worst = s
+ }
+ allUnknown = allUnknown && s == PageUnknown
+ allDown = allDown && s == PageOutage
+ }
+ switch {
+ case allUnknown:
+ return PageUnknown
+ case worst == PageOutage && !allDown:
+ return PageDegraded
+ }
+ return worst
+}
+
+// WithMaintenance returns s as of now: components under maintenance in
+// progress show as such and the page state leaves them out.
+func (s PageSnapshot) WithMaintenance(now time.Time) PageSnapshot {
+ affected := map[string]bool{}
+ for _, m := range s.Maintenance {
+ if !now.Before(m.Start) && now.Before(m.End) {
+ for _, c := range m.Components {
+ affected[c] = true
+ }
+ }
+ }
+ if len(affected) == 0 {
+ return s
+ }
+ sections := make([]Section, len(s.Sections))
+ var states []string
+ for i, sec := range s.Sections {
+ sections[i] = Section{Name: sec.Name, Components: make([]Component, len(sec.Components))}
+ for j, c := range sec.Components {
+ if affected[c.Name] {
+ c.Status = PageUnderMaintenance
+ } else {
+ states = append(states, c.Status)
+ }
+ sections[i].Components[j] = c
+ }
+ }
+ s.Sections = sections
+ s.Status = Summarize(states)
+ if len(states) == 0 || s.Status == PageOperational {
+ s.Status = PageUnderMaintenance
+ }
+ return s
+}
+
+// Ongoing returns occurrences in progress at now.
+func (s PageSnapshot) Ongoing(now time.Time) []PageMaintenance {
+ var out []PageMaintenance
+ for _, m := range s.Maintenance {
+ if !now.Before(m.Start) && now.Before(m.End) {
+ out = append(out, m)
+ }
+ }
+ return out
+}
+
+// Upcoming returns occurrences that have not started at now.
+func (s PageSnapshot) Upcoming(now time.Time) []PageMaintenance {
+ var out []PageMaintenance
+ for _, m := range s.Maintenance {
+ if now.Before(m.Start) {
+ out = append(out, m)
+ }
+ }
+ return out
}
// LegalDoc is a legal notice ("imprint") or privacy policy ("privacy"):
diff --git a/internal/api/alerting.go b/internal/api/alerting.go
index 49af148..a28bb69 100644
--- a/internal/api/alerting.go
+++ b/internal/api/alerting.go
@@ -29,11 +29,22 @@ const (
// acts on the resulting transitions.
func (s *Server) evaluateResults(ctx context.Context, region string, results []agentapi.Result, monitors map[uuid.UUID]store.MonitorsForResultsRow) {
slices.SortFunc(results, func(a, b agentapi.Result) int { return a.StartedAt.Compare(b.StartedAt) })
+ ids := make([]uuid.UUID, 0, len(monitors))
+ for id := range monitors {
+ ids = append(ids, id)
+ }
+ planned := s.monitorsInMaintenance(ctx, ids)
for _, r := range results {
m, ok := monitors[r.MonitorID]
if !ok {
continue
}
+ // Failures during planned maintenance are expected: they neither
+ // open incidents nor count towards one afterwards. Successes still
+ // go through, so an incident from before can resolve.
+ if _, _, active := inMaintenance(planned[m.ID], r.StartedAt); active && !r.OK {
+ continue
+ }
t, err := s.eval.Observe(ctx, evaluate.Observation{
MonitorID: m.ID, Region: region, OK: r.OK, At: r.StartedAt,
Interval: time.Duration(m.IntervalSeconds) * time.Second, Confirmations: int(m.Confirmations), Regions: m.Regions,
diff --git a/internal/api/audit.go b/internal/api/audit.go
index c59fe9d..18b8e09 100644
--- a/internal/api/audit.go
+++ b/internal/api/audit.go
@@ -45,6 +45,9 @@ var auditActions = map[string]string{
"POST /api/v1/org/monitors": "monitor.create",
"PUT /api/v1/org/monitors/:id": "monitor.update",
"DELETE /api/v1/org/monitors/:id": "monitor.delete",
+ "POST /api/v1/org/maintenance": "maintenance.create",
+ "PUT /api/v1/org/maintenance/:id": "maintenance.update",
+ "DELETE /api/v1/org/maintenance/:id": "maintenance.delete",
"POST /api/v1/org/groups": "group.create",
"PUT /api/v1/org/groups/:id": "group.update",
"DELETE /api/v1/org/groups/:id": "group.delete",
diff --git a/internal/api/console.go b/internal/api/console.go
index 0b48beb..0242305 100644
--- a/internal/api/console.go
+++ b/internal/api/console.go
@@ -18,6 +18,7 @@ import (
"git.zb-server.de/ZB-Server/uptimesebi/internal/auth"
"git.zb-server.de/ZB-Server/uptimesebi/internal/authz"
"git.zb-server.de/ZB-Server/uptimesebi/internal/check"
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/maintenance"
"git.zb-server.de/ZB-Server/uptimesebi/internal/store"
"git.zb-server.de/ZB-Server/uptimesebi/internal/web"
)
@@ -33,6 +34,7 @@ func (s *Server) registerConsole(r gin.IRouter) {
r.GET("/groups", s.orgPage("groups.title", "", s.groupsView))
r.GET("/settings", s.settingsIndex)
r.GET("/incidents", s.orgPage("incidents.title", authz.IncidentsRead, s.incidentsView))
+ r.GET("/maintenance", s.orgPage("maintenance.title", "", s.maintenancePage))
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))
@@ -78,9 +80,10 @@ func (s *Server) dashboard(c *gin.Context) {
}
type monitorData struct {
- tree groupTree
- rows []web.MonitorRow
- byID map[uuid.UUID]store.Monitor
+ tree groupTree
+ maint map[uuid.UUID][]store.MaintenanceWindow
+ rows []web.MonitorRow
+ byID map[uuid.UUID]store.Monitor
// buckets cover the selected range at its resolution.
buckets map[uuid.UUID][]web.Bucket
down map[uuid.UUID][]web.Span
@@ -211,6 +214,13 @@ func (s *Server) loadMonitorData(ctx context.Context, p *principal, rng web.Time
if d.first, d.firstRegion, err = loadFirstData(ctx, q, p.Org.ID, now); err != nil {
return err
}
+ ids := make([]uuid.UUID, len(monitors))
+ for i, m := range monitors {
+ ids[i] = m.ID
+ }
+ if d.maint, err = maintenanceFor(ctx, q, ids); err != nil {
+ return err
+ }
d.buckets, err = rangeBuckets(ctx, q, p.Org.ID, nil, rng, now)
return err
})
@@ -276,6 +286,8 @@ func (s *Server) loadMonitorData(ctx context.Context, p *principal, rng web.Time
switch {
case !m.Enabled:
row.Status = web.StatusPaused
+ case inMaintenanceNow(d.maint[m.ID], now):
+ row.Status = web.StatusMaintenance
case down[m.ID]:
row.Status = web.StatusDown
case reported == 0:
@@ -297,8 +309,7 @@ func (s *Server) loadMonitorData(ctx context.Context, p *principal, rng web.Time
d.rows = append(d.rows, row)
}
// Problems first, then by name.
- rank := map[web.Status]int{web.StatusDown: 0, web.StatusDegraded: 1, web.StatusUnknown: 2, web.StatusUp: 3, web.StatusPaused: 4}
- slices.SortStableFunc(d.rows, func(a, b web.MonitorRow) int { return rank[a.Status] - rank[b.Status] })
+ slices.SortStableFunc(d.rows, func(a, b web.MonitorRow) int { return statusRank[a.Status] - statusRank[b.Status] })
return d, nil
}
@@ -325,12 +336,13 @@ func (s *Server) monitorDetail(c *gin.Context, p *principal, page web.Page, me w
return notFoundPage(c)
}
v := web.MonitorDetailView{
- Interval: (time.Duration(m.IntervalSeconds) * time.Second).String(),
- CanWrite: canInGroup(p, authz.MonitorsWrite, d.tree, m.GroupID),
- Latency: web.Latency(d.buckets[id], d.now.Add(-d.rng.Window).Truncate(d.rng.Bucket), d.now, 480, 96),
- Range: d.rng.Key,
- Ranges: rangeOptions(c, d.rng, d.first[id], d.now),
- Uptime90: "–",
+ Interval: (time.Duration(m.IntervalSeconds) * time.Second).String(),
+ CanWrite: canInGroup(p, authz.MonitorsWrite, d.tree, m.GroupID),
+ Latency: web.Latency(d.buckets[id], d.now.Add(-d.rng.Window).Truncate(d.rng.Bucket), d.now, 480, 96),
+ Maintenance: maintenanceItems(d.maint[id], d.now),
+ Range: d.rng.Key,
+ Ranges: rangeOptions(c, d.rng, d.first[id], d.now),
+ Uptime90: "–",
}
for _, r := range d.rows {
if r.ID == id.String() {
@@ -662,7 +674,8 @@ func (s *Server) statusPageEditor(c *gin.Context, p *principal, page web.Page, m
}
// rank orders statuses from worst to best for aggregation.
-var statusRank = map[web.Status]int{web.StatusDown: 0, web.StatusDegraded: 1, web.StatusUnknown: 2, web.StatusUp: 3, web.StatusPaused: 4}
+// statusRank orders problems first.
+var statusRank = map[web.Status]int{web.StatusDown: 0, web.StatusDegraded: 1, web.StatusUnknown: 2, web.StatusMaintenance: 3, web.StatusUp: 4, web.StatusPaused: 5}
// buildGroupNodes arranges monitor rows into the group tree. Groups show the
// worst status below them; empty groups are kept so the structure is
@@ -816,3 +829,34 @@ func (s *Server) regionHistory(ctx context.Context, p *principal, d monitorData,
}
return out, nil
}
+
+func inMaintenanceNow(ws []store.MaintenanceWindow, now time.Time) bool {
+ _, _, ok := inMaintenance(ws, now)
+ return ok
+}
+
+// maintenanceItems lists the occurrences of ws from now to the horizon,
+// soonest first, with descriptions rendered from Markdown.
+func maintenanceItems(ws []store.MaintenanceWindow, now time.Time) []web.MaintenanceItem {
+ type occ struct {
+ w store.MaintenanceWindow
+ s maintenance.Span
+ }
+ var all []occ
+ for _, w := range ws {
+ for _, s := range ruleOf(w).Occurrences(now, now.Add(upcomingHorizon)) {
+ all = append(all, occ{w, s})
+ }
+ }
+ slices.SortFunc(all, func(a, b occ) int { return a.s.Start.Compare(b.s.Start) })
+ out := make([]web.MaintenanceItem, 0, len(all))
+ for _, o := range all[:min(len(all), 10)] {
+ html, _ := web.RenderMarkdown(o.w.Description)
+ loc := loadLocation(o.w.TimeZone)
+ out = append(out, web.MaintenanceItem{
+ Title: o.w.Title, Description: html, Active: !now.Before(o.s.Start),
+ When: o.s.Start.In(loc).Format("2006-01-02 15:04") + " – " + o.s.End.In(loc).Format("15:04") + " " + o.w.TimeZone,
+ })
+ }
+ return out
+}
diff --git a/internal/api/maintenance.go b/internal/api/maintenance.go
new file mode 100644
index 0000000..e5a8b9f
--- /dev/null
+++ b/internal/api/maintenance.go
@@ -0,0 +1,581 @@
+package api
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "net/http"
+ "slices"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/a-h/templ"
+ "github.com/gin-gonic/gin"
+ "github.com/google/uuid"
+ "github.com/jackc/pgx/v5"
+
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/authz"
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n"
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/maintenance"
+ "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"
+)
+
+// upcomingHorizon is how far ahead status pages and the console list
+// maintenance.
+const upcomingHorizon = 14 * 24 * time.Hour
+
+func loadLocation(name string) *time.Location {
+ if loc, err := time.LoadLocation(name); err == nil {
+ return loc
+ }
+ return time.UTC
+}
+
+func weekdaysOf(ws []int16) []time.Weekday {
+ out := make([]time.Weekday, len(ws))
+ for i, w := range ws {
+ out[i] = time.Weekday(w)
+ }
+ return out
+}
+
+func ruleOf(w store.MaintenanceWindow) maintenance.Rule {
+ return maintenance.Rule{
+ Start: w.StartsAt, Duration: time.Duration(w.DurationSeconds) * time.Second, Location: loadLocation(w.TimeZone),
+ Recurrence: maintenance.Recurrence(w.Recurrence), Every: int(w.Every), Weekdays: weekdaysOf(w.Weekdays), Until: w.Until,
+ }
+}
+
+func windowOf(r store.MaintenanceForMonitorsRow) store.MaintenanceWindow {
+ return store.MaintenanceWindow{
+ ID: r.ID, Title: r.Title, Description: r.Description, StartsAt: r.StartsAt, DurationSeconds: r.DurationSeconds,
+ TimeZone: r.TimeZone, Recurrence: r.Recurrence, Every: r.Every, Weekdays: r.Weekdays, Until: r.Until,
+ }
+}
+
+// maintenanceFor loads the windows covering monitors, by monitor.
+func maintenanceFor(ctx context.Context, q *store.Queries, ids []uuid.UUID) (map[uuid.UUID][]store.MaintenanceWindow, error) {
+ rows, err := q.MaintenanceForMonitors(ctx, ids)
+ out := map[uuid.UUID][]store.MaintenanceWindow{}
+ for _, r := range rows {
+ if r.MonitorID != nil {
+ out[*r.MonitorID] = append(out[*r.MonitorID], windowOf(r))
+ }
+ }
+ return out, err
+}
+
+// inMaintenance returns the window of ws in progress at t.
+func inMaintenance(ws []store.MaintenanceWindow, t time.Time) (store.MaintenanceWindow, maintenance.Span, bool) {
+ for _, w := range ws {
+ if s, ok := ruleOf(w).ActiveAt(t); ok {
+ return w, s, true
+ }
+ }
+ return store.MaintenanceWindow{}, maintenance.Span{}, false
+}
+
+// flexInts accepts numbers or numeric strings, as HTML forms send them.
+type flexInts []int
+
+// UnmarshalJSON implements json.Unmarshaler.
+func (f *flexInts) UnmarshalJSON(b []byte) error {
+ var raw []json.RawMessage
+ if err := json.Unmarshal(b, &raw); err != nil {
+ return err
+ }
+ *f = make(flexInts, 0, len(raw))
+ for _, r := range raw {
+ s := strings.Trim(string(r), `"`)
+ n, err := strconv.Atoi(s)
+ if err != nil {
+ return err
+ }
+ *f = append(*f, n)
+ }
+ return nil
+}
+
+type maintenanceRequest struct {
+ Title string `json:"title" binding:"required,max=200"`
+ Description string `json:"description" binding:"max=20000"`
+ // Start is the local wall-clock time of the first occurrence,
+ // "2006-01-02T15:04", in TimeZone.
+ Start string `json:"start" binding:"required"`
+ TimeZone string `json:"time_zone" binding:"required,max=64"`
+ DurationMinutes int `json:"duration_minutes" binding:"required"`
+ Recurrence string `json:"recurrence"`
+ Every int `json:"every"`
+ Weekdays flexInts `json:"weekdays"`
+ // Until is the last day occurrences may start on, "2006-01-02".
+ Until string `json:"until"`
+ MonitorIDs []uuid.UUID `json:"monitor_ids"`
+ GroupIDs []uuid.UUID `json:"group_ids"`
+}
+
+// params validates req into the stored form.
+func (req maintenanceRequest) params() (store.CreateMaintenanceParams, string) {
+ loc, err := time.LoadLocation(req.TimeZone)
+ if err != nil || req.TimeZone == "" || req.TimeZone == "Local" {
+ return store.CreateMaintenanceParams{}, "invalid_time_zone"
+ }
+ start, err := time.ParseInLocation("2006-01-02T15:04", req.Start, loc)
+ if err != nil {
+ return store.CreateMaintenanceParams{}, "invalid_maintenance_time"
+ }
+ p := store.CreateMaintenanceParams{
+ Title: strings.TrimSpace(req.Title), Description: strings.TrimSpace(req.Description), StartsAt: start,
+ DurationSeconds: int32(req.DurationMinutes * 60), TimeZone: req.TimeZone,
+ Recurrence: req.Recurrence, Every: int32(max(req.Every, 1)), Weekdays: []int16{},
+ }
+ if p.Recurrence == "" {
+ p.Recurrence = string(maintenance.Once)
+ }
+ if p.Title == "" {
+ return p, "invalid_input"
+ }
+ if p.Recurrence == string(maintenance.Weekly) {
+ for _, w := range req.Weekdays {
+ if w < 0 || w > 6 {
+ return p, "invalid_maintenance_time"
+ }
+ p.Weekdays = append(p.Weekdays, int16(w))
+ }
+ }
+ if req.Until != "" && p.Recurrence != string(maintenance.Once) {
+ day, err := time.ParseInLocation("2006-01-02", req.Until, loc)
+ if err != nil {
+ return p, "invalid_maintenance_time"
+ }
+ end := day.AddDate(0, 0, 1).Add(-time.Second)
+ p.Until = &end
+ }
+ if err := ruleOf(store.MaintenanceWindow{
+ StartsAt: p.StartsAt, DurationSeconds: p.DurationSeconds, TimeZone: p.TimeZone, Recurrence: p.Recurrence,
+ Every: p.Every, Weekdays: p.Weekdays, Until: p.Until,
+ }).Validate(); err != nil {
+ switch {
+ case errors.Is(err, maintenance.ErrOverlap):
+ return p, "maintenance_overlaps"
+ case errors.Is(err, maintenance.ErrDuration):
+ return p, "invalid_maintenance_duration"
+ }
+ return p, "invalid_maintenance_time"
+ }
+ if len(req.MonitorIDs)+len(req.GroupIDs) == 0 {
+ return p, "maintenance_without_targets"
+ }
+ return p, ""
+}
+
+type maintenanceSpan struct {
+ Start time.Time `json:"start"`
+ End time.Time `json:"end"`
+}
+
+type maintenanceView struct {
+ ID uuid.UUID `json:"id"`
+ Title string `json:"title"`
+ Description string `json:"description"`
+ Start string `json:"start"`
+ StartsAt time.Time `json:"starts_at"`
+ TimeZone string `json:"time_zone"`
+ DurationMinutes int `json:"duration_minutes"`
+ Recurrence string `json:"recurrence"`
+ Every int32 `json:"every"`
+ Weekdays []int16 `json:"weekdays"`
+ Until string `json:"until,omitempty"`
+ MonitorIDs []uuid.UUID `json:"monitor_ids"`
+ GroupIDs []uuid.UUID `json:"group_ids"`
+ Active bool `json:"active"`
+ Next *maintenanceSpan `json:"next"`
+}
+
+func viewMaintenance(w store.MaintenanceWindow, targets []store.MaintenanceTarget, now time.Time) maintenanceView {
+ loc := loadLocation(w.TimeZone)
+ v := maintenanceView{
+ ID: w.ID, Title: w.Title, Description: w.Description, Start: w.StartsAt.In(loc).Format("2006-01-02T15:04"),
+ StartsAt: w.StartsAt, TimeZone: w.TimeZone, DurationMinutes: int(w.DurationSeconds / 60), Recurrence: w.Recurrence,
+ Every: w.Every, Weekdays: w.Weekdays, MonitorIDs: []uuid.UUID{}, GroupIDs: []uuid.UUID{},
+ }
+ if w.Until != nil {
+ v.Until = w.Until.In(loc).Format("2006-01-02")
+ }
+ for _, t := range targets {
+ if t.WindowID != w.ID {
+ continue
+ }
+ if t.MonitorID != nil {
+ v.MonitorIDs = append(v.MonitorIDs, *t.MonitorID)
+ } else if t.GroupID != nil {
+ v.GroupIDs = append(v.GroupIDs, *t.GroupID)
+ }
+ }
+ if s, ok := ruleOf(w).Next(now, 400*24*time.Hour); ok {
+ v.Next = &maintenanceSpan{Start: s.Start, End: s.End}
+ v.Active = !now.Before(s.Start)
+ }
+ return v
+}
+
+// maintenanceScope holds what permission checks on windows need.
+type maintenanceScope struct {
+ tree groupTree
+ monitors map[uuid.UUID]store.Monitor
+}
+
+func (s *Server) loadMaintenanceScope(ctx context.Context, p *principal) (maintenanceScope, error) {
+ ms := maintenanceScope{monitors: map[uuid.UUID]store.Monitor{}}
+ var err error
+ if ms.tree, err = s.loadGroupTree(ctx, p.scope()); err != nil {
+ return ms, err
+ }
+ err = s.db.Tx(ctx, p.scope(), func(q *store.Queries) error {
+ rows, err := q.ListMonitors(ctx)
+ for _, m := range rows {
+ ms.monitors[m.ID] = m
+ }
+ return err
+ })
+ return ms, err
+}
+
+// can reports whether p holds perm on every target, or with any=true on at
+// least one. Unknown targets fail.
+func (ms maintenanceScope) can(p *principal, perm authz.Permission, monitors, groups []uuid.UUID, any bool) bool {
+ n := 0
+ check := func(ok bool) {
+ if ok {
+ n++
+ }
+ }
+ for _, id := range monitors {
+ m, ok := ms.monitors[id]
+ check(ok && canInGroup(p, perm, ms.tree, m.GroupID))
+ }
+ for _, id := range groups {
+ _, ok := ms.tree.byID[id]
+ check(ok && canInGroup(p, perm, ms.tree, &id))
+ }
+ if any {
+ return n > 0
+ }
+ return n == len(monitors)+len(groups)
+}
+
+func (s *Server) listMaintenanceViews(ctx context.Context, p *principal, ms maintenanceScope) ([]maintenanceView, error) {
+ var (
+ windows []store.MaintenanceWindow
+ targets []store.MaintenanceTarget
+ )
+ err := s.db.Tx(ctx, p.scope(), func(q *store.Queries) error {
+ var err error
+ if windows, err = q.ListMaintenance(ctx); err != nil {
+ return err
+ }
+ targets, err = q.ListMaintenanceTargets(ctx)
+ return err
+ })
+ out := []maintenanceView{}
+ now := time.Now()
+ for _, w := range windows {
+ v := viewMaintenance(w, targets, now)
+ if ms.can(p, authz.MonitorsRead, v.MonitorIDs, v.GroupIDs, true) {
+ out = append(out, v)
+ }
+ }
+ return out, err
+}
+
+func (s *Server) listMaintenance(c *gin.Context) {
+ p := current(c)
+ ctx := c.Request.Context()
+ ms, err := s.loadMaintenanceScope(ctx, p)
+ if err != nil {
+ internalError(c, err)
+ return
+ }
+ out, err := s.listMaintenanceViews(ctx, p, ms)
+ if err != nil {
+ internalError(c, err)
+ return
+ }
+ c.JSON(http.StatusOK, gin.H{"maintenance": out})
+}
+
+func (s *Server) saveMaintenance(c *gin.Context, id *uuid.UUID) {
+ var req maintenanceRequest
+ if !bind(c, &req) {
+ return
+ }
+ params, code := req.params()
+ if code != "" {
+ fail(c, http.StatusUnprocessableEntity, code)
+ return
+ }
+ p := current(c)
+ ctx := c.Request.Context()
+ ms, err := s.loadMaintenanceScope(ctx, p)
+ if err != nil {
+ internalError(c, err)
+ return
+ }
+ if !ms.can(p, authz.MonitorsWrite, req.MonitorIDs, req.GroupIDs, false) {
+ fail(c, http.StatusForbidden, "forbidden")
+ return
+ }
+ params.OrgID = p.Org.ID
+ var (
+ w store.MaintenanceWindow
+ targets []store.MaintenanceTarget
+ )
+ err = s.db.Tx(ctx, p.scope(), func(q *store.Queries) error {
+ var err error
+ if id == nil {
+ w, err = q.CreateMaintenance(ctx, params)
+ } else {
+ old, err := q.GetMaintenance(ctx, *id)
+ if err != nil {
+ return err
+ }
+ prev, err := q.ListMaintenanceTargets(ctx)
+ if err != nil {
+ return err
+ }
+ // Changing a window needs write access to what it covered too.
+ v := viewMaintenance(old, prev, time.Now())
+ if !ms.can(p, authz.MonitorsWrite, v.MonitorIDs, v.GroupIDs, false) {
+ return errForbidden
+ }
+ w, err = q.UpdateMaintenance(ctx, store.UpdateMaintenanceParams{
+ ID: *id, Title: params.Title, Description: params.Description, StartsAt: params.StartsAt,
+ DurationSeconds: params.DurationSeconds, TimeZone: params.TimeZone, Recurrence: params.Recurrence,
+ Every: params.Every, Weekdays: params.Weekdays, Until: params.Until,
+ })
+ if err != nil {
+ return err
+ }
+ if err := q.ClearMaintenanceTargets(ctx, w.ID); err != nil {
+ return err
+ }
+ }
+ if err != nil {
+ return err
+ }
+ for _, m := range dedupe(req.MonitorIDs) {
+ if err := q.AddMaintenanceTarget(ctx, store.AddMaintenanceTargetParams{WindowID: w.ID, OrgID: p.Org.ID, MonitorID: &m}); err != nil {
+ return err
+ }
+ targets = append(targets, store.MaintenanceTarget{WindowID: w.ID, MonitorID: &m})
+ }
+ for _, g := range dedupe(req.GroupIDs) {
+ if err := q.AddMaintenanceTarget(ctx, store.AddMaintenanceTargetParams{WindowID: w.ID, OrgID: p.Org.ID, GroupID: &g}); err != nil {
+ return err
+ }
+ targets = append(targets, store.MaintenanceTarget{WindowID: w.ID, GroupID: &g})
+ }
+ return nil
+ })
+ switch {
+ case errors.Is(err, pgx.ErrNoRows):
+ fail(c, http.StatusNotFound, "not_found")
+ return
+ case errors.Is(err, errForbidden):
+ fail(c, http.StatusForbidden, "forbidden")
+ return
+ case err != nil:
+ internalError(c, err)
+ return
+ }
+ status := http.StatusOK
+ if id == nil {
+ status = http.StatusCreated
+ }
+ c.JSON(status, viewMaintenance(w, targets, time.Now()))
+}
+
+var errForbidden = errors.New("api: forbidden")
+
+func dedupe(ids []uuid.UUID) []uuid.UUID {
+ seen := map[uuid.UUID]bool{}
+ var out []uuid.UUID
+ for _, id := range ids {
+ if !seen[id] {
+ seen[id] = true
+ out = append(out, id)
+ }
+ }
+ return out
+}
+
+func (s *Server) createMaintenance(c *gin.Context) { s.saveMaintenance(c, nil) }
+
+func (s *Server) updateMaintenance(c *gin.Context) {
+ id, err := uuid.Parse(c.Param("id"))
+ if err != nil {
+ fail(c, http.StatusNotFound, "not_found")
+ return
+ }
+ s.saveMaintenance(c, &id)
+}
+
+func (s *Server) deleteMaintenance(c *gin.Context) {
+ id, err := uuid.Parse(c.Param("id"))
+ if err != nil {
+ fail(c, http.StatusNotFound, "not_found")
+ return
+ }
+ p := current(c)
+ ctx := c.Request.Context()
+ ms, err := s.loadMaintenanceScope(ctx, p)
+ if err != nil {
+ internalError(c, err)
+ return
+ }
+ err = s.db.Tx(ctx, p.scope(), func(q *store.Queries) error {
+ w, err := q.GetMaintenance(ctx, id)
+ if err != nil {
+ return err
+ }
+ targets, err := q.ListMaintenanceTargets(ctx)
+ if err != nil {
+ return err
+ }
+ v := viewMaintenance(w, targets, time.Now())
+ if !ms.can(p, authz.MonitorsWrite, v.MonitorIDs, v.GroupIDs, false) {
+ return errForbidden
+ }
+ auditDetail(c, "name", w.Title)
+ _, err = q.DeleteMaintenance(ctx, id)
+ return err
+ })
+ switch {
+ case errors.Is(err, pgx.ErrNoRows):
+ fail(c, http.StatusNotFound, "not_found")
+ case errors.Is(err, errForbidden):
+ fail(c, http.StatusForbidden, "forbidden")
+ case err != nil:
+ internalError(c, err)
+ default:
+ c.Status(http.StatusNoContent)
+ }
+}
+
+// monitorsInMaintenance loads, in system scope, which of ids are covered by
+// which windows; used while evaluating results.
+func (s *Server) monitorsInMaintenance(ctx context.Context, ids []uuid.UUID) map[uuid.UUID][]store.MaintenanceWindow {
+ var out map[uuid.UUID][]store.MaintenanceWindow
+ err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
+ var err error
+ out, err = maintenanceFor(ctx, q, ids)
+ return err
+ })
+ if err != nil {
+ // Without the windows, failures alert as usual: better a page
+ // during maintenance than silence during an outage.
+ s.log.ErrorContext(ctx, "loading maintenance windows failed", "error", err)
+ }
+ return out
+}
+
+// scheduleText describes when a window repeats, e.g. "Every 2 weeks on
+// Tue, Thu until 2026-12-31".
+func scheduleText(ctx context.Context, v maintenanceView) string {
+ var s string
+ switch v.Recurrence {
+ case string(maintenance.Daily):
+ s = i18n.T(ctx, "maintenance.schedule_daily", "Count", int(v.Every))
+ case string(maintenance.Weekly):
+ days := v.Weekdays
+ if len(days) == 0 {
+ days = []int16{int16(v.StartsAt.In(loadLocation(v.TimeZone)).Weekday())}
+ }
+ names := make([]string, 0, len(days))
+ for _, d := range []int16{1, 2, 3, 4, 5, 6, 0} {
+ if slices.Contains(days, d) {
+ names = append(names, i18n.T(ctx, "weekday."+strconv.Itoa(int(d))))
+ }
+ }
+ s = i18n.T(ctx, "maintenance.schedule_weekly", "Count", int(v.Every), "Days", strings.Join(names, ", "))
+ case string(maintenance.Monthly):
+ s = i18n.T(ctx, "maintenance.schedule_monthly", "Count", int(v.Every), "Day", v.StartsAt.In(loadLocation(v.TimeZone)).Day())
+ default:
+ s = i18n.T(ctx, "maintenance.schedule_once")
+ }
+ start := strings.Replace(v.Start, "T", " ", 1)
+ s += " · " + i18n.T(ctx, "maintenance.schedule_from", "Time", start, "Minutes", v.DurationMinutes, "Zone", v.TimeZone)
+ if v.Until != "" {
+ s += " · " + i18n.T(ctx, "maintenance.schedule_until", "Date", v.Until)
+ }
+ return s
+}
+
+func (s *Server) maintenancePage(c *gin.Context, p *principal, page web.Page, me web.Me) (templ.Component, error) {
+ ctx := c.Request.Context()
+ ms, err := s.loadMaintenanceScope(ctx, p)
+ if err != nil {
+ return nil, err
+ }
+ windows, err := s.listMaintenanceViews(ctx, p, ms)
+ if err != nil {
+ return nil, err
+ }
+ v := web.MaintenanceView{Form: web.MaintenanceForm{Duration: 60, Recurrence: "none", Every: 1}}
+ ms.tree.walk(func(g store.MonitorGroup, depth int) {
+ if canInGroup(p, authz.MonitorsWrite, ms.tree, &g.ID) {
+ v.Groups = append(v.Groups, web.TargetOption{ID: g.ID.String(), Name: g.Name, Depth: depth})
+ }
+ })
+ names := map[uuid.UUID]string{}
+ for _, m := range ms.monitors {
+ names[m.ID] = m.Name
+ if canInGroup(p, authz.MonitorsWrite, ms.tree, m.GroupID) {
+ v.Monitors = append(v.Monitors, web.TargetOption{ID: m.ID.String(), Name: m.Name})
+ }
+ }
+ slices.SortFunc(v.Monitors, func(a, b web.TargetOption) int { return strings.Compare(a.Name, b.Name) })
+ v.CanWrite = len(v.Monitors)+len(v.Groups) > 0
+ for id, g := range ms.tree.byID {
+ names[id] = g.Name
+ }
+ for _, w := range windows {
+ row := web.MaintenanceRow{
+ ID: w.ID.String(), Title: w.Title, Schedule: scheduleText(ctx, w), Active: w.Active,
+ CanWrite: ms.can(p, authz.MonitorsWrite, w.MonitorIDs, w.GroupIDs, false),
+ }
+ row.Description, _ = web.RenderMarkdown(w.Description)
+ var targets []string
+ for _, id := range w.GroupIDs {
+ targets = append(targets, i18n.T(ctx, "maintenance.group_target", "Name", names[id]))
+ }
+ for _, id := range w.MonitorIDs {
+ targets = append(targets, names[id])
+ }
+ row.Targets = strings.Join(targets, ", ")
+ if w.Next != nil && !w.Active {
+ row.Next = w.Next.Start.In(loadLocation(w.TimeZone)).Format("2006-01-02 15:04")
+ }
+ v.Windows = append(v.Windows, row)
+ if w.ID.String() == c.Query("edit") && row.CanWrite {
+ f := web.MaintenanceForm{
+ ID: row.ID, Title: w.Title, Description: w.Description, Start: w.Start, TimeZone: w.TimeZone,
+ Duration: w.DurationMinutes, Recurrence: w.Recurrence, Every: int(w.Every), Until: w.Until,
+ Weekdays: map[int]bool{}, Monitors: map[string]bool{}, Groups: map[string]bool{},
+ }
+ for _, d := range w.Weekdays {
+ f.Weekdays[int(d)] = true
+ }
+ for _, id := range w.MonitorIDs {
+ f.Monitors[id.String()] = true
+ }
+ for _, id := range w.GroupIDs {
+ f.Groups[id.String()] = true
+ }
+ v.Form = f
+ }
+ }
+ return web.MaintenancePage(page, me, v), nil
+}
diff --git a/internal/api/maintenance_test.go b/internal/api/maintenance_test.go
new file mode 100644
index 0000000..fd52f64
--- /dev/null
+++ b/internal/api/maintenance_test.go
@@ -0,0 +1,174 @@
+package api_test
+
+import (
+ "context"
+ "net/http"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/google/uuid"
+
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi"
+)
+
+func TestMaintenance(t *testing.T) {
+ e := newEnv(t)
+ token, region := e.platformChecker(t, uniq("eu-"))
+ client := agentapi.NewClient(e.srv.URL, token, uuid.New(), "test").WithHTTPClient(e.srv.Client())
+ owner := e.browser(t)
+ owner.signup("o@"+uniq("mt")+".test", uniq("mt-"))
+
+ infra := owner.group("Infra", "")
+ db := owner.group("Databases", infra)
+ other := owner.group("Other", "")
+ st, body := owner.do("POST", "/api/v1/org/monitors", map[string]any{
+ "name": "Postgres", "type": "tcp", "target": "db.example.com:5432", "interval_seconds": 3600,
+ "confirmations": 1, "regions": []string{region}, "group_id": db,
+ })
+ if st != http.StatusCreated {
+ t.Fatalf("create monitor = %d %v", st, body)
+ }
+ monitor := uuid.MustParse(body["id"].(string))
+
+ now := time.Now().UTC()
+ window := map[string]any{
+ "title": "DB upgrade", "description": "Upgrade to **Postgres 18**.",
+ "start": now.Add(-10 * time.Minute).Format("2006-01-02T15:04"), "time_zone": "UTC", "duration_minutes": 60,
+ "group_ids": []string{infra},
+ }
+ for name, tc := range map[string]struct {
+ change map[string]any
+ code string
+ }{
+ "time zone": {map[string]any{"time_zone": "Mars/Olympus"}, "invalid_time_zone"},
+ "no targets": {map[string]any{"group_ids": []string{}}, "maintenance_without_targets"},
+ "overlapping": {map[string]any{"recurrence": "daily", "duration_minutes": 25 * 60}, "maintenance_overlaps"},
+ } {
+ req := map[string]any{}
+ for k, v := range window {
+ req[k] = v
+ }
+ for k, v := range tc.change {
+ req[k] = v
+ }
+ st, body := owner.do("POST", "/api/v1/org/maintenance", req)
+ expect(t, name, st, body, http.StatusUnprocessableEntity, tc.code)
+ }
+ st, body = owner.do("POST", "/api/v1/org/maintenance", window)
+ if st != http.StatusCreated || body["active"] != true {
+ t.Fatalf("create maintenance = %d %v", st, body)
+ }
+ windowID := body["id"].(string)
+
+ // A failure during maintenance of a parent group opens no incident.
+ report := func(ok bool) {
+ t.Helper()
+ if err := client.Report(context.Background(), []agentapi.Result{{MonitorID: monitor, ScheduledAt: time.Now(), StartedAt: time.Now(), OK: ok}}); err != nil {
+ t.Fatal(err)
+ }
+ }
+ report(false)
+ report(false)
+ if _, inc := owner.do("GET", "/api/v1/org/incidents", nil); len(inc["incidents"].([]any)) != 0 {
+ t.Fatalf("incident opened during maintenance: %v", inc)
+ }
+ _, _, dash := owner.page("/")
+ if !strings.Contains(dash, `title="maintenance"`) && !strings.Contains(dash, `title="Wartung"`) {
+ t.Error("dashboard does not show the monitor under maintenance")
+ }
+ if _, _, page := owner.page("/maintenance"); !strings.Contains(page, "Postgres 18 ") {
+ t.Error("maintenance page does not render the Markdown description")
+ }
+
+ // Status pages show the component under maintenance.
+ slug := uniq("mtp-")
+ _, sp := owner.do("POST", "/api/v1/org/statuspages", map[string]any{"slug": slug, "title": "Acme", "description": "See [docs](https://docs.example)"})
+ pageID := sp["id"].(string)
+ _, m2 := owner.do("POST", "/api/v1/org/monitors", map[string]any{
+ "name": "Replica", "type": "tcp", "target": "db2.example.com:5432", "interval_seconds": 3600, "regions": []string{region}, "group_id": db,
+ })
+ owner.do("PUT", "/api/v1/org/statuspages/"+pageID+"/monitors", map[string]any{"monitors": []map[string]any{
+ {"monitor_id": monitor.String(), "section": "", "label": "Database"},
+ {"monitor_id": m2["id"].(string), "section": "", "label": "Replica"},
+ }})
+ owner.do("PUT", "/api/v1/org/statuspages/"+pageID, map[string]any{"slug": slug, "title": "Acme", "description": "See [docs](https://docs.example)", "published": true})
+ snap, err := e.statuspageClient(t, nil).Page(context.Background(), "", slug)
+ if err != nil {
+ t.Fatal(err)
+ }
+ // One occurrence covering two components is listed once.
+ if len(snap.Maintenance) != 1 || strings.Join(snap.Maintenance[0].Components, ",") != "Database,Replica" {
+ t.Fatalf("snapshot maintenance = %+v", snap.Maintenance)
+ }
+ if got := snap.WithMaintenance(time.Now()); got.Status != agentapi.PageUnderMaintenance || got.Sections[0].Components[0].Status != agentapi.PageUnderMaintenance {
+ t.Errorf("WithMaintenance() = %s / %+v", got.Status, got.Sections)
+ }
+ if got := snap.WithMaintenance(time.Now().Add(2 * time.Hour)); got.Status == agentapi.PageUnderMaintenance {
+ t.Error("page still under maintenance after it ended")
+ }
+
+ // Members limited to another group may not plan maintenance here.
+ scopedEmail := "s@" + uniq("mt") + ".test"
+ scoped := e.joinVia(t, owner.invite(scopedEmail, owner.roleID("viewer")))
+ st, body = owner.do("POST", "/api/v1/org/members/"+owner.userID(scopedEmail)+"/roles", map[string]any{
+ "role_id": owner.roleID("editor"), "resource_type": "monitor_group", "resource_id": other,
+ })
+ expect(t, "assign scoped editor", st, body, http.StatusCreated, "")
+ st, body = scoped.do("POST", "/api/v1/org/maintenance", window)
+ expect(t, "scoped editor targets foreign group", st, body, http.StatusForbidden, "forbidden")
+ st, body = scoped.do("DELETE", "/api/v1/org/maintenance/"+windowID, nil)
+ expect(t, "scoped editor deletes foreign maintenance", st, body, http.StatusForbidden, "forbidden")
+ w2 := map[string]any{}
+ for k, v := range window {
+ w2[k] = v
+ }
+ w2["group_ids"] = []string{other}
+ w2["recurrence"], w2["weekdays"] = "weekly", []string{"1", "4"}
+ st, body = scoped.do("POST", "/api/v1/org/maintenance", w2)
+ if st != http.StatusCreated || body["next"] == nil {
+ t.Errorf("scoped editor plans weekly maintenance for own group = %d %v", st, body)
+ }
+
+ // Without maintenance the failure alerts again.
+ st, body = owner.do("DELETE", "/api/v1/org/maintenance/"+windowID, nil)
+ expect(t, "delete maintenance", st, body, http.StatusNoContent, "")
+ report(false)
+ if _, inc := owner.do("GET", "/api/v1/org/incidents", nil); len(inc["incidents"].([]any)) != 1 {
+ t.Errorf("no incident after the maintenance ended: %v", inc)
+ }
+}
+
+func TestEditMaintenanceReplacesTargets(t *testing.T) {
+ e := newEnv(t)
+ _, region := e.platformChecker(t, uniq("eu-"))
+ owner := e.browser(t)
+ owner.signup("o@"+uniq("me")+".test", uniq("me-"))
+ a, b := owner.group("A", ""), owner.group("B", "")
+ _, m := owner.do("POST", "/api/v1/org/monitors", map[string]any{
+ "name": "M", "type": "tcp", "target": "example.com:443", "interval_seconds": 3600, "regions": []string{region},
+ })
+ req := map[string]any{
+ "title": "Patch", "start": "2030-01-01T02:00", "time_zone": "Europe/Berlin", "duration_minutes": 30,
+ "recurrence": "monthly", "until": "2030-12-31", "group_ids": []string{a},
+ }
+ _, body := owner.do("POST", "/api/v1/org/maintenance", req)
+ id := body["id"].(string)
+ req["group_ids"], req["monitor_ids"], req["title"] = []string{b}, []string{m["id"].(string)}, "Patch v2"
+ st, body := owner.do("PUT", "/api/v1/org/maintenance/"+id, req)
+ if st != http.StatusOK || body["title"] != "Patch v2" {
+ t.Fatalf("update = %d %v", st, body)
+ }
+ _, list := owner.do("GET", "/api/v1/org/maintenance", nil)
+ got := list["maintenance"].([]any)[0].(map[string]any)
+ if mustJSON(got["group_ids"]) != `["`+b+`"]` || len(got["monitor_ids"].([]any)) != 1 || got["until"] != "2030-12-31" {
+ t.Errorf("after update = %v", got)
+ }
+ next, _ := time.Parse(time.RFC3339, got["next"].(map[string]any)["start"].(string))
+ if want := time.Date(2030, 1, 1, 1, 0, 0, 0, time.UTC); !next.Equal(want) {
+ t.Errorf("next start = %v, want 02:00 Berlin = %v", next, want)
+ }
+ if _, _, page := owner.page("/maintenance?edit=" + id); !strings.Contains(page, `value="Patch v2"`) {
+ t.Error("edit form is not prefilled")
+ }
+}
diff --git a/internal/api/server.go b/internal/api/server.go
index 2890511..598af42 100644
--- a/internal/api/server.go
+++ b/internal/api/server.go
@@ -123,6 +123,10 @@ func (s *Server) Mount(r gin.IRouter) {
org.POST("/monitors", s.createMonitor)
org.PUT("/monitors/:id", s.updateMonitor)
org.DELETE("/monitors/:id", s.deleteMonitor)
+ org.GET("/maintenance", s.listMaintenance)
+ org.POST("/maintenance", s.createMaintenance)
+ org.PUT("/maintenance/:id", s.updateMaintenance)
+ org.DELETE("/maintenance/:id", s.deleteMaintenance)
org.GET("/groups", s.listGroups)
org.POST("/groups", s.createGroup)
org.PUT("/groups/:id", s.updateGroup)
diff --git a/internal/api/statuspages.go b/internal/api/statuspages.go
index 1ad1f8c..5fc607e 100644
--- a/internal/api/statuspages.go
+++ b/internal/api/statuspages.go
@@ -52,6 +52,7 @@ func (s *Server) buildSnapshot(ctx context.Context, page store.StatusPage) (agen
open []store.Incident
daily []store.DailyBucketsForMonitorsRow
incidents []store.Incident
+ planned map[uuid.UUID][]store.MaintenanceWindow
)
now := time.Now()
err := s.db.Tx(ctx, tenant.Org(page.OrgID, uuid.Nil), func(q *store.Queries) error {
@@ -77,6 +78,9 @@ func (s *Server) buildSnapshot(ctx context.Context, page store.StatusPage) (agen
if incidents, err = q.IncidentsForMonitors(ctx, store.IncidentsForMonitorsParams{Ids: ids, Since: ptr(now.Add(-incidentLookback))}); err != nil {
return err
}
+ if planned, err = maintenanceFor(ctx, q, ids); err != nil {
+ return err
+ }
docs, err := q.LegalDocuments(ctx, &page.OrgID)
snap.Legal = mergeLegal(docs)
return err
@@ -101,8 +105,7 @@ func (s *Server) buildSnapshot(ctx context.Context, page store.StatusPage) (agen
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, allDown := true, len(listed) > 0
+ var states []string
for _, m := range listed {
name := m.Label
if name == "" {
@@ -120,44 +123,21 @@ func (s *Server) buildSnapshot(ctx context.Context, page store.StatusPage) (agen
default:
comp.Status = agentapi.PageOperational
}
- if comp.Status != agentapi.PageUnknown {
- allUnknown = false
- }
- if comp.Status != agentapi.PageOutage {
- allDown = false
- }
- worst = worse(worst, comp.Status)
+ states = append(states, 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)
}
- // A single failed component is a partial problem; only a complete
- // failure is reported as an outage of the whole page.
- snap.Status = worst
- switch {
- case allUnknown:
- snap.Status = agentapi.PageUnknown
- case worst == agentapi.PageOutage && !allDown:
- snap.Status = agentapi.PageDegraded
- }
+ snap.Status = agentapi.Summarize(states)
+ snap.Maintenance = pageMaintenance(planned, names, now)
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 {
@@ -214,7 +194,7 @@ func (s *Server) agentPage(c *gin.Context) {
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"`
+ Description string `json:"description" binding:"max=10000"`
Published bool `json:"published"`
Theme agentapi.Theme `json:"theme"`
}
@@ -568,5 +548,52 @@ func (s *Server) exportStatusPage(c *gin.Context) {
return
}
c.Header("Content-Disposition", `attachment; filename="`+row.Slug+`.html"`)
- web.Render(c, http.StatusOK, web.PublicStatusPage(snap, web.PublicAssets{InlineCSS: css}))
+ web.Render(c, http.StatusOK, web.PublicStatusPage(snap.WithMaintenance(time.Now()), web.PublicAssets{InlineCSS: css, Now: time.Now()}))
+}
+
+// pageMaintenance lists the occurrences affecting the page's components
+// from an hour ago, so a snapshot cached just before still knows about
+// maintenance in progress, to two weeks ahead.
+func pageMaintenance(planned map[uuid.UUID][]store.MaintenanceWindow, names map[uuid.UUID]string, now time.Time) []agentapi.PageMaintenance {
+ // Occurrences are matched by instant: time.Time values of the same
+ // instant differ as map keys when their locations were loaded apart.
+ type key struct {
+ window uuid.UUID
+ start int64
+ }
+ byKey := map[key]*agentapi.PageMaintenance{}
+ var order []key
+ for monitor, ws := range planned {
+ name, listed := names[monitor]
+ if !listed {
+ continue
+ }
+ for _, w := range ws {
+ for _, occ := range ruleOf(w).Occurrences(now.Add(-time.Hour), now.Add(upcomingHorizon)) {
+ k := key{w.ID, occ.Start.UnixNano()}
+ m, ok := byKey[k]
+ if !ok {
+ m = &agentapi.PageMaintenance{Title: w.Title, Description: w.Description, Start: occ.Start, End: occ.End}
+ byKey[k] = m
+ order = append(order, k)
+ }
+ if !slices.Contains(m.Components, name) {
+ m.Components = append(m.Components, name)
+ }
+ }
+ }
+ }
+ out := make([]agentapi.PageMaintenance, 0, len(order))
+ for _, k := range order {
+ m := *byKey[k]
+ slices.Sort(m.Components)
+ out = append(out, m)
+ }
+ slices.SortFunc(out, func(a, b agentapi.PageMaintenance) int {
+ if c := a.Start.Compare(b.Start); c != 0 {
+ return c
+ }
+ return strings.Compare(a.Title, b.Title)
+ })
+ return out
}
diff --git a/internal/i18n/i18n_test.go b/internal/i18n/i18n_test.go
index 195a288..4061794 100644
--- a/internal/i18n/i18n_test.go
+++ b/internal/i18n/i18n_test.go
@@ -70,6 +70,7 @@ var usagePatterns = []struct {
{re: regexp.MustCompile(`code = "([a-z_]+)"`), prefix: "error."},
{re: regexp.MustCompile(`\binvalid\("([a-z_]+)"\)`), prefix: "error."},
{re: regexp.MustCompile(`NoticeID = "([a-z0-9_.]+)"`)},
+ {re: regexp.MustCompile(`@labeled\("([a-z0-9_.]+)"\)`)},
{re: regexp.MustCompile(`@(?:settingsHeading|sectionHeading)\("([a-z0-9_.]+)"`)},
{re: regexp.MustCompile(`@settingsHeading\("[a-z0-9_.]+", "([a-z0-9_.]+)"`)},
{re: regexp.MustCompile(`@policyBanner\("([a-z0-9_.]+)", "([a-z0-9_.]+)"`)},
@@ -149,15 +150,17 @@ 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"},
- "page.status.": {"operational", "degraded", "outage", "unknown"},
- "page.component.": {"operational", "degraded", "outage", "unknown"},
- "storage.level_": {"raw", "1h", "1d"},
- "legal.": {"imprint", "privacy"},
- "storage.job_": {"compression", "retention", "refresh_continuous_aggregate", "job_stat_history_retention"},
+ "status.": {"up", "degraded", "down", "unknown", "paused", "maintenance"},
+ "monitors.type_": {"http", "tcp", "tls", "dns", "icmp"},
+ "channels.type_": {"webhook", "email"},
+ "agents.kind_": {"checker", "statuspage"},
+ "page.status.": {"operational", "degraded", "outage", "unknown", "maintenance"},
+ "page.component.": {"operational", "degraded", "outage", "unknown", "maintenance"},
+ "storage.level_": {"raw", "1h", "1d"},
+ "legal.": {"imprint", "privacy"},
+ "weekday.": {"0", "1", "2", "3", "4", "5", "6"},
+ "maintenance.recurrence_": {"none", "daily", "weekly", "monthly"},
+ "storage.job_": {"compression", "retention", "refresh_continuous_aggregate", "job_stat_history_retention"},
}
for prefix, values := range families {
for _, v := range values {
diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json
index 2af18d8..e84b18c 100644
--- a/internal/i18n/locales/de.json
+++ b/internal/i18n/locales/de.json
@@ -32,6 +32,9 @@
"audit.action.group.update": "Gruppe geändert",
"audit.action.invitation.create": "Einladung verschickt",
"audit.action.invitation.delete": "Einladung zurückgezogen",
+ "audit.action.maintenance.create": "Wartung geplant",
+ "audit.action.maintenance.delete": "Wartung gelöscht",
+ "audit.action.maintenance.update": "Wartung geändert",
"audit.action.member.join": "Der Organisation beigetreten",
"audit.action.member.remove": "Mitglied entfernt",
"audit.action.member.role_assign": "Rolle zugewiesen",
@@ -104,6 +107,9 @@
"channels.type_email": "E-Mail",
"channels.type_webhook": "Webhook",
"channels.url": "Webhook-URL",
+ "common.delete": "Löschen",
+ "common.edit": "Bearbeiten",
+ "common.markdown_hint": "Markdown wird unterstützt: **fett**, _kursiv_, [Links](https://…), Listen. HTML wird nicht dargestellt.",
"common.no": "nein",
"common.save": "Speichern",
"common.yes": "ja",
@@ -152,6 +158,8 @@
"error.invalid_input": "Eingaben prüfen.",
"error.invalid_interval": "Das Intervall muss mindestens {{.Min}} Sekunden und höchstens einen Tag betragen.",
"error.invalid_legal_url": "Der Link muss eine http- oder https-URL sein.",
+ "error.invalid_maintenance_duration": "Die Dauer muss zwischen 1 Minute und 30 Tagen liegen.",
+ "error.invalid_maintenance_time": "Prüfe Beginn, Wochentage und letzten Tag.",
"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.",
@@ -162,6 +170,7 @@
"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 \"\".",
+ "error.invalid_time_zone": "Unbekannte Zeitzone. Nutze einen Namen wie Europe/Berlin.",
"error.invalid_timeout": "Der Timeout muss zwischen 100 ms und 60 s liegen und kürzer als das Intervall sein.",
"error.invalid_type": "Unbekannter Check-Typ.",
"error.invalid_webhook_url": "Die Webhook-URL muss eine https-URL ohne Zugangsdaten sein.",
@@ -169,6 +178,8 @@
"error.invitation_invalid": "Diese Einladung ist ungültig, abgelaufen oder wurde bereits verwendet.",
"error.keyword_needs_get": "Keyword-Checks brauchen GET-Anfragen.",
"error.locked": "Die Ressource ist von einem anderen Prozess gesperrt.",
+ "error.maintenance_overlaps": "Die Wartung würde länger dauern als der Abstand bis zur Wiederholung.",
+ "error.maintenance_without_targets": "Wähle mindestens einen Monitor oder eine Gruppe.",
"error.mfa_expired": "Anmeldung abgelaufen, bitte erneut anmelden.",
"error.no_domain": "Lege zuerst eine eigene Domain fest.",
"error.no_password": "Konto ohne Passwort.",
@@ -345,6 +356,46 @@
"legal.platform_title": "Impressum & Datenschutz der Plattform",
"legal.privacy": "Datenschutz",
"legal.url": "Link auf eine bestehende Seite",
+ "maintenance.delete_confirm": "Dieses Wartungsfenster samt Wiederholungen löschen?",
+ "maintenance.edit": "Wartung bearbeiten",
+ "maintenance.empty": "Keine Wartung geplant.",
+ "maintenance.field_description": "Beschreibung",
+ "maintenance.field_duration": "Dauer (Minuten)",
+ "maintenance.field_every": "Alle",
+ "maintenance.field_groups": "Gruppen (inklusive Untergruppen)",
+ "maintenance.field_monitors": "Monitore",
+ "maintenance.field_recurrence": "Wiederholen",
+ "maintenance.field_start": "Beginn (erstes Mal)",
+ "maintenance.field_time_zone": "Zeitzone",
+ "maintenance.field_title": "Titel",
+ "maintenance.field_until": "Letzter Tag (optional)",
+ "maintenance.field_weekdays": "Wochentage",
+ "maintenance.group_target": "Gruppe {{.Name}}",
+ "maintenance.in_progress": "läuft",
+ "maintenance.intro": "Plane Wartungsarbeiten für Monitore und Gruppen. Während sie laufen, eröffnen Fehlschläge keine Vorfälle, lösen keine Benachrichtigungen aus und senken die SLA nicht. Statusseiten kündigen sie an.",
+ "maintenance.new": "Wartung planen",
+ "maintenance.next": "nächste: {{.Time}}",
+ "maintenance.recurrence_daily": "Tage",
+ "maintenance.recurrence_monthly": "Monate",
+ "maintenance.recurrence_none": "Einmalig",
+ "maintenance.recurrence_weekly": "Wochen",
+ "maintenance.schedule_daily": {
+ "one": "Täglich",
+ "other": "Alle {{.Count}} Tage"
+ },
+ "maintenance.schedule_from": "ab {{.Time}} für {{.Minutes}} Min. ({{.Zone}})",
+ "maintenance.schedule_monthly": {
+ "one": "Monatlich am {{.Day}}.",
+ "other": "Alle {{.Count}} Monate am {{.Day}}."
+ },
+ "maintenance.schedule_once": "Einmalig",
+ "maintenance.schedule_until": "bis {{.Date}}",
+ "maintenance.schedule_weekly": {
+ "one": "Wöchentlich am {{.Days}}",
+ "other": "Alle {{.Count}} Wochen am {{.Days}}"
+ },
+ "maintenance.title": "Wartung",
+ "maintenance.weekdays_hint": "Für wöchentliche Wiederholung; ohne Auswahl gilt der Wochentag des Beginns.",
"members.assign": "Rolle hinzufügen",
"members.intro": "Rollen bestimmen, was ein Mitglied darf. Niemand kann Berechtigungen vergeben, die er selbst nicht hat.",
"members.invite": "Einladen",
@@ -413,6 +464,7 @@
"org.token_max_days_hint": "Neue Tokens müssen innerhalb dieses Zeitraums ablaufen. Beim Speichern werden bestehende Tokens gekürzt, die länger gelten würden. Leer lassen für keine Begrenzung.",
"org.token_max_days_none": "unbegrenzt",
"page.component.degraded": "Eingeschränkt",
+ "page.component.maintenance": "Wartung",
"page.component.operational": "In Betrieb",
"page.component.outage": "Störung",
"page.component.unknown": "Keine Daten",
@@ -421,9 +473,12 @@
"other": "vor {{.Count}} Tagen"
},
"page.incidents": "Letzte Vorfälle",
+ "page.maintenance_ongoing": "Laufende Wartung",
+ "page.maintenance_upcoming": "Geplante Wartung",
"page.no_incidents": "Keine Vorfälle in den letzten 14 Tagen.",
"page.stale": "Live-Aktualisierung derzeit nicht verfügbar. Diese Seite zeigt den Stand von {{.Time}}.",
"page.status.degraded": "Einige Systeme haben Probleme",
+ "page.status.maintenance": "Geplante Wartung läuft",
"page.status.operational": "Alle Systeme funktionieren",
"page.status.outage": "Größere Störung",
"page.status.unknown": "Status derzeit nicht verfügbar",
@@ -549,6 +604,7 @@
"sso.settings.title": "Single Sign-on",
"status.degraded": "in einzelnen Regionen gestört",
"status.down": "ausgefallen",
+ "status.maintenance": "Wartung",
"status.paused": "pausiert",
"status.unknown": "keine Daten",
"status.up": "erreichbar",
@@ -597,5 +653,12 @@
"other": "Diese Organisation begrenzt API-Tokens auf {{.Count}} Tage."
},
"tokens.revoke_confirm": "Diesen Token widerrufen? Anfragen damit schlagen sofort fehl.",
- "tokens.title": "API-Tokens"
+ "tokens.title": "API-Tokens",
+ "weekday.0": "So",
+ "weekday.1": "Mo",
+ "weekday.2": "Di",
+ "weekday.3": "Mi",
+ "weekday.4": "Do",
+ "weekday.5": "Fr",
+ "weekday.6": "Sa"
}
diff --git a/internal/i18n/locales/en.json b/internal/i18n/locales/en.json
index 26b644d..043b443 100644
--- a/internal/i18n/locales/en.json
+++ b/internal/i18n/locales/en.json
@@ -32,6 +32,9 @@
"audit.action.group.update": "Group changed",
"audit.action.invitation.create": "Invitation sent",
"audit.action.invitation.delete": "Invitation withdrawn",
+ "audit.action.maintenance.create": "Maintenance planned",
+ "audit.action.maintenance.delete": "Maintenance deleted",
+ "audit.action.maintenance.update": "Maintenance changed",
"audit.action.member.join": "Joined the organization",
"audit.action.member.remove": "Member removed",
"audit.action.member.role_assign": "Role assigned",
@@ -104,6 +107,9 @@
"channels.type_email": "Email",
"channels.type_webhook": "Webhook",
"channels.url": "Webhook URL",
+ "common.delete": "Delete",
+ "common.edit": "Edit",
+ "common.markdown_hint": "Markdown is supported: **bold**, _italic_, [links](https://…), lists. HTML is not rendered.",
"common.no": "no",
"common.save": "Save",
"common.yes": "yes",
@@ -152,6 +158,8 @@
"error.invalid_input": "Please check your input.",
"error.invalid_interval": "The interval must be at least {{.Min}} seconds and at most one day.",
"error.invalid_legal_url": "The link must be an http or https URL.",
+ "error.invalid_maintenance_duration": "The duration must be between 1 minute and 30 days.",
+ "error.invalid_maintenance_time": "Check start, weekdays and last day.",
"error.invalid_method": "Only GET and HEAD requests are supported.",
"error.invalid_monitor": "One of the monitors does not exist or is listed twice.",
"error.invalid_permissions": "Choose at least one permission.",
@@ -162,6 +170,7 @@
"error.invalid_slug": "Short name: 2–63 characters, a–z, 0–9 and hyphen.",
"error.invalid_target": "The target is not valid for this check type.",
"error.invalid_theme": "The theme settings are not valid: accent as #rrggbb, logo as https URL, CSS without \"\".",
+ "error.invalid_time_zone": "Unknown time zone. Use a name like Europe/Berlin.",
"error.invalid_timeout": "The timeout must be between 100 ms and 60 s and shorter than the interval.",
"error.invalid_type": "Unknown check type.",
"error.invalid_webhook_url": "The webhook URL must be an https URL without credentials.",
@@ -169,6 +178,8 @@
"error.invitation_invalid": "This invitation is invalid, expired or was already used.",
"error.keyword_needs_get": "Keyword checks need GET requests.",
"error.locked": "The resource is locked by another process.",
+ "error.maintenance_overlaps": "The maintenance would last longer than the time until it repeats.",
+ "error.maintenance_without_targets": "Choose at least one monitor or group.",
"error.mfa_expired": "Sign-in expired, please start again.",
"error.no_domain": "Set a custom domain first.",
"error.no_password": "This account has no password.",
@@ -345,6 +356,46 @@
"legal.platform_title": "Platform legal notice & privacy",
"legal.privacy": "Privacy policy",
"legal.url": "Link to an existing page",
+ "maintenance.delete_confirm": "Delete this maintenance window and all its repeats?",
+ "maintenance.edit": "Edit maintenance",
+ "maintenance.empty": "No maintenance planned.",
+ "maintenance.field_description": "Description",
+ "maintenance.field_duration": "Duration (minutes)",
+ "maintenance.field_every": "Every",
+ "maintenance.field_groups": "Groups (including subgroups)",
+ "maintenance.field_monitors": "Monitors",
+ "maintenance.field_recurrence": "Repeat",
+ "maintenance.field_start": "Start (first time)",
+ "maintenance.field_time_zone": "Time zone",
+ "maintenance.field_title": "Title",
+ "maintenance.field_until": "Last day (optional)",
+ "maintenance.field_weekdays": "Weekdays",
+ "maintenance.group_target": "Group {{.Name}}",
+ "maintenance.in_progress": "in progress",
+ "maintenance.intro": "Plan maintenance for monitors and groups. While it is in progress, failures open no incidents, send no alerts and do not lower the SLA. Status pages announce it.",
+ "maintenance.new": "Plan maintenance",
+ "maintenance.next": "next: {{.Time}}",
+ "maintenance.recurrence_daily": "Days",
+ "maintenance.recurrence_monthly": "Months",
+ "maintenance.recurrence_none": "Once",
+ "maintenance.recurrence_weekly": "Weeks",
+ "maintenance.schedule_daily": {
+ "one": "Daily",
+ "other": "Every {{.Count}} days"
+ },
+ "maintenance.schedule_from": "from {{.Time}} for {{.Minutes}} min ({{.Zone}})",
+ "maintenance.schedule_monthly": {
+ "one": "Monthly on day {{.Day}}",
+ "other": "Every {{.Count}} months on day {{.Day}}"
+ },
+ "maintenance.schedule_once": "Once",
+ "maintenance.schedule_until": "until {{.Date}}",
+ "maintenance.schedule_weekly": {
+ "one": "Weekly on {{.Days}}",
+ "other": "Every {{.Count}} weeks on {{.Days}}"
+ },
+ "maintenance.title": "Maintenance",
+ "maintenance.weekdays_hint": "For weekly repeats; none selected means the start's weekday.",
"members.assign": "Add role",
"members.intro": "Roles decide what each member may do. Nobody can grant permissions they do not hold themselves.",
"members.invite": "Invite",
@@ -413,6 +464,7 @@
"org.token_max_days_hint": "New tokens must expire within this period. Saving shortens existing tokens that would outlive it. Leave empty for no limit.",
"org.token_max_days_none": "unlimited",
"page.component.degraded": "Degraded",
+ "page.component.maintenance": "Maintenance",
"page.component.operational": "Operational",
"page.component.outage": "Outage",
"page.component.unknown": "No data",
@@ -421,9 +473,12 @@
"other": "{{.Count}} days ago"
},
"page.incidents": "Recent incidents",
+ "page.maintenance_ongoing": "Maintenance in progress",
+ "page.maintenance_upcoming": "Planned maintenance",
"page.no_incidents": "No incidents in the last 14 days.",
"page.stale": "Live updates are currently unavailable. This page shows the status as of {{.Time}}.",
"page.status.degraded": "Some systems are experiencing problems",
+ "page.status.maintenance": "Planned maintenance in progress",
"page.status.operational": "All systems operational",
"page.status.outage": "Major outage",
"page.status.unknown": "Status currently unavailable",
@@ -549,6 +604,7 @@
"sso.settings.title": "Single sign-on",
"status.degraded": "failing in some regions",
"status.down": "down",
+ "status.maintenance": "maintenance",
"status.paused": "paused",
"status.unknown": "no data",
"status.up": "up",
@@ -597,5 +653,12 @@
"other": "This organization limits API tokens to {{.Count}} days."
},
"tokens.revoke_confirm": "Revoke this token? Requests using it fail immediately.",
- "tokens.title": "API tokens"
+ "tokens.title": "API tokens",
+ "weekday.0": "Sun",
+ "weekday.1": "Mon",
+ "weekday.2": "Tue",
+ "weekday.3": "Wed",
+ "weekday.4": "Thu",
+ "weekday.5": "Fri",
+ "weekday.6": "Sat"
}
diff --git a/internal/statuspage/statuspage.go b/internal/statuspage/statuspage.go
index 64f108d..2eca8f4 100644
--- a/internal/statuspage/statuspage.go
+++ b/internal/statuspage/statuspage.go
@@ -231,7 +231,7 @@ func (s *Server) serve(c *gin.Context) {
}
s.localizeRequest(c)
c.Header("Cache-Control", "public, max-age=30")
- web.Render(c, http.StatusOK, web.PublicStatusPage(e.Snap, web.PublicAssets{CSSHref: "/static/dist/app.css", StaleSince: staleSince, LegalBase: base}))
+ web.Render(c, http.StatusOK, web.PublicStatusPage(e.Snap.WithMaintenance(s.now()), web.PublicAssets{CSSHref: "/static/dist/app.css", StaleSince: staleSince, LegalBase: base, Now: s.now()}))
}
// serveLegal shows a legal document of the page from the cached snapshot,
diff --git a/internal/statuspage/statuspage_test.go b/internal/statuspage/statuspage_test.go
index 4f3e6e2..7994389 100644
--- a/internal/statuspage/statuspage_test.go
+++ b/internal/statuspage/statuspage_test.go
@@ -264,3 +264,38 @@ func TestLegalDocuments(t *testing.T) {
t.Errorf("unknown document = %d, want 404", code)
}
}
+
+// Maintenance in a cached snapshot starts on time even without the API.
+func TestMaintenanceStartsWhileAPIIsDown(t *testing.T) {
+ now := time.Now()
+ src := newSource()
+ src.pages["|acme"] = agentapi.PageSnapshot{
+ Title: "Acme status", Status: agentapi.PageOperational, Description: "Run by **Acme**",
+ Sections: []agentapi.Section{{Components: []agentapi.Component{{Name: "Database", Status: agentapi.PageOperational}, {Name: "Web", Status: agentapi.PageOperational}}}},
+ Maintenance: []agentapi.PageMaintenance{{
+ Title: "DB upgrade", Description: "Expect short _gaps_.", Components: []string{"Database"},
+ Start: now.Add(30 * time.Minute), End: now.Add(90 * time.Minute),
+ }},
+ }
+ h := newHarness(t, src, t.TempDir(), &now)
+ _, page := h.get("status.example.test", "/acme")
+ if !strings.Contains(page, "Geplante Wartung") || strings.Contains(page, "Laufende Wartung") {
+ t.Error("upcoming maintenance is not announced as planned")
+ }
+ if !strings.Contains(page, "Acme ") || !strings.Contains(page, "gaps ") || strings.Contains(page, "short ") {
+ t.Error("descriptions are not rendered as safe Markdown")
+ }
+
+ src.mu.Lock()
+ src.err = errors.New("connection refused")
+ src.mu.Unlock()
+ now = now.Add(45 * time.Minute)
+ _, page = h.get("status.example.test", "/acme")
+ if !strings.Contains(page, "Laufende Wartung") || !strings.Contains(page, "Geplante Wartung läuft") {
+ t.Error("maintenance in progress is not shown from the cache")
+ }
+ now = now.Add(time.Hour)
+ if _, page = h.get("status.example.test", "/acme"); strings.Contains(page, "Wartung") {
+ t.Error("ended maintenance is still shown")
+ }
+}
diff --git a/internal/web/assets/app.css b/internal/web/assets/app.css
index fe21ab8..cceb604 100644
--- a/internal/web/assets/app.css
+++ b/internal/web/assets/app.css
@@ -54,6 +54,7 @@
--color-down: #b3361f;
--color-degraded: #b57b14;
--color-unknown: #8a8a86;
+ --color-maintenance: #3d6fa6;
--radius-box: 2px;
}
diff --git a/internal/web/assets/app.js b/internal/web/assets/app.js
index 62c5fa2..146746f 100644
--- a/internal/web/assets/app.js
+++ b/internal/web/assets/app.js
@@ -188,3 +188,8 @@
location.reload();
});
})();
+
+// Time zone fields start with the browser's zone.
+for (const el of document.querySelectorAll("input[data-tz-default]")) {
+ if (!el.value) el.value = Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
+}
diff --git a/internal/web/charts.go b/internal/web/charts.go
index 07dafd6..be6c6ef 100644
--- a/internal/web/charts.go
+++ b/internal/web/charts.go
@@ -17,6 +17,9 @@ const (
StatusDown Status = "down"
StatusUnknown Status = "unknown"
StatusPaused Status = "paused"
+ // StatusMaintenance covers planned maintenance, during which failures
+ // are expected.
+ StatusMaintenance Status = "maintenance"
)
// Bar is one bucket of an uptime bar chart.
diff --git a/internal/web/console.templ b/internal/web/console.templ
index d4b9f9a..b340e80 100644
--- a/internal/web/console.templ
+++ b/internal/web/console.templ
@@ -54,6 +54,7 @@ templ consoleShell(p Page, me Me) {
}
if me.Can["incidents.read"] {
{ i18n.T(ctx, "incidents.title") }
+ { i18n.T(ctx, "maintenance.title") }
}
diff --git a/internal/web/console_templ.go b/internal/web/console_templ.go
index a9f7d2a..f86420a 100644
--- a/internal/web/console_templ.go
+++ b/internal/web/console_templ.go
@@ -196,61 +196,74 @@ 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, 16, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var9 string
+ templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.title"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 57, Col: 97}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var9 string
- templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.settings"))
+ var templ_7745c5c3_Var10 string
+ templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.settings"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 60, Col: 96}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 61, Col: 96}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if me.IsAdmin {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var10 string
- templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.admin"))
+ var templ_7745c5c3_Var11 string
+ templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.admin"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 62, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 63, Col: 93}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var11 string
- templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.logout"))
+ var templ_7745c5c3_Var12 string
+ templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.logout"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 64, Col: 94}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 65, Col: 94}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
+ _, 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, 22, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -258,7 +271,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, 23, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -274,7 +287,7 @@ func consoleShell(p Page, me Me) templ.Component {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -286,7 +299,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, 25, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -323,7 +336,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var13 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var14 := 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 {
@@ -335,51 +348,51 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var14 string
- templ_7745c5c3_Var14, 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: 90, Col: 72}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "")
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, "security.totp.heading"))
+ templ_7745c5c3_Var15, 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: 92, Col: 114}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 91, Col: 72}
}
_, 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, 28, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var16 string
+ templ_7745c5c3_Var16, 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: 93, Col: 114}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
+ 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
}
if me.TOTP {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "● ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "
● ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var16 string
- templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.active"))
+ var templ_7745c5c3_Var17 string
+ templ_7745c5c3_Var17, 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: 94, Col: 98}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 95, Col: 98}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
+ _, 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, 30, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -387,25 +400,25 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
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, 31, "= 3)}
- templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var17...)
+ var templ_7745c5c3_Var18 = []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_Var18...)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var18 string
- templ_7745c5c3_Var18, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var17).String()).Resolve(ctx)
+ var templ_7745c5c3_Var19 string
+ templ_7745c5c3_Var19, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var18).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_Var18)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var19)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -419,33 +432,33 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
}
templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, ">")
- 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.recovery.left", "Count", me.RecoveryCodesLeft))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 96, Col: 75}
- }
- _, 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, 34, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, ">")
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.recovery.regenerate"))
+ templ_7745c5c3_Var20, 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: 99, Col: 116}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 97, Col: 75}
}
_, 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, 35, " ")
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.disable"))
+ var templ_7745c5c3_Var22 string
+ templ_7745c5c3_Var22, 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: 109, Col: 109}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 110, Col: 109}
}
- _, 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, 37, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -502,51 +515,51 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
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, 39, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "● ")
- 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, "security.totp.inactive"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 118, Col: 105}
- }
- _, 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, 40, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "● ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
- templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.start"))
+ templ_7745c5c3_Var23, 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: 120, Col: 141}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 119, Col: 105}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- 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 = templruntime.NewAttributeExpression(i18n.T(ctx, "security.totp.qr_alt")).Resolve(ctx)
+ templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.start"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 122, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 121, Col: 141}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
+ _, 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, "\" class=\"mb-3 h-48 w-48 border border-rule bg-white p-2\">
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -566,121 +579,121 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
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
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, " ")
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.sso.heading"))
+ var templ_7745c5c3_Var26 string
+ templ_7745c5c3_Var26, 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: 135, Col: 113}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 136, Col: 113}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
+ _, 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, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(identities) == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "
")
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.sso.none"))
+ var templ_7745c5c3_Var27 string
+ templ_7745c5c3_Var27, 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: 137, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 138, Col: 73}
}
- _, 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, 47, "
")
+ 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, 48, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, id := range identities {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var27 string
- templ_7745c5c3_Var27, 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: 141, Col: 69}
- }
- _, 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, 50, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var28 string
- templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(id.Email)
+ templ_7745c5c3_Var28, 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: 141, Col: 131}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 142, Col: 69}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var29 string
+ templ_7745c5c3_Var29, 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: 142, Col: 131}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, " ")
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, 53, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if canLink {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "\" 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_Var31 string
+ templ_7745c5c3_Var31, 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: 147, Col: 190}
+ }
+ _, 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, 56, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -688,20 +701,20 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "
")
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.activity_intro"))
+ var templ_7745c5c3_Var32 string
+ templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.activity_intro"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 151, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 152, Col: 88}
}
- _, 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, 58, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -709,7 +722,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
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
}
@@ -719,7 +732,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
}
return nil
})
- templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -746,33 +759,33 @@ func recoveryOutput() templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var33 string
- templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.save_now"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 162, 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, 61, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var34 string
- templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.saved"))
+ templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.save_now"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 164, Col: 116}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 163, Col: 69}
}
_, 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, 62, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var35 string
+ templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.saved"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 165, Col: 116}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -797,46 +810,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, 63, "")
- 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, msgID))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 171, Col: 23}
- }
- _, 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, 64, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var37 string
- templ_7745c5c3_Var37, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(href)).ResolveURL(ctx)
+ templ_7745c5c3_Var37, 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: 32}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 172, Col: 23}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "\" class=\"underline underline-offset-2\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "\" class=\"underline underline-offset-2\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var39 string
+ templ_7745c5c3_Var39, 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: 173, Col: 95}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -861,46 +874,46 @@ func settingsLink(href, titleID, hintID string) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "\" class=\"block border border-rule p-4 hover:border-ink\">")
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, hintID))
+ templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, titleID))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 180, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 180, Col: 56}
}
_, 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, 70, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, " ")
+ 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, hintID))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 181, Col: 67}
+ }
+ _, 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, 71, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -926,7 +939,7 @@ func SettingsIndex(p Page, me Me) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var44 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var45 := 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 {
@@ -942,7 +955,7 @@ func SettingsIndex(p Page, me Me) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1000,13 +1013,13 @@ func SettingsIndex(p Page, me Me) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
- templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var44), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var45), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/web/maintenance.go b/internal/web/maintenance.go
new file mode 100644
index 0000000..5fc2362
--- /dev/null
+++ b/internal/web/maintenance.go
@@ -0,0 +1,27 @@
+package web
+
+import "fmt"
+
+const inputClass = "w-full border border-rule bg-transparent px-2.5 py-1.5 text-sm outline-none focus:border-ink"
+
+// commonTimeZones are suggested in the time zone field; any IANA name works.
+var commonTimeZones = []string{
+ "UTC", "Europe/Berlin", "Europe/Vienna", "Europe/Zurich", "Europe/London", "Europe/Paris",
+ "Europe/Amsterdam", "America/New_York", "America/Chicago", "America/Los_Angeles", "Asia/Tokyo", "Asia/Singapore", "Australia/Sydney",
+}
+
+func maintenanceAPI(id string) string {
+ if id == "" {
+ return "/org/maintenance"
+ }
+ return "/org/maintenance/" + id
+}
+
+func maintenanceMethod(id string) string {
+ if id == "" {
+ return "post"
+ }
+ return "put"
+}
+
+func indent(depth int) string { return fmt.Sprintf("padding-left:%drem", depth) }
diff --git a/internal/web/maintenance.templ b/internal/web/maintenance.templ
new file mode 100644
index 0000000..ea04b94
--- /dev/null
+++ b/internal/web/maintenance.templ
@@ -0,0 +1,217 @@
+package web
+
+import (
+ "strconv"
+
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n"
+)
+
+// MaintenanceView is the maintenance page: planned windows and the form to
+// add or edit one.
+type MaintenanceView struct {
+ Windows []MaintenanceRow
+ Form MaintenanceForm
+ Monitors []TargetOption
+ Groups []TargetOption
+ CanWrite bool
+}
+
+// MaintenanceRow is one planned window.
+type MaintenanceRow struct {
+ ID string
+ Title string
+ Schedule string
+ Targets string
+ Next string
+ Active bool
+ Description string
+ CanWrite bool
+}
+
+// MaintenanceForm holds the values of the form; ID is empty for a new window.
+type MaintenanceForm struct {
+ ID string
+ Title string
+ Description string
+ Start string
+ TimeZone string
+ Duration int
+ Recurrence string
+ Every int
+ Weekdays map[int]bool
+ Until string
+ Monitors map[string]bool
+ Groups map[string]bool
+}
+
+// TargetOption is a monitor or group to choose; Depth indents groups.
+type TargetOption struct {
+ ID string
+ Name string
+ Depth int
+}
+
+templ maintenanceList(items []MaintenanceItem) {
+
+ for _, m := range items {
+
+
+ @statusDot(StatusMaintenance)
+ { m.Title }
+ if m.Active {
+ { i18n.T(ctx, "maintenance.in_progress") }
+ }
+
+ { m.When }
+ if m.Description != "" {
+
+ @templ.Raw(m.Description)
+
+ }
+
+ }
+
+}
+
+templ MaintenancePage(p Page, me Me, v MaintenanceView) {
+ @consoleShell(p, me) {
+ @settingsHeading("maintenance.title", "maintenance.intro")
+ if len(v.Windows) == 0 {
+ { i18n.T(ctx, "maintenance.empty") }
+ } else {
+
+ for _, w := range v.Windows {
+
+
+
+ @statusDot(StatusMaintenance)
+ { w.Title }
+ if w.Active {
+ { i18n.T(ctx, "maintenance.in_progress") }
+ }
+
+
{ w.Schedule }
+
{ w.Targets }
+ if w.Next != "" {
+
{ i18n.T(ctx, "maintenance.next", "Time", w.Next) }
+ }
+ if w.Description != "" {
+
+ @templ.Raw(w.Description)
+
+ }
+
+ if w.CanWrite {
+
+
{ i18n.T(ctx, "common.edit") }
+
{ i18n.T(ctx, "common.delete") }
+
+ }
+
+ }
+
+ }
+ if v.CanWrite {
+ @maintenanceForm(v)
+ }
+ }
+}
+
+templ maintenanceForm(v MaintenanceView) {
+
+ if v.Form.ID == "" {
+ @sectionHeading("maintenance.new")
+ } else {
+ @sectionHeading("maintenance.edit")
+ }
+
+ @formError()
+ @labeled("maintenance.field_title") {
+
+ }
+ @labeled("maintenance.field_description") {
+ { v.Form.Description }
+ { i18n.T(ctx, "common.markdown_hint") }
+ }
+
+ @labeled("maintenance.field_start") {
+
+ }
+ @labeled("maintenance.field_duration") {
+
+ }
+ @labeled("maintenance.field_time_zone") {
+
+
+ for _, tz := range commonTimeZones {
+
+ }
+
+ }
+
+
+ @labeled("maintenance.field_recurrence") {
+
+ for _, r := range []string{"none", "daily", "weekly", "monthly"} {
+ { i18n.T(ctx, "maintenance.recurrence_" + r) }
+ }
+
+ }
+ @labeled("maintenance.field_every") {
+
+ }
+ @labeled("maintenance.field_until") {
+
+ }
+
+
+ { i18n.T(ctx, "maintenance.field_weekdays") }
+
+ for _, d := range []int{1, 2, 3, 4, 5, 6, 0} {
+
+
+ { i18n.T(ctx, "weekday." + strconv.Itoa(d)) }
+
+ }
+
+ { i18n.T(ctx, "maintenance.weekdays_hint") }
+
+
+ @submit(i18n.T(ctx, "common.save"))
+
+
+}
+
+templ labeled(labelID string) {
+
+ { i18n.T(ctx, labelID) }
+ { children... }
+
+}
diff --git a/internal/web/maintenance_templ.go b/internal/web/maintenance_templ.go
new file mode 100644
index 0000000..ec3bd30
--- /dev/null
+++ b/internal/web/maintenance_templ.go
@@ -0,0 +1,1419 @@
+// 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 (
+ "strconv"
+
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n"
+)
+
+// MaintenanceView is the maintenance page: planned windows and the form to
+// add or edit one.
+type MaintenanceView struct {
+ Windows []MaintenanceRow
+ Form MaintenanceForm
+ Monitors []TargetOption
+ Groups []TargetOption
+ CanWrite bool
+}
+
+// MaintenanceRow is one planned window.
+type MaintenanceRow struct {
+ ID string
+ Title string
+ Schedule string
+ Targets string
+ Next string
+ Active bool
+ Description string
+ CanWrite bool
+}
+
+// MaintenanceForm holds the values of the form; ID is empty for a new window.
+type MaintenanceForm struct {
+ ID string
+ Title string
+ Description string
+ Start string
+ TimeZone string
+ Duration int
+ Recurrence string
+ Every int
+ Weekdays map[int]bool
+ Until string
+ Monitors map[string]bool
+ Groups map[string]bool
+}
+
+// TargetOption is a monitor or group to choose; Depth indents groups.
+type TargetOption struct {
+ ID string
+ Name string
+ Depth int
+}
+
+func maintenanceList(items []MaintenanceItem) 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_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, m := range items {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = statusDot(StatusMaintenance).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var2 string
+ templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 60, Col: 40}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if m.Active {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var3 string
+ templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.in_progress"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 62, Col: 95}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var4 string
+ templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(m.When)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 65, Col: 64}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if m.Description != "" {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templ.Raw(m.Description).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+}
+
+func MaintenancePage(p Page, me Me, v MaintenanceView) 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_Var6 := 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("maintenance.title", "maintenance.intro").Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if len(v.Windows) == 0 {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var7 string
+ templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.empty"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 80, Col: 73}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ } else {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, w := range v.Windows {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = statusDot(StatusMaintenance).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var8 string
+ templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(w.Title)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 88, Col: 43}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
+ 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
+ }
+ if w.Active {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var9 string
+ templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.in_progress"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 90, Col: 98}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, " ")
+ 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_Var10 string
+ templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(w.Schedule)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 93, Col: 61}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
+ 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
+ }
+ var templ_7745c5c3_Var11 string
+ templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(w.Targets)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 94, Col: 53}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if w.Next != "" {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "
")
+ 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, "maintenance.next", "Time", w.Next))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 96, Col: 102}
+ }
+ _, 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, 25, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ if w.Description != "" {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templ.Raw(w.Description).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "
")
+ 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
+ }
+ if w.CanWrite {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var14 string
+ templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "common.edit"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 106, Col: 125}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, " ")
+ 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, "common.delete"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 107, Col: 222}
+ }
+ _, 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, 34, " ")
+ 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
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, " ")
+ 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
+ }
+ if v.CanWrite {
+ templ_7745c5c3_Err = maintenanceForm(v).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+}
+
+func maintenanceForm(v MaintenanceView) 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_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if v.Form.ID == "" {
+ templ_7745c5c3_Err = sectionHeading("maintenance.new").Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ } else {
+ templ_7745c5c3_Err = sectionHeading("maintenance.edit").Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "")
+ 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_Var21 := 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_ElementWriter := templ_7745c5c3_Buffer
+ templ_7745c5c3_Buffer := templ.GetBuffer()
+ var templ_7745c5c3_ElementScripts []templ.ComponentScript
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = labeled("maintenance.field_title").Render(templ.WithChildren(ctx, templ_7745c5c3_Var21), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Var25 := 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_ElementWriter := templ_7745c5c3_Buffer
+ templ_7745c5c3_Buffer := templ.GetBuffer()
+ var templ_7745c5c3_ElementScripts []templ.ComponentScript
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var28 string
+ templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(v.Form.Description)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 137, Col: 124}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
+ 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
+ }
+ var templ_7745c5c3_Var29 string
+ templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "common.markdown_hint"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 138, Col: 85}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = labeled("maintenance.field_description").Render(templ.WithChildren(ctx, templ_7745c5c3_Var25), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Var30 := 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_ElementWriter := templ_7745c5c3_Buffer
+ templ_7745c5c3_Buffer := templ.GetBuffer()
+ var templ_7745c5c3_ElementScripts []templ.ComponentScript
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = labeled("maintenance.field_start").Render(templ.WithChildren(ctx, templ_7745c5c3_Var30), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Var34 := 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_ElementWriter := templ_7745c5c3_Buffer
+ templ_7745c5c3_Buffer := templ.GetBuffer()
+ var templ_7745c5c3_ElementScripts []templ.ComponentScript
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = labeled("maintenance.field_duration").Render(templ.WithChildren(ctx, templ_7745c5c3_Var34), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Var38 := 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_ElementWriter := templ_7745c5c3_Buffer
+ templ_7745c5c3_Buffer := templ.GetBuffer()
+ var templ_7745c5c3_ElementScripts []templ.ComponentScript
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, tz := range commonTimeZones {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = labeled("maintenance.field_time_zone").Render(templ.WithChildren(ctx, templ_7745c5c3_Var38), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Var43 := 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_ElementWriter := templ_7745c5c3_Buffer
+ templ_7745c5c3_Buffer := templ.GetBuffer()
+ var templ_7745c5c3_ElementScripts []templ.ComponentScript
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, r := range []string{"none", "daily", "weekly", "monthly"} {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var47 string
+ templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.recurrence_"+r))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 160, Col: 108}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = labeled("maintenance.field_recurrence").Render(templ.WithChildren(ctx, templ_7745c5c3_Var43), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Var48 := 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_ElementWriter := templ_7745c5c3_Buffer
+ templ_7745c5c3_Buffer := templ.GetBuffer()
+ var templ_7745c5c3_ElementScripts []templ.ComponentScript
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = labeled("maintenance.field_every").Render(templ.WithChildren(ctx, templ_7745c5c3_Var48), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Var52 := 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_ElementWriter := templ_7745c5c3_Buffer
+ templ_7745c5c3_Buffer := templ.GetBuffer()
+ var templ_7745c5c3_ElementScripts []templ.ComponentScript
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = labeled("maintenance.field_until").Render(templ.WithChildren(ctx, templ_7745c5c3_Var52), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var56 string
+ templ_7745c5c3_Var56, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.field_weekdays"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 172, Col: 124}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var56))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, d := range []int{1, 2, 3, 4, 5, 6, 0} {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var58 string
+ templ_7745c5c3_Var58, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "weekday."+strconv.Itoa(d)))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 177, Col: 50}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var58))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var59 string
+ templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.weekdays_hint"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 181, Col: 90}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var60 string
+ templ_7745c5c3_Var60, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.field_groups"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 185, Col: 123}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var60))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, g := range v.Groups {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var63 string
+ templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinStringErrs(g.Name)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 190, Col: 16}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var63))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var64 string
+ templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.field_monitors"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 196, Col: 125}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, m := range v.Monitors {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var66 string
+ templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(m.Name)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 201, Col: 16}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "
")
+ 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, 109, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+}
+
+func labeled(labelID string) 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)
+ templ_7745c5c3_Var67 := templ.GetChildren(ctx)
+ ctx = templ.ClearChildren(ctx)
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var68 string
+ templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, labelID))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/maintenance.templ`, Line: 214, Col: 105}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templ_7745c5c3_Var67.Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 112, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+}
+
+var _ = templruntime.GeneratedTemplate
diff --git a/internal/web/monitors.templ b/internal/web/monitors.templ
index 5ebbd51..6a6c06b 100644
--- a/internal/web/monitors.templ
+++ b/internal/web/monitors.templ
@@ -103,6 +103,7 @@ templ statusDot(s Status) {
templ.KV("bg-degraded", s == StatusDegraded),
templ.KV("bg-down", s == StatusDown),
templ.KV("bg-unknown", s == StatusUnknown),
+ templ.KV("bg-maintenance", s == StatusMaintenance),
templ.KV("border border-unknown", s == StatusPaused) }
title={ i18n.T(ctx, "status."+string(s)) }
>
@@ -140,7 +141,7 @@ templ Dashboard(p Page, me Me, v DashboardView) {
{ i18n.T(ctx, "console.monitors.title") }
@rangeSwitch(v.Ranges)
- for _, s := range []Status{StatusUp, StatusDegraded, StatusDown, StatusPaused} {
+ for _, s := range []Status{StatusUp, StatusDegraded, StatusDown, StatusMaintenance, StatusPaused} {
if v.Counts[s] > 0 {
@statusDot(s)
@@ -243,6 +244,16 @@ type MonitorDetailView struct {
Recent []ResultRow
Incidents []IncidentRow
CanWrite bool
+ // Maintenance lists current and upcoming maintenance.
+ Maintenance []MaintenanceItem
+}
+
+// MaintenanceItem is one occurrence of planned maintenance.
+type MaintenanceItem struct {
+ Title string
+ When string
+ Description string
+ Active bool
}
templ MonitorDetail(p Page, me Me, v MonitorDetailView) {
@@ -295,6 +306,12 @@ templ MonitorDetail(p Page, me Me, v MonitorDetailView) {
{ i18n.T(ctx, "monitors.by_region_hint") }
}
+ if len(v.Maintenance) > 0 {
+
+ @sectionHeading("maintenance.title")
+ @maintenanceList(v.Maintenance)
+
+ }
@sectionHeading("monitors.sla_table")
diff --git a/internal/web/monitors_templ.go b/internal/web/monitors_templ.go
index 0b4fe9f..3413de3 100644
--- a/internal/web/monitors_templ.go
+++ b/internal/web/monitors_templ.go
@@ -246,6 +246,7 @@ func statusDot(s Status) templ.Component {
templ.KV("bg-degraded", s == StatusDegraded),
templ.KV("bg-down", s == StatusDown),
templ.KV("bg-unknown", s == StatusUnknown),
+ templ.KV("bg-maintenance", s == StatusMaintenance),
templ.KV("border border-unknown", s == StatusPaused)}
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var9...)
if templ_7745c5c3_Err != nil {
@@ -267,7 +268,7 @@ func statusDot(s Status) templ.Component {
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "status."+string(s))).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 107, Col: 42}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 108, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
if templ_7745c5c3_Err != nil {
@@ -319,7 +320,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templruntime.NewAttributeExpression("0 0 " + strconv.Itoa(len(bs)*4) + " " + strconv.Itoa(height)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 113, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 114, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
if templ_7745c5c3_Err != nil {
@@ -332,7 +333,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues("height:" + strconv.Itoa(height) + "px")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 116, Col: 49}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 117, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -345,7 +346,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.uptime_chart")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 118, Col: 51}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 119, Col: 51}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15)
if templ_7745c5c3_Err != nil {
@@ -367,7 +368,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(i * 4)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 122, Col: 25}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 123, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
if templ_7745c5c3_Err != nil {
@@ -380,7 +381,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(height)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 125, Col: 33}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 126, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
if templ_7745c5c3_Err != nil {
@@ -428,7 +429,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(b.Title)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 131, Col: 20}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 132, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
@@ -483,7 +484,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 140, Col: 76}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 141, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
@@ -497,7 +498,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- for _, s := range []Status{StatusUp, StatusDegraded, StatusDown, StatusPaused} {
+ for _, s := range []Status{StatusUp, StatusDegraded, StatusDown, StatusMaintenance, StatusPaused} {
if v.Counts[s] > 0 {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "")
if templ_7745c5c3_Err != nil {
@@ -514,7 +515,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.Counts[s]))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 147, Col: 40}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 148, Col: 40}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil {
@@ -534,7 +535,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.new"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 152, Col: 131}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 153, Col: 131}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
@@ -557,7 +558,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, 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/monitors.templ`, Line: 157, Col: 111}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 158, Col: 111}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
@@ -589,7 +590,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.range_note", "Range", v.Range))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 165, Col: 103}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 166, Col: 103}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
@@ -607,7 +608,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.manage"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 167, Col: 108}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 168, Col: 108}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
@@ -657,7 +658,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/monitors/" + m.ID)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 176, Col: 49}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 177, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30)
if templ_7745c5c3_Err != nil {
@@ -678,7 +679,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(m.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 180, Col: 45}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 181, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
@@ -691,7 +692,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(m.Type)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 181, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 182, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
@@ -704,7 +705,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(m.Target)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 181, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 182, Col: 90}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
if templ_7745c5c3_Err != nil {
@@ -725,7 +726,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(m.Latency)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 185, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 186, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
if templ_7745c5c3_Err != nil {
@@ -738,7 +739,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(m.Uptime)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 186, Col: 83}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 187, Col: 83}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
if templ_7745c5c3_Err != nil {
@@ -792,7 +793,7 @@ func groupBlock(g GroupNode) templ.Component {
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(g.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 200, Col: 17}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 201, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil {
@@ -805,7 +806,7 @@ func groupBlock(g GroupNode) templ.Component {
var templ_7745c5c3_Var38 string
templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(g.Total))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 201, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 202, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
if templ_7745c5c3_Err != nil {
@@ -867,6 +868,16 @@ type MonitorDetailView struct {
Recent []ResultRow
Incidents []IncidentRow
CanWrite bool
+ // Maintenance lists current and upcoming maintenance.
+ Maintenance []MaintenanceItem
+}
+
+// MaintenanceItem is one occurrence of planned maintenance.
+type MaintenanceItem struct {
+ Title string
+ When string
+ Description string
+ Active bool
}
func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
@@ -905,7 +916,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var41 string
templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 250, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 261, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
if templ_7745c5c3_Err != nil {
@@ -926,7 +937,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var42 string
templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(v.Row.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 255, Col: 23}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 266, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
if templ_7745c5c3_Err != nil {
@@ -939,7 +950,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var43 string
templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(v.Row.Type)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 257, Col: 61}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 268, Col: 61}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
if templ_7745c5c3_Err != nil {
@@ -952,7 +963,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var44 string
templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(v.Row.Target)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 257, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 268, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
if templ_7745c5c3_Err != nil {
@@ -965,7 +976,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var45 string
templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(v.Interval)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 257, Col: 99}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 268, Col: 99}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
if templ_7745c5c3_Err != nil {
@@ -983,7 +994,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var46 string
templ_7745c5c3_Var46, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/monitors/" + v.Row.ID + "/edit")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 260, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 271, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46)
if templ_7745c5c3_Err != nil {
@@ -996,7 +1007,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var47 string
templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "sso.action.edit"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 260, Col: 173}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 271, Col: 173}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47))
if templ_7745c5c3_Err != nil {
@@ -1014,7 +1025,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var48 string
templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.history", "Range", v.Range))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 265, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 276, Col: 123}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
if templ_7745c5c3_Err != nil {
@@ -1035,7 +1046,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var49 string
templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.sla"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 269, Col: 39}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 280, Col: 39}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
if templ_7745c5c3_Err != nil {
@@ -1048,7 +1059,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var50 string
templ_7745c5c3_Var50, templ_7745c5c3_Err = templ.JoinStringErrs(v.Row.Uptime)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 270, Col: 49}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 281, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var50))
if templ_7745c5c3_Err != nil {
@@ -1070,7 +1081,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var51 string
templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.latency"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 275, Col: 44}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 286, Col: 44}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51))
if templ_7745c5c3_Err != nil {
@@ -1083,7 +1094,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var52 string
templ_7745c5c3_Var52, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.Latency.MaxMS))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 276, Col: 46}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 287, Col: 46}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var52))
if templ_7745c5c3_Err != nil {
@@ -1096,7 +1107,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var53 string
templ_7745c5c3_Var53, templ_7745c5c3_Err = templruntime.NewAttributeExpression("0 0 " + strconv.Itoa(v.Latency.Width) + " " + strconv.Itoa(v.Latency.Height)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 278, Col: 96}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 289, Col: 96}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53)
if templ_7745c5c3_Err != nil {
@@ -1109,7 +1120,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var54 string
templ_7745c5c3_Var54, templ_7745c5c3_Err = templruntime.NewAttributeExpression(v.Latency.Points).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 279, Col: 40}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 290, Col: 40}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var54)
if templ_7745c5c3_Err != nil {
@@ -1145,7 +1156,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var55 string
templ_7745c5c3_Var55, templ_7745c5c3_Err = templ.JoinStringErrs(r.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 289, Col: 38}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 300, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var55))
if templ_7745c5c3_Err != nil {
@@ -1188,7 +1199,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var58 string
templ_7745c5c3_Var58, templ_7745c5c3_Err = templruntime.NewAttributeExpression(partialTitle(ctx, !r.Enough)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 291, Col: 127}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 302, Col: 127}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var58)
if templ_7745c5c3_Err != nil {
@@ -1215,7 +1226,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var59 string
templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.JoinStringErrs(r.Uptime)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 291, Col: 140}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 302, Col: 140}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59))
if templ_7745c5c3_Err != nil {
@@ -1233,7 +1244,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var60 string
templ_7745c5c3_Var60, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.by_region_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 295, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 306, Col: 79}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var60))
if templ_7745c5c3_Err != nil {
@@ -1244,7 +1255,29 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if len(v.Maintenance) > 0 {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = sectionHeading("maintenance.title").Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = maintenanceList(v.Maintenance).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1252,7 +1285,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1261,7 +1294,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
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, 92, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var64 string
templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(e.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 303, Col: 56}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 320, Col: 56}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var65 string
templ_7745c5c3_Var65, templ_7745c5c3_Err = templ.JoinStringErrs(e.Value)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 304, Col: 45}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 321, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var65))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1345,20 +1378,20 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var66 string
templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(v.Uptime90)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 312, Col: 48}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 329, Col: 48}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1366,7 +1399,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1374,12 +1407,12 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, r := range v.Row.Regions {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1387,43 +1420,43 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var67 string
templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(r.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 323, Col: 21}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 340, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var68 string
templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(r.Detail)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 324, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 341, Col: 77}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(v.Incidents) > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1435,12 +1468,12 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 112, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 113, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1448,84 +1481,84 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, r := range v.Recent {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 112, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var69 string
templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.JoinStringErrs(r.Time)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 342, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 359, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 113, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var70 string
templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinStringErrs(r.Region)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 343, Col: 41}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 360, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if r.OK {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, "● ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, "● ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, "● ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "● ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var71 string
templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.JoinStringErrs(r.Latency)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 351, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 368, Col: 60}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var71))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var72 string
templ_7745c5c3_Var72, templ_7745c5c3_Err = templ.JoinStringErrs(r.Detail)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 352, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 369, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var72))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1556,139 +1589,139 @@ func incidentList(rows []IncidentRow, showMonitor bool) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, r := range rows {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if r.Open {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var74 string
templ_7745c5c3_Var74, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.ongoing"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 367, Col: 76}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 384, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var74))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var75 string
templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.resolved"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 369, Col: 63}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 386, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var75))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if showMonitor {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "\" class=\"hover:underline\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var77 string
templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.JoinStringErrs(r.Monitor)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 372, Col: 95}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 389, Col: 95}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var77))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var78 string
templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinStringErrs(r.Started)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 374, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 391, Col: 59}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var78))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var79 string
templ_7745c5c3_Var79, templ_7745c5c3_Err = templ.JoinStringErrs(r.Duration)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 375, Col: 57}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 392, Col: 57}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var79))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(r.Cause) > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var80 string
templ_7745c5c3_Var80, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(r.Cause, " · "))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 378, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 395, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var80))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 137, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1730,20 +1763,20 @@ func IncidentsPage(p Page, me Me, rows []IncidentRow) templ.Component {
return templ_7745c5c3_Err
}
if len(rows) == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 137, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var83 string
templ_7745c5c3_Var83, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.none"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 389, Col: 103}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 406, Col: 103}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var83))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1820,36 +1853,36 @@ func typeFields(typ, current string) templ.Component {
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var84 := templ.GetChildren(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 146, " class=\"mb-2\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1857,7 +1890,7 @@ func typeFields(typ, current string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 147, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1882,95 +1915,95 @@ func numberField(label, name string, value, min, max int, hint string) templ.Com
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 145, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var87 string
templ_7745c5c3_Var87, templ_7745c5c3_Err = templ.JoinStringErrs(label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 443, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 460, Col: 90}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var87))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 146, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 153, "\" class=\"w-40 border border-rule bg-transparent px-2.5 py-1.5 font-mono text-sm outline-none focus:border-ink\"> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if hint != "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 151, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 154, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var92 string
templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.JoinStringErrs(hint)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 454, Col: 53}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 471, Col: 53}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var92))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 152, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 155, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 153, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 156, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2007,115 +2040,115 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 154, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if f.ID == "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 155, "← ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, " ← ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var95 string
templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 463, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 480, Col: 93}
}
_, 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, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- } else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, "← ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var97 string
- templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(f.Name)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 465, Col: 97}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var97))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 159, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+ } else {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "← ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var97 string
+ templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(f.Name)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 482, Col: 97}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var97))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "")
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, p.TitleID))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 468, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 485, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, " class=\"grid max-w-4xl gap-x-12 md:grid-cols-2\">
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2127,20 +2160,20 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "")
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, "groups.group"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 484, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 501, Col: 115}
}
_, 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, 168, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2148,66 +2181,66 @@ func MonitorEditor(p Page, me Me, f MonitorForm) 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, 172, " ")
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, "monitors.type"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 488, Col: 116}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 505, Col: 116}
}
_, 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, 170, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, t := range []string{"http", "tcp", "tls", "dns", "icmp"} {
- 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
}
var templ_7745c5c3_Var104 string
templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.type_"+t))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 491, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 508, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 175, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 178, "")
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, 179, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2215,20 +2248,20 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "
")
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, "monitors.target_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 496, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 513, Col: 82}
}
_, 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, 178, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2244,66 +2277,66 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 179, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var107 string
templ_7745c5c3_Var107, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.method"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 499, Col: 119}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 516, Col: 119}
}
_, 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, 180, " GET GET HEAD ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, ">HEAD ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var108 string
templ_7745c5c3_Var108, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.expect_status"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 506, Col: 126}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 523, Col: 126}
}
_, 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, 185, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 189, "\" class=\"w-full border border-rule bg-transparent px-2.5 py-1.5 font-mono text-sm outline-none focus:border-ink\"> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2341,66 +2374,66 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 190, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var111 string
templ_7745c5c3_Var111, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.dns_record"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 516, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 533, Col: 123}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var111))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 188, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 191, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, r := range []string{"A", "AAAA", "CNAME", "MX", "NS", "TXT"} {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 189, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var113 string
templ_7745c5c3_Var113, templ_7745c5c3_Err = templ.JoinStringErrs(r)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 519, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 536, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var113))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2444,7 +2477,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 198, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2460,74 +2493,74 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var115 string
templ_7745c5c3_Var115, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.regions"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 536, Col: 121}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 553, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var115))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 200, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var116 string
templ_7745c5c3_Var116, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.regions_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 537, Col: 78}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 554, Col: 78}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var116))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 198, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 201, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, r := range f.Regions {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, " class=\"accent-ink\"> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var118 string
templ_7745c5c3_Var118, templ_7745c5c3_Err = templ.JoinStringErrs(r.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 541, Col: 15}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 558, Col: 15}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var118))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 203, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2535,13 +2568,13 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var119 string
templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "regions.own"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 544, Col: 37}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 561, Col: 37}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var119))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2549,36 +2582,36 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var120 string
templ_7745c5c3_Var120, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "regions.platform"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 546, Col: 42}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 563, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var120))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 208, " ")
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, 209, "· ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var121 string
templ_7745c5c3_Var121, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "regions.live", "Count", int(r.Live)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 548, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 565, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, "")
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, 211, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2591,51 +2624,51 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
return templ_7745c5c3_Err
}
if f.ID != "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, "\" data-next=\"/\" class=\"mt-6 text-sm text-down hover:underline\">")
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, "monitors.delete"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 562, Col: 38}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 579, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var124))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 215, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 213, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 216, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2700,12 +2733,12 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
return templ_7745c5c3_Err
}
if len(v.Channels) > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 217, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, ch := range v.Channels {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 215, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2720,149 +2753,149 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 216, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var127 string
templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.JoinStringErrs(ch.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 598, Col: 21}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 615, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var127))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 217, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var128 string
templ_7745c5c3_Var128, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.type_"+ch.Type))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 599, Col: 70}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 616, Col: 70}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var128))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var129 string
templ_7745c5c3_Var129, templ_7745c5c3_Err = templ.JoinStringErrs(ch.Target)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 600, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 617, Col: 77}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var129))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if v.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "\" class=\"text-muted hover:text-ink\">")
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, "channels.test"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 603, Col: 187}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 620, Col: 187}
}
_, 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, 223, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, "\" class=\"text-muted hover:text-down\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var135 string
templ_7745c5c3_Var135, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "regions.delete"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 604, Col: 193}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 621, Col: 193}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var135))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 226, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 229, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 227, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 231, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 229, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if v.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2870,7 +2903,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 231, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2878,7 +2911,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2894,20 +2927,20 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var136 string
templ_7745c5c3_Var136, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.secret_now"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 622, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 639, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var136))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2916,7 +2949,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
return templ_7745c5c3_Err
}
if v.EmailAvailable {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2924,7 +2957,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2932,79 +2965,79 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 237, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 240, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var137 string
templ_7745c5c3_Var137, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.to"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 635, Col: 117}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 652, Col: 117}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var137))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 241, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var138 string
templ_7745c5c3_Var138, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.language"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 639, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 656, Col: 123}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var138))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 242, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, l := range v.Languages {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 240, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var140 string
templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "lang."+l))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 642, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 659, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var140))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 247, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 245, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 248, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3012,30 +3045,30 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 249, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 247, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var141 string
templ_7745c5c3_Var141, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "error.email_not_configured"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 649, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 666, Col: 79}
}
_, 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, 248, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 251, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 249, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 252, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3067,85 +3100,85 @@ func groupSelect(name string, groups []GroupOption, selected string, allowNone b
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "\" data-nullable class=\"w-full border border-rule bg-transparent px-2 py-1.5 text-sm\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if allowNone {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 252, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var144 string
templ_7745c5c3_Var144, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.none"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 660, Col: 48}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 677, Col: 48}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var144))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 253, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
for _, g := range groups {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 260, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var146 string
templ_7745c5c3_Var146, templ_7745c5c3_Err = templ.JoinStringErrs(g.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 663, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 680, Col: 66}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var146))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 258, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 259, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 262, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3200,20 +3233,20 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 260, "← ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, "← ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var149 string
templ_7745c5c3_Var149, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 688, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 705, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var149))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 264, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3222,69 +3255,69 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
return templ_7745c5c3_Err
}
if len(v.Groups) > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 262, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 265, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, g := range v.Groups {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var151 string
templ_7745c5c3_Var151, templ_7745c5c3_Err = templ.JoinStringErrs(g.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 695, Col: 21}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 712, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var151))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 265, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 268, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if g.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 266, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var152 string
templ_7745c5c3_Var152, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "sso.action.edit"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 698, Col: 99}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 715, Col: 99}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var152))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, "\" data-method=\"put\" data-next=\"/groups\" class=\"mt-3 w-72\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3296,20 +3329,20 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 272, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var154 string
templ_7745c5c3_Var154, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.parent"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 703, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 720, Col: 122}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var154))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 270, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3317,7 +3350,7 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 274, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3325,66 +3358,66 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 272, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 277, "\" class=\"mt-4 text-sm text-down hover:underline\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var157 string
templ_7745c5c3_Var157, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.delete"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 708, Col: 200}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 725, Col: 200}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var157))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 275, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 278, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 276, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 279, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 277, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 280, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 278, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 281, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if v.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 279, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3392,7 +3425,7 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 280, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 283, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3404,20 +3437,20 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 281, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 284, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var158 string
templ_7745c5c3_Var158, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.parent"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 723, Col: 117}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 740, Col: 117}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var158))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 285, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3425,7 +3458,7 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 283, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 286, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3433,7 +3466,7 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 284, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 287, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/web/public.go b/internal/web/public.go
index a6789ed..b425727 100644
--- a/internal/web/public.go
+++ b/internal/web/public.go
@@ -19,6 +19,18 @@ type PublicAssets struct {
// "/acme/" or "/" on a custom domain. Empty leaves them out, as in a
// single-file export, which can only link elsewhere.
LegalBase string
+ // Now is the moment the page shows, deciding which maintenance is in
+ // progress.
+ Now time.Time
+}
+
+// Markdown renders src for display, or returns "" when it cannot.
+func Markdown(src string) string {
+ html, err := RenderMarkdown(src)
+ if err != nil {
+ return ""
+ }
+ return html
}
// StylesheetText returns the built stylesheet for inlining.
@@ -49,6 +61,8 @@ func PageStatus(s string) Status {
return StatusDegraded
case agentapi.PageOutage:
return StatusDown
+ case agentapi.PageUnderMaintenance:
+ return StatusMaintenance
}
return StatusUnknown
}
diff --git a/internal/web/public.templ b/internal/web/public.templ
index a4a5066..8094802 100644
--- a/internal/web/public.templ
+++ b/internal/web/public.templ
@@ -1,6 +1,7 @@
package web
import (
+ "strings"
"time"
"git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi"
@@ -35,7 +36,9 @@ templ PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) {
}
{ s.Title }
if s.Description != "" {
- { s.Description }
+
+ @templ.Raw(Markdown(s.Description))
+
}
if !a.StaleSince.IsZero() {
@@ -48,10 +51,12 @@ templ PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) {
templ.KV("border-up", s.Status == agentapi.PageOperational),
templ.KV("border-degraded", s.Status == agentapi.PageDegraded),
templ.KV("border-down", s.Status == agentapi.PageOutage),
- templ.KV("border-unknown", s.Status == agentapi.PageUnknown) }
+ templ.KV("border-unknown", s.Status == agentapi.PageUnknown),
+ templ.KV("border-maintenance", s.Status == agentapi.PageUnderMaintenance) }
>
{ i18n.T(ctx, "page.status."+s.Status) }
+ @pageMaintenance(i18n.T(ctx, "page.maintenance_ongoing"), s.Ongoing(a.Now))
for _, sec := range s.Sections {
if sec.Name != "" {
@@ -76,6 +81,7 @@ templ PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) {
}
+ @pageMaintenance(i18n.T(ctx, "page.maintenance_upcoming"), s.Upcoming(a.Now))
{ i18n.T(ctx, "page.incidents") }
if len(s.Incidents) == 0 {
@@ -115,3 +121,32 @@ templ PublicStatusPage(s agentapi.PageSnapshot, a PublicAssets) {