diff --git a/README.md b/README.md
index 5218746..170e44b 100644
--- a/README.md
+++ b/README.md
@@ -106,6 +106,18 @@ curl -H "Authorization: Bearer ust_…" https://uptime.example.com/api/v1/org/mo
The interactive API documentation is at `/api/docs` of every installation, the OpenAPI 3.1 document at `/api/openapi.json`.
+Alert groups bundle notification channels under **Settings → Notifications**. Assign one or
+more groups in the monitor editor. Each organization has a default group, automatically
+assigned to new monitors and new channels. Existing monitors and channels are migrated
+to that group to preserve delivery. The default group can be renamed and its channels
+changed, but cannot be deleted. A channel in multiple assigned groups receives each
+incident event once. Selecting no groups disables notifications for that monitor.
+
+The API exposes `/api/v1/org/alert-groups` for managing groups and `alert_group_ids`
+on monitor requests and responses. Omit the field when creating a monitor to use the
+default; omit it when updating to preserve assignments. Send `[]` to remove them all.
+Deleting a custom group removes its assignments without assigning a fallback.
+
## Examples
Create a monitor that checks a website from two regions every minute:
diff --git a/internal/api/alert_groups.go b/internal/api/alert_groups.go
new file mode 100644
index 0000000..0b3fc79
--- /dev/null
+++ b/internal/api/alert_groups.go
@@ -0,0 +1,170 @@
+package api
+
+import (
+ "context"
+ "errors"
+ "net/http"
+ "slices"
+ "strings"
+
+ "github.com/gin-gonic/gin"
+ "github.com/google/uuid"
+ "github.com/jackc/pgx/v5"
+
+ "git.zb-server.de/ZB-Server/uptimesebi/internal/store"
+)
+
+type alertGroupRequest struct {
+ Name string `json:"name" binding:"required,max=100"`
+ ChannelIDs []uuid.UUID `json:"channel_ids" binding:"max=200"`
+}
+
+type alertGroupView struct {
+ ID uuid.UUID `json:"id"`
+ Name string `json:"name"`
+ IsDefault bool `json:"is_default"`
+ ChannelIDs []uuid.UUID `json:"channel_ids"`
+}
+
+var errInvalidAlertGroup = errors.New("api: invalid alert group")
+var errInvalidChannel = errors.New("api: invalid notification channel")
+
+func (s *Server) listAlertGroups(c *gin.Context) {
+ ctx := c.Request.Context()
+ out := []alertGroupView{}
+ err := s.db.Tx(ctx, current(c).scope(), func(q *store.Queries) error {
+ rows, err := q.ListAlertGroups(ctx)
+ if err != nil {
+ return err
+ }
+ for _, row := range rows {
+ out = append(out, alertGroupView{ID: row.ID, Name: row.Name, IsDefault: row.IsDefault, ChannelIDs: row.ChannelIds})
+ }
+ return nil
+ })
+ if err != nil {
+ internalError(c, err)
+ return
+ }
+ c.JSON(http.StatusOK, gin.H{"alert_groups": out})
+}
+
+func (s *Server) saveAlertGroup(c *gin.Context) {
+ var req alertGroupRequest
+ if !bind(c, &req) {
+ return
+ }
+ req.Name = strings.TrimSpace(req.Name)
+ if req.Name == "" {
+ fail(c, http.StatusUnprocessableEntity, "invalid_input")
+ return
+ }
+ var id uuid.UUID
+ if c.Param("id") != "" {
+ var err error
+ id, err = uuid.Parse(c.Param("id"))
+ if err != nil {
+ fail(c, http.StatusNotFound, "not_found")
+ return
+ }
+ }
+ ctx := c.Request.Context()
+ p := current(c)
+ var row store.AlertGroup
+ // Stable ordering also avoids deadlocks when concurrent edits share channels.
+ slices.SortFunc(req.ChannelIDs, func(a, b uuid.UUID) int { return strings.Compare(a.String(), b.String()) })
+ req.ChannelIDs = slices.Compact(req.ChannelIDs)
+ err := s.db.Tx(ctx, p.scope(), func(q *store.Queries) error {
+ var err error
+ if c.Param("id") == "" {
+ row, err = q.CreateAlertGroup(ctx, store.CreateAlertGroupParams{OrgID: p.Org.ID, Name: req.Name})
+ } else {
+ row, err = q.UpdateAlertGroup(ctx, store.UpdateAlertGroupParams{ID: id, Name: req.Name})
+ }
+ if err != nil {
+ return err
+ }
+ if err := q.DeleteAlertGroupChannels(ctx, row.ID); err != nil {
+ return err
+ }
+ for _, ch := range req.ChannelIDs {
+ n, err := q.AddAlertGroupChannel(ctx, store.AddAlertGroupChannelParams{OrgID: p.Org.ID, GroupID: row.ID, ChannelID: ch})
+ if err != nil {
+ return err
+ }
+ if n != 1 {
+ return errInvalidChannel
+ }
+ }
+ return nil
+ })
+ if errors.Is(err, pgx.ErrNoRows) {
+ fail(c, http.StatusNotFound, "not_found")
+ return
+ }
+ if errors.Is(err, errInvalidChannel) {
+ fail(c, http.StatusUnprocessableEntity, "invalid_channel")
+ return
+ }
+ if err != nil {
+ internalError(c, err)
+ return
+ }
+ status := http.StatusOK
+ if c.Param("id") == "" {
+ status = http.StatusCreated
+ }
+ if req.ChannelIDs == nil {
+ req.ChannelIDs = []uuid.UUID{}
+ }
+ c.JSON(status, alertGroupView{ID: row.ID, Name: row.Name, IsDefault: row.IsDefault, ChannelIDs: req.ChannelIDs})
+}
+
+func (s *Server) deleteAlertGroup(c *gin.Context) {
+ id, err := uuid.Parse(c.Param("id"))
+ if err != nil {
+ fail(c, http.StatusNotFound, "not_found")
+ return
+ }
+ ctx := c.Request.Context()
+ var n int64
+ err = s.db.Tx(ctx, current(c).scope(), func(q *store.Queries) error {
+ n, err = q.DeleteAlertGroup(ctx, id)
+ return err
+ })
+ if err != nil {
+ internalError(c, err)
+ return
+ }
+ if n == 0 {
+ fail(c, http.StatusNotFound, "alert_group_not_deletable")
+ return
+ }
+ c.Status(http.StatusNoContent)
+}
+
+// setMonitorAlertGroups preserves assignments when ids is omitted. On creation,
+// the database assigns the default group; an explicit empty list opts out.
+func setMonitorAlertGroups(ctx context.Context, q *store.Queries, m store.Monitor, ids []uuid.UUID) error {
+ if ids == nil {
+ return nil
+ }
+ if err := q.DeleteMonitorAlertGroups(ctx, m.ID); err != nil {
+ return err
+ }
+ seen := make(map[uuid.UUID]bool, len(ids))
+ for _, id := range ids {
+ if seen[id] {
+ continue
+ }
+ seen[id] = true
+ n, err := q.AddMonitorAlertGroup(ctx, store.AddMonitorAlertGroupParams{OrgID: m.OrgID, MonitorID: m.ID, GroupID: id})
+ if err != nil {
+ return err
+ }
+ if n != 1 {
+ return errInvalidAlertGroup
+ }
+ }
+ return nil
+}
diff --git a/internal/api/alert_groups_test.go b/internal/api/alert_groups_test.go
new file mode 100644
index 0000000..69d4577
--- /dev/null
+++ b/internal/api/alert_groups_test.go
@@ -0,0 +1,154 @@
+package api_test
+
+import (
+ "net/http"
+ "slices"
+ "strings"
+ "testing"
+)
+
+func TestAlertGroups(t *testing.T) {
+ e := newEnv(t)
+ owner := e.browser(t)
+ owner.signup("o@"+uniq("ag")+".test", uniq("ag-"))
+ groups := func(b *browser) []any {
+ t.Helper()
+ st, body := b.do("GET", "/api/v1/org/alert-groups", nil)
+ if st != http.StatusOK {
+ t.Fatalf("list groups = %d %v", st, body)
+ }
+ return body["alert_groups"].([]any)
+ }
+ initial := groups(owner)
+ if len(initial) != 1 || initial[0].(map[string]any)["is_default"] != true {
+ t.Fatalf("initial groups = %v", initial)
+ }
+ defaultID := initial[0].(map[string]any)["id"].(string)
+ channel := func(b *browser, name string, enabled bool) string {
+ t.Helper()
+ st, body := b.do("POST", "/api/v1/org/channels", map[string]any{"name": name, "type": "webhook", "url": "https://example.test/hook", "enabled": enabled})
+ if st != http.StatusCreated {
+ t.Fatalf("create channel = %d %v", st, body)
+ }
+ return body["channel"].(map[string]any)["id"].(string)
+ }
+ selected := channel(owner, "Selected", true)
+ unselected := channel(owner, "Unselected", true)
+ disabled := channel(owner, "Disabled", false)
+ if got := groups(owner)[0].(map[string]any)["channel_ids"].([]any); len(got) != 3 {
+ t.Fatalf("default channels = %v", got)
+ }
+ group := func(name string, channels []string) string {
+ t.Helper()
+ st, body := owner.do("POST", "/api/v1/org/alert-groups", map[string]any{"name": name, "channel_ids": channels})
+ if st != http.StatusCreated {
+ t.Fatalf("create group = %d %v", st, body)
+ }
+ return body["id"].(string)
+ }
+ a := group("Operations", []string{selected, selected, disabled})
+ b := group("Escalation", []string{selected})
+ monitor := map[string]any{"name": "Backup", "type": "heartbeat", "interval_seconds": 3600}
+ st, body := owner.do("POST", "/api/v1/org/monitors", monitor)
+ if st != http.StatusCreated {
+ t.Fatalf("create monitor = %d %v", st, body)
+ }
+ id := body["id"].(string)
+ token := body["target"].(string)
+ if got := body["alert_group_ids"].([]any); len(got) != 1 || got[0] != defaultID {
+ t.Fatalf("default monitor assignments = %v", got)
+ }
+ st, _, html := owner.page("/monitors/" + id + "/edit")
+ if st != http.StatusOK || !strings.Contains(html, `name="alert_group_ids"`) || !strings.Contains(html, "Operations") {
+ t.Fatalf("monitor editor = %d, lacks alert groups", st)
+ }
+ st, _, html = owner.page("/settings/channels")
+ if st != http.StatusOK || !strings.Contains(html, "/org/alert-groups/"+a) {
+ t.Fatalf("settings = %d, lacks alert group editor", st)
+ }
+ monitor["alert_group_ids"] = []string{a, b, a}
+ st, body = owner.do("PUT", "/api/v1/org/monitors/"+id, monitor)
+ if st != http.StatusOK || len(body["alert_group_ids"].([]any)) != 2 {
+ t.Fatalf("assign groups = %d %v", st, body)
+ }
+ delete(monitor, "alert_group_ids")
+ st, body = owner.do("PUT", "/api/v1/org/monitors/"+id, monitor)
+ if st != http.StatusOK || len(body["alert_group_ids"].([]any)) != 2 {
+ t.Fatalf("preserve assignments = %d %v", st, body)
+ }
+ // Exercise actual incident transitions and their outbox, including recovery.
+ for _, suffix := range []string{"/fail", ""} {
+ resp, err := e.srv.Client().Post(e.srv.URL+"/hb/"+token+suffix, "text/plain", strings.NewReader(""))
+ if err != nil {
+ t.Fatal(err)
+ }
+ _ = resp.Body.Close()
+ if resp.StatusCode != http.StatusOK {
+ t.Fatalf("heartbeat %q = %d", suffix, resp.StatusCode)
+ }
+ }
+ count := func(ch string) int {
+ return e.count(t, `SELECT count(*) FROM notifications n JOIN incidents i ON i.id=n.incident_id WHERE i.monitor_id=$1 AND n.channel_id=$2`, id, ch)
+ }
+ if count(selected) != 2 || count(unselected) != 0 || count(disabled) != 0 {
+ t.Fatalf("deliveries selected/unselected/disabled = %d/%d/%d", count(selected), count(unselected), count(disabled))
+ }
+
+ other := e.browser(t)
+ other.signup("x@"+uniq("ag")+".test", uniq("agx-"))
+ foreignGroup := groups(other)[0].(map[string]any)["id"].(string)
+ foreignChannel := channel(other, "Foreign", true)
+ monitor["alert_group_ids"] = []string{foreignGroup}
+ st, body = owner.do("PUT", "/api/v1/org/monitors/"+id, monitor)
+ expect(t, "foreign monitor assignment", st, body, http.StatusUnprocessableEntity, "invalid_alert_group")
+ st, body = owner.do("POST", "/api/v1/org/monitors", monitor)
+ expect(t, "foreign assignment on creation", st, body, http.StatusUnprocessableEntity, "invalid_alert_group")
+ st, body = owner.do("PUT", "/api/v1/org/alert-groups/"+a, map[string]any{"name": "Changed", "channel_ids": []string{foreignChannel}})
+ expect(t, "foreign channel assignment", st, body, http.StatusUnprocessableEntity, "invalid_channel")
+ st, body = other.do("PUT", "/api/v1/org/alert-groups/"+a, map[string]any{"name": "Stolen"})
+ expect(t, "foreign group update", st, body, http.StatusNotFound, "not_found")
+ for _, g := range groups(owner) {
+ g := g.(map[string]any)
+ if g["id"] == a && (g["name"] != "Operations" || len(g["channel_ids"].([]any)) != 2) {
+ t.Fatalf("failed update changed group: %v", g)
+ }
+ }
+ _, body = owner.do("GET", "/api/v1/org/monitors", nil)
+ monitors := body["monitors"].([]any)
+ if len(monitors) != 1 || len(monitors[0].(map[string]any)["alert_group_ids"].([]any)) != 2 {
+ t.Fatalf("failed assignment changed monitors: %v", monitors)
+ }
+ viewer := e.joinVia(t, owner.invite("v@"+uniq("ag")+".test", owner.roleID("viewer")))
+ st, body = viewer.do("POST", "/api/v1/org/alert-groups", map[string]any{"name": "Forbidden"})
+ expect(t, "viewer creates group", st, body, http.StatusForbidden, "forbidden")
+ st, body = owner.do("DELETE", "/api/v1/org/alert-groups/"+defaultID, nil)
+ expect(t, "protected default", st, body, http.StatusNotFound, "alert_group_not_deletable")
+ st, body = owner.do("PUT", "/api/v1/org/alert-groups/"+defaultID, map[string]any{"name": "Standard", "channel_ids": []string{selected}})
+ if st != http.StatusOK || body["is_default"] != true {
+ t.Fatalf("edit default = %d %v", st, body)
+ }
+ st, body = owner.do("DELETE", "/api/v1/org/alert-groups/"+a, nil)
+ expect(t, "delete custom group", st, body, http.StatusNoContent, "")
+ _, body = owner.do("GET", "/api/v1/org/monitors", nil)
+ assigned := body["monitors"].([]any)[0].(map[string]any)["alert_group_ids"].([]any)
+ if !slices.Equal(assigned, []any{b}) {
+ t.Fatalf("assignments after group deletion = %v", assigned)
+ }
+ monitor["alert_group_ids"] = []string{}
+ st, body = owner.do("PUT", "/api/v1/org/monitors/"+id, monitor)
+ if st != http.StatusOK || len(body["alert_group_ids"].([]any)) != 0 {
+ t.Fatalf("clear assignments = %d %v", st, body)
+ }
+ resp, err := e.srv.Client().Post(e.srv.URL+"/hb/"+token+"/fail", "text/plain", strings.NewReader(""))
+ if err != nil {
+ t.Fatal(err)
+ }
+ _ = resp.Body.Close()
+ if resp.StatusCode != http.StatusOK || count(selected) != 2 {
+ t.Fatalf("unassigned monitor queued notifications, status=%d count=%d", resp.StatusCode, count(selected))
+ }
+ st, body = owner.do("POST", "/api/v1/org/monitors", monitor)
+ if st != http.StatusCreated || len(body["alert_group_ids"].([]any)) != 0 {
+ t.Fatalf("explicit empty creation = %d %v", st, body)
+ }
+}
diff --git a/internal/api/alerting.go b/internal/api/alerting.go
index 8cb27d5..a9034c1 100644
--- a/internal/api/alerting.go
+++ b/internal/api/alerting.go
@@ -61,7 +61,8 @@ func (s *Server) evaluateResults(ctx context.Context, region string, results []a
}
// transition opens or resolves the monitor's incident and queues a
-// notification for every enabled channel of the org, in one transaction.
+// notification for every enabled channel assigned to the monitor, in one
+// transaction.
func (s *Server) transition(ctx context.Context, m store.MonitorsForResultsRow, t evaluate.Transition, at time.Time) error {
return s.db.Tx(ctx, tenant.Org(m.OrgID, uuid.Nil), func(q *store.Queries) error {
var (
@@ -96,7 +97,7 @@ func (s *Server) transition(ctx context.Context, m store.MonitorsForResultsRow,
if err != nil {
return err
}
- channels, err := q.ListEnabledChannelIDs(ctx, m.OrgID)
+ channels, err := q.MonitorChannelIDs(ctx, m.ID)
if err != nil {
return err
}
diff --git a/internal/api/apidocs.go b/internal/api/apidocs.go
index bd168c6..abca9ec 100644
--- a/internal/api/apidocs.go
+++ b/internal/api/apidocs.go
@@ -57,10 +57,11 @@ var endpoints = []endpoint{
description: "Only monitors the caller may read; header values and heartbeat tokens only for those who may change the monitor.",
perm: "monitors.read", resp: obj{"monitors": []monitorView{}}},
{method: "POST", path: "/api/v1/org/monitors", tag: "Monitors", summary: "Create a monitor",
- description: "`type` is one of http, json, prometheus, tcp, tls, dns, icmp, postgres, mysql, mssql, mongodb, redis, mqtt, kafka, rabbitmq, grpc, smtp, radius, snmp, steam, minecraft, docker, heartbeat or alertmanager (GET /api/v1/org/check-types lists those offered); `config` depends on it (see HTTPConfig, JSONConfig, PrometheusConfig, DNSConfig, TLSConfig, DBConfig, BrokerConfig, GRPCConfig, SMTPConfig, RADIUSConfig, SNMPConfig, GameConfig, DockerConfig, HeartbeatConfig, AlertmanagerConfig). Passwords, RADIUS secrets and SNMP communities are stored encrypted and never returned: `secrets_set` names those set, and an update that leaves one empty keeps it. Heartbeat and alertmanager monitors take neither target nor regions; heartbeats return their `ping_url`.",
+ description: "`type` is one of http, json, prometheus, tcp, tls, dns, icmp, postgres, mysql, mssql, mongodb, redis, mqtt, kafka, rabbitmq, grpc, smtp, radius, snmp, steam, minecraft, docker, heartbeat or alertmanager (GET /api/v1/org/check-types lists those offered); `config` depends on it (see HTTPConfig, JSONConfig, PrometheusConfig, DNSConfig, TLSConfig, DBConfig, BrokerConfig, GRPCConfig, SMTPConfig, RADIUSConfig, SNMPConfig, GameConfig, DockerConfig, HeartbeatConfig, AlertmanagerConfig). Passwords, RADIUS secrets and SNMP communities are stored encrypted and never returned: `secrets_set` names those set, and an update that leaves one empty keeps it. Heartbeat and alertmanager monitors take neither target nor regions; heartbeats return their `ping_url`. Omit `alert_group_ids` to assign the default alert group; an empty array disables notifications.",
perm: "monitors.write", req: monitorRequest{}, status: http.StatusCreated, resp: monitorView{}},
{method: "PUT", path: "/api/v1/org/monitors/:id", tag: "Monitors", summary: "Change a monitor", perm: "monitors.write",
- req: monitorRequest{}, resp: monitorView{}},
+ description: "Omitting alert_group_ids preserves existing assignments; an empty array removes all alert groups.",
+ req: monitorRequest{}, resp: monitorView{}},
{method: "DELETE", path: "/api/v1/org/monitors/:id", tag: "Monitors", summary: "Delete a monitor and its history", perm: "monitors.write",
status: http.StatusNoContent},
{method: "GET", path: "/api/v1/org/monitors/:id/evidence", tag: "Monitors", summary: "What checkers saw: captured responses",
@@ -123,10 +124,18 @@ var endpoints = []endpoint{
media: "text/html"},
// Alerting
+ {method: "GET", path: "/api/v1/org/alert-groups", tag: "Alerting", summary: "List alert groups and their channels", perm: "notifications.read",
+ resp: obj{"alert_groups": []alertGroupView{}}},
+ {method: "POST", path: "/api/v1/org/alert-groups", tag: "Alerting", summary: "Create an alert group", perm: "notifications.write",
+ req: alertGroupRequest{}, status: http.StatusCreated, resp: alertGroupView{}},
+ {method: "PUT", path: "/api/v1/org/alert-groups/:id", tag: "Alerting", summary: "Rename an alert group and replace its channels", perm: "notifications.write",
+ req: alertGroupRequest{}, resp: alertGroupView{}},
+ {method: "DELETE", path: "/api/v1/org/alert-groups/:id", tag: "Alerting", summary: "Delete an alert group", perm: "notifications.write",
+ description: "The default group cannot be deleted. Deleting other groups removes their monitor assignments; no fallback group is assigned.", status: http.StatusNoContent},
{method: "GET", path: "/api/v1/org/channels", tag: "Alerting", summary: "List notification channels", perm: "notifications.read",
resp: obj{"channels": []channelView{}, "email_available": false}},
{method: "POST", path: "/api/v1/org/channels", tag: "Alerting", summary: "Create a channel",
- description: "`type` is webhook (`url`), email (`to`, `locale`) or one of slack, discord, teams, googlechat, mattermost, rocketchat, telegram, matrix, ntfy, gotify, pushover, pushbullet, signal, pagerduty, opsgenie, apprise with their `settings`. Secret settings are stored encrypted and never returned; on update, leaving one empty keeps it. Webhook channels return their signing secret once.",
+ description: "`type` is webhook (`url`), email (`to`, `locale`) or one of slack, discord, teams, googlechat, mattermost, rocketchat, telegram, matrix, ntfy, gotify, pushover, pushbullet, signal, pagerduty, opsgenie, apprise with their `settings`. Secret settings are stored encrypted and never returned; on update, leaving one empty keeps it. Webhook channels return their signing secret once. New channels join the default alert group.",
perm: "notifications.write",
req: channelRequest{}, status: http.StatusCreated, resp: obj{"channel": channelView{}, "signing_secret": ""}},
{method: "PUT", path: "/api/v1/org/channels/:id", tag: "Alerting", summary: "Change a channel", perm: "notifications.write",
diff --git a/internal/api/audit.go b/internal/api/audit.go
index 7be7c9a..430730e 100644
--- a/internal/api/audit.go
+++ b/internal/api/audit.go
@@ -26,6 +26,9 @@ import (
// empty name marks a route deliberately not audited. A test fails for
// routes missing here, so new endpoints cannot slip past the log.
var auditActions = map[string]string{
+ "POST /api/v1/org/alert-groups": "alert_group.create",
+ "PUT /api/v1/org/alert-groups/:id": "alert_group.update",
+ "DELETE /api/v1/org/alert-groups/:id": "alert_group.delete",
"POST /api/v1/locale": "",
"POST /api/v1/markdown/preview": "",
"POST /api/v1/auth/signup": "account.signup",
diff --git a/internal/api/console.go b/internal/api/console.go
index fc7595b..9efe8f8 100644
--- a/internal/api/console.go
+++ b/internal/api/console.go
@@ -533,6 +533,24 @@ func (s *Server) monitorEditor(c *gin.Context, p *principal, page web.Page, me w
if regions, err = q.ListVisibleRegions(ctx); err != nil {
return err
}
+ groups, err := q.ListAlertGroups(ctx)
+ if err != nil {
+ return err
+ }
+ var selected []uuid.UUID
+ if idParam != "" {
+ id, err := uuid.Parse(idParam)
+ if err != nil {
+ return pgx.ErrNoRows
+ }
+ selected, err = q.MonitorAlertGroups(ctx, id)
+ if err != nil {
+ return err
+ }
+ }
+ for _, g := range groups {
+ f.AlertGroups = append(f.AlertGroups, web.AlertGroupOption{ID: g.ID.String(), Name: g.Name, Default: g.IsDefault, Checked: slices.Contains(selected, g.ID) || (idParam == "" && g.IsDefault)})
+ }
if idParam == "" {
return nil
}
@@ -747,6 +765,23 @@ func (s *Server) channelsView(c *gin.Context, p *principal, page web.Page, me we
}
v.Channels = append(v.Channels, web.ChannelRow{ID: r.ID.String(), Name: r.Name, Type: r.Type, Target: target, Enabled: r.Enabled})
}
+ err = s.db.Tx(ctx, p.scope(), func(q *store.Queries) error {
+ groups, err := q.ListAlertGroups(ctx)
+ if err != nil {
+ return err
+ }
+ for _, g := range groups {
+ row := web.AlertGroupRow{ID: g.ID.String(), Name: g.Name, Default: g.IsDefault}
+ for _, ch := range rows {
+ row.Channels = append(row.Channels, web.AlertGroupOption{ID: ch.ID.String(), Name: ch.Name, Checked: slices.Contains(g.ChannelIds, ch.ID)})
+ }
+ v.AlertGroups = append(v.AlertGroups, row)
+ }
+ return nil
+ })
+ if err != nil {
+ return nil, err
+ }
return web.ChannelsPage(page, me, v), nil
}
diff --git a/internal/api/gdpr.go b/internal/api/gdpr.go
index b0115fc..fc79a8f 100644
--- a/internal/api/gdpr.go
+++ b/internal/api/gdpr.go
@@ -208,6 +208,7 @@ func (s *Server) sendExport(c *gin.Context, format, name, title string, x any) {
}
type orgExport struct {
+ AlertGroups []alertGroupView `json:"alert_groups"`
GeneratedAt time.Time `json:"generated_at"`
Organization exportOrg `json:"organization"`
Members []exportMember `json:"members"`
@@ -255,6 +256,7 @@ type exportGroup struct {
}
type exportMonitor struct {
+ AlertGroupIDs []uuid.UUID `json:"alert_group_ids"`
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
@@ -391,6 +393,22 @@ func (s *Server) buildOrgExport(ctx context.Context, p *principal) (orgExport, e
x.Groups = append(x.Groups, exportGroup{ID: g.ID, Name: g.Name, ParentID: g.ParentID})
}
+ alertGroups, err := q.ListAlertGroups(ctx)
+ if err != nil {
+ return err
+ }
+ x.AlertGroups = []alertGroupView{}
+ for _, g := range alertGroups {
+ x.AlertGroups = append(x.AlertGroups, alertGroupView{ID: g.ID, Name: g.Name, IsDefault: g.IsDefault, ChannelIDs: g.ChannelIds})
+ }
+ alertAssignments, err := q.AllMonitorAlertGroups(ctx)
+ if err != nil {
+ return err
+ }
+ alertGroupsByMonitor := map[uuid.UUID][]uuid.UUID{}
+ for _, a := range alertAssignments {
+ alertGroupsByMonitor[a.MonitorID] = append(alertGroupsByMonitor[a.MonitorID], a.GroupID)
+ }
regionRows, err := q.AllMonitorRegions(ctx)
if err != nil {
return err
@@ -408,7 +426,8 @@ func (s *Server) buildOrgExport(ctx context.Context, p *principal) (orgExport, e
x.Monitors = append(x.Monitors, exportMonitor{
ID: m.ID, Name: m.Name, Type: m.Type, Target: m.Target, IntervalSeconds: m.IntervalSeconds,
TimeoutMS: m.TimeoutMs, Confirmations: m.Confirmations, Enabled: m.Enabled, GroupID: m.GroupID,
- Regions: orEmpty(regions[m.ID]), Config: rawJSON(first(publicMonitorConfig(m.Config))), CreatedAt: m.CreatedAt,
+ AlertGroupIDs: orEmpty(alertGroupsByMonitor[m.ID]),
+ Regions: orEmpty(regions[m.ID]), Config: rawJSON(first(publicMonitorConfig(m.Config))), CreatedAt: m.CreatedAt,
})
}
diff --git a/internal/api/gdpr_test.go b/internal/api/gdpr_test.go
index 3656cb6..9b215df 100644
--- a/internal/api/gdpr_test.go
+++ b/internal/api/gdpr_test.go
@@ -90,6 +90,20 @@ func TestExports(t *testing.T) {
if st != http.StatusOK {
t.Fatalf("org export = %d", st)
}
+ var org map[string]any
+ if err := json.Unmarshal(raw, &org); err != nil {
+ t.Fatal(err)
+ }
+ groups := org["alert_groups"].([]any)
+ monitors := org["monitors"].([]any)
+ if len(groups) != 1 || len(monitors) != 1 {
+ t.Fatalf("export groups/monitors = %v/%v", groups, monitors)
+ }
+ group := groups[0].(map[string]any)
+ assigned := monitors[0].(map[string]any)["alert_group_ids"].([]any)
+ if group["is_default"] != true || len(group["channel_ids"].([]any)) != 1 || len(assigned) != 1 || assigned[0] != group["id"] {
+ t.Fatalf("export lost alert routing: group=%v assignments=%v", group, assigned)
+ }
if !bytes.Contains(raw, []byte(`"Shop"`)) || !bytes.Contains(raw, []byte(`"Hook"`)) {
t.Errorf("org export lacks monitor or channel")
}
diff --git a/internal/api/monitors.go b/internal/api/monitors.go
index 638ca4b..34d421e 100644
--- a/internal/api/monitors.go
+++ b/internal/api/monitors.go
@@ -36,6 +36,9 @@ type monitorRequest struct {
Confirmations int `json:"confirmations" binding:"min=0,max=10"`
// GroupID places the monitor in a group; nil keeps it at the top level.
GroupID *uuid.UUID `json:"group_id"`
+ // AlertGroupIDs defaults on creation and preserves assignments on update
+ // when omitted. An explicit empty list disables notifications.
+ AlertGroupIDs []uuid.UUID `json:"alert_group_ids" binding:"max=100"`
}
type latestView struct {
@@ -48,6 +51,7 @@ type latestView struct {
}
type monitorView struct {
+ AlertGroupIDs []uuid.UUID `json:"alert_group_ids"`
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
@@ -192,6 +196,14 @@ func (s *Server) listMonitors(c *gin.Context) {
if err != nil {
return err
}
+ assignments, err := q.AllMonitorAlertGroups(ctx)
+ if err != nil {
+ return err
+ }
+ alertGroups := map[uuid.UUID][]uuid.UUID{}
+ for _, a := range assignments {
+ alertGroups[a.MonitorID] = append(alertGroups[a.MonitorID], a.GroupID)
+ }
regions, err := q.AllMonitorRegions(ctx)
if err != nil {
return err
@@ -215,6 +227,10 @@ func (s *Server) listMonitors(c *gin.Context) {
continue
}
v := viewMonitor(m, byMonitor[m.ID])
+ v.AlertGroupIDs = alertGroups[m.ID]
+ if v.AlertGroupIDs == nil {
+ v.AlertGroupIDs = []uuid.UUID{}
+ }
if !canInGroup(p, authz.MonitorsWrite, t, m.GroupID) {
v = redactMonitor(v)
}
@@ -266,8 +282,19 @@ func (s *Server) createMonitor(c *gin.Context) {
if err != nil {
return err
}
+ if err := setMonitorAlertGroups(ctx, q, m, req.AlertGroupIDs); err != nil {
+ return err
+ }
+ req.AlertGroupIDs, err = q.MonitorAlertGroups(ctx, m.ID)
+ if err != nil {
+ return err
+ }
return setRegions(ctx, q, m, req.Regions)
})
+ if errors.Is(err, errInvalidAlertGroup) {
+ fail(c, http.StatusUnprocessableEntity, "invalid_alert_group")
+ return
+ }
if err != nil {
internalError(c, err)
return
@@ -276,7 +303,9 @@ func (s *Server) createMonitor(c *gin.Context) {
internalError(c, err)
return
}
- c.JSON(http.StatusCreated, s.withPingURL(viewMonitor(m, req.Regions)))
+ v := viewMonitor(m, req.Regions)
+ v.AlertGroupIDs = req.AlertGroupIDs
+ c.JSON(http.StatusCreated, s.withPingURL(v))
}
func setRegions(ctx context.Context, q *store.Queries, m store.Monitor, regions []uuid.UUID) error {
@@ -372,8 +401,19 @@ func (s *Server) updateMonitor(c *gin.Context) {
if err != nil {
return err
}
+ if err := setMonitorAlertGroups(ctx, q, m, req.AlertGroupIDs); err != nil {
+ return err
+ }
+ req.AlertGroupIDs, err = q.MonitorAlertGroups(ctx, m.ID)
+ if err != nil {
+ return err
+ }
return setRegions(ctx, q, m, req.Regions)
})
+ if errors.Is(err, errInvalidAlertGroup) {
+ fail(c, http.StatusUnprocessableEntity, "invalid_alert_group")
+ return
+ }
if errors.Is(err, errCheckTypeDisabled) {
fail(c, http.StatusUnprocessableEntity, "check_type_disabled")
return
@@ -390,7 +430,9 @@ func (s *Server) updateMonitor(c *gin.Context) {
internalError(c, err)
return
}
- c.JSON(http.StatusOK, s.withPingURL(viewMonitor(m, req.Regions)))
+ v := viewMonitor(m, req.Regions)
+ v.AlertGroupIDs = req.AlertGroupIDs
+ c.JSON(http.StatusOK, s.withPingURL(v))
}
func (s *Server) deleteMonitor(c *gin.Context) {
diff --git a/internal/api/server.go b/internal/api/server.go
index 72900d4..568b2fb 100644
--- a/internal/api/server.go
+++ b/internal/api/server.go
@@ -190,6 +190,10 @@ func (s *Server) Mount(r gin.IRouter) {
org.GET("/incidents", can(authz.IncidentsRead), s.listIncidents)
org.GET("/audit", can(authz.AuditRead), s.listOrgAudit)
+ org.GET("/alert-groups", can(authz.NotificationsRead), s.listAlertGroups)
+ org.POST("/alert-groups", can(authz.NotificationsWrite), s.saveAlertGroup)
+ org.PUT("/alert-groups/:id", can(authz.NotificationsWrite), s.saveAlertGroup)
+ org.DELETE("/alert-groups/:id", can(authz.NotificationsWrite), s.deleteAlertGroup)
org.GET("/channels", can(authz.NotificationsRead), s.listChannels)
org.POST("/channels", can(authz.NotificationsWrite), s.createChannel)
org.PUT("/channels/:id", can(authz.NotificationsWrite), s.updateChannel)
diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json
index d073a72..fc30198 100644
--- a/internal/i18n/locales/de.json
+++ b/internal/i18n/locales/de.json
@@ -18,6 +18,15 @@
"agents.region": "Region",
"agents.revoke_confirm": "Diesen Agent widerrufen? Seine Instanzen hören sofort auf zu arbeiten.",
"agents.token_now": "Kopiere den Token jetzt und setze ihn als UPTIME_AGENT_TOKEN. Er wird nicht erneut angezeigt. Beliebig viele Instanzen können ihn teilen.",
+ "alert_groups.create": "Gruppe erstellen",
+ "alert_groups.default": "Standardgruppe",
+ "alert_groups.delete_confirm": "Diese Alertgruppe löschen? Ihre Monitore benachrichtigen diese Kanäle dann nur noch, wenn eine andere zugeordnete Gruppe sie enthält.",
+ "alert_groups.intro": "Bündele Benachrichtigungskanäle und ordne die Gruppen Monitoren zu. Neue Monitore und Kanäle werden automatisch der Standardgruppe zugeordnet. Kanäle in mehreren Gruppen erhalten jeden Alert nur einmal.",
+ "alert_groups.monitor_hint": "Wähle die Gruppen, die Alerts erhalten sollen. Ohne Auswahl werden für diesen Monitor keine Benachrichtigungen verschickt.",
+ "alert_groups.new": "Neue Alertgruppe",
+ "alert_groups.no_channels": "Erstelle unten einen Benachrichtigungskanal, um Alerts zu erhalten.",
+ "alert_groups.save": "Gruppe speichern",
+ "alert_groups.title": "Alertgruppen",
"alertmanager.config_hint": "Trage sie als Webhook-Empfänger in die alertmanager.yml ein; send_resolved ist nötig, damit Monitore wieder hochgehen.",
"alertmanager.copy_now": "Kopiere die URL jetzt, sie wird nicht erneut angezeigt. Sie enthält ein Geheimnis.",
"alertmanager.create_monitor": "Monitor anlegen",
@@ -43,6 +52,9 @@
"audit.action.agent.create": "Agent erstellt",
"audit.action.agent.delete": "Agent widerrufen",
"audit.action.agent.update": "Agent geändert",
+ "audit.action.alert_group.create": "Alertgruppe erstellt",
+ "audit.action.alert_group.delete": "Alertgruppe gelöscht",
+ "audit.action.alert_group.update": "Alertgruppe geändert",
"audit.action.alertmanager.receiver_create": "Alertmanager-Empfänger angelegt",
"audit.action.alertmanager.receiver_delete": "Alertmanager-Empfänger gelöscht",
"audit.action.auth.login": "Angemeldet",
@@ -259,7 +271,7 @@
"channels.help_splunk": "Der REST-Endpunkt aus der REST-Integration von Splunk On-Call, mit dem Routing-Key am Ende.",
"channels.help_teams": "Nutze die URL eines Teams-Workflows „Bei Empfang einer Webhookanforderung in einem Kanal posten“.",
"channels.help_telegram": "Lege mit @BotFather einen Bot an; die Chat-ID einer Gruppe beginnt mit -100.",
- "channels.intro": "Jeder aktive Kanal wird benachrichtigt, wenn ein Monitor in allen seinen Regionen ausfällt und wenn er sich erholt.",
+ "channels.intro": "Aktivierte Kanäle erhalten Ausfall- und Entwarnungsmeldungen von Monitoren, die ihren Alertgruppen zugeordnet sind.",
"channels.language": "Sprache",
"channels.new_email": "Neuer E-Mail-Kanal",
"channels.new_service": "Weitere Dienste",
@@ -432,6 +444,7 @@
"email.test.body": "Dies ist ein Test. Wenn du ihn lesen kannst, funktioniert der Kanal.",
"email.test.subject": "Testbenachrichtigung von UptimeSebi",
"error.agent_protocol_unsupported": "Diese Agent-Version wird von der API nicht unterstützt. Bitte den Agent aktualisieren.",
+ "error.alert_group_not_deletable": "Die Gruppe existiert nicht oder ist die geschützte Standardgruppe.",
"error.all_check_types_disabled": "Lass mindestens einen Check-Typ eingeschaltet.",
"error.already_assigned": "Das Mitglied hat diese Rolle bereits.",
"error.already_member": "Diese Person ist bereits Mitglied.",
@@ -447,10 +460,12 @@
"error.group_cycle": "Eine Gruppe kann nicht in sich selbst oder eine ihrer Untergruppen verschoben werden.",
"error.group_too_deep": "Gruppen lassen sich höchstens acht Ebenen tief verschachteln.",
"error.internal": "Interner Fehler.",
+ "error.invalid_alert_group": "Eine Alertgruppe existiert nicht in dieser Organisation.",
"error.invalid_assertion_op": "Unbekannter Operator.",
"error.invalid_assertion_path": "Ein Pfad ist ungültig. Nutze durch Punkte getrennte Schlüssel und [n] für Array-Elemente.",
"error.invalid_assertion_value": "Vergleiche mit <, >, ≤ und ≥ brauchen eine Zahl.",
"error.invalid_assertions": "Lege 1 bis 10 Bedingungen an.",
+ "error.invalid_channel": "Ein Benachrichtigungskanal existiert nicht in dieser Organisation.",
"error.invalid_channel_settings": "Fülle die Pflichtfelder aus; Adressen müssen https-URLs sein.",
"error.invalid_code": "Code ungültig.",
"error.invalid_config": "Die Check-Einstellungen sind ungültig.",
diff --git a/internal/i18n/locales/en.json b/internal/i18n/locales/en.json
index 37cfc64..26f66b0 100644
--- a/internal/i18n/locales/en.json
+++ b/internal/i18n/locales/en.json
@@ -18,6 +18,15 @@
"agents.region": "Region",
"agents.revoke_confirm": "Revoke this agent? Its instances stop working immediately.",
"agents.token_now": "Copy the token now and set it as UPTIME_AGENT_TOKEN. It will not be shown again. Any number of instances may share it.",
+ "alert_groups.create": "Create group",
+ "alert_groups.default": "Default group",
+ "alert_groups.delete_confirm": "Delete this alert group? Its monitors will no longer notify its channels unless another assigned group includes them.",
+ "alert_groups.intro": "Bundle notification channels and assign groups to monitors. New monitors and channels are automatically assigned to the default group. Channels shared by several groups receive each alert only once.",
+ "alert_groups.monitor_hint": "Select the groups that should receive alerts. No selection disables notifications for this monitor.",
+ "alert_groups.new": "New alert group",
+ "alert_groups.no_channels": "Create a notification channel below to receive alerts.",
+ "alert_groups.save": "Save group",
+ "alert_groups.title": "Alert groups",
"alertmanager.config_hint": "Add it to alertmanager.yml as a webhook receiver; send_resolved is needed so monitors recover.",
"alertmanager.copy_now": "Copy the URL now; it is not shown again. It contains a secret.",
"alertmanager.create_monitor": "Create monitor",
@@ -43,6 +52,9 @@
"audit.action.agent.create": "Agent created",
"audit.action.agent.delete": "Agent revoked",
"audit.action.agent.update": "Agent changed",
+ "audit.action.alert_group.create": "Alert group created",
+ "audit.action.alert_group.delete": "Alert group deleted",
+ "audit.action.alert_group.update": "Alert group changed",
"audit.action.alertmanager.receiver_create": "Alertmanager receiver created",
"audit.action.alertmanager.receiver_delete": "Alertmanager receiver deleted",
"audit.action.auth.login": "Signed in",
@@ -259,7 +271,7 @@
"channels.help_splunk": "The REST endpoint from Splunk On-Call's REST integration, ending in the routing key.",
"channels.help_teams": "Use the URL of a Teams workflow \"Post to a channel when a webhook request is received\".",
"channels.help_telegram": "Create a bot with @BotFather; the chat ID of a group starts with -100.",
- "channels.intro": "Every enabled channel is notified when a monitor goes down in all of its regions and when it recovers.",
+ "channels.intro": "Enabled channels receive outage and recovery alerts from monitors assigned to their alert groups.",
"channels.language": "Language",
"channels.new_email": "New email channel",
"channels.new_service": "Other services",
@@ -432,6 +444,7 @@
"email.test.body": "This is a test. If you can read it, the channel works.",
"email.test.subject": "Test notification from UptimeSebi",
"error.agent_protocol_unsupported": "This agent version is not supported by the API. Please update the agent.",
+ "error.alert_group_not_deletable": "The group does not exist or is the protected default group.",
"error.all_check_types_disabled": "Leave at least one check type on.",
"error.already_assigned": "The member already has this role.",
"error.already_member": "This person is already a member.",
@@ -447,10 +460,12 @@
"error.group_cycle": "A group cannot be placed inside itself or one of its subgroups.",
"error.group_too_deep": "Groups can be nested at most eight levels deep.",
"error.internal": "Internal error.",
+ "error.invalid_alert_group": "An alert group does not exist in this organization.",
"error.invalid_assertion_op": "Unknown condition operator.",
"error.invalid_assertion_path": "A condition path is invalid. Use keys separated by dots and [n] for array elements.",
"error.invalid_assertion_value": "Comparisons with <, >, ≤ and ≥ need a number.",
"error.invalid_assertions": "Add between 1 and 10 conditions.",
+ "error.invalid_channel": "A notification channel does not exist in this organization.",
"error.invalid_channel_settings": "Fill in the required fields; addresses must be https URLs.",
"error.invalid_code": "Invalid code.",
"error.invalid_config": "The check settings are not valid.",
diff --git a/internal/migrations/alert_groups_test.go b/internal/migrations/alert_groups_test.go
new file mode 100644
index 0000000..e0be053
--- /dev/null
+++ b/internal/migrations/alert_groups_test.go
@@ -0,0 +1,72 @@
+package migrations
+
+import (
+ "context"
+ "os"
+ "strings"
+ "testing"
+
+ "github.com/google/uuid"
+ "github.com/jackc/pgx/v5"
+)
+
+func TestAlertGroupsBackfill(t *testing.T) {
+ dsn := os.Getenv("UPTIME_TEST_DATABASE_URL")
+ if dsn == "" {
+ t.Skip("UPTIME_TEST_DATABASE_URL not set")
+ }
+ ctx := context.Background()
+ if _, err := Up(ctx, dsn); err != nil {
+ t.Fatal(err)
+ }
+ conn, err := pgx.Connect(ctx, dsn)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer func() { _ = conn.Close(ctx) }()
+ tx, err := conn.Begin(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ // Exercise both directions inside a transaction; existing test data and
+ // goose's migration history remain unchanged after rollback.
+ defer func() { _ = tx.Rollback(ctx) }()
+ if _, err := tx.Exec(ctx, "SET LOCAL app.scope = 'system'"); err != nil {
+ t.Fatal(err)
+ }
+ raw, err := files.ReadFile("sql/00039_alert_groups.sql")
+ if err != nil {
+ t.Fatal(err)
+ }
+ up, down, ok := strings.Cut(string(raw), "-- +goose Down")
+ if !ok {
+ t.Fatal("missing down migration")
+ }
+ if _, err := tx.Exec(ctx, down); err != nil {
+ t.Fatalf("down: %v", err)
+ }
+ orgID := uuid.New()
+ if _, err := tx.Exec(ctx, `INSERT INTO orgs (id,slug,name) VALUES ($1,$2,'Existing organization')`, orgID, "migration-"+orgID.String()); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := tx.Exec(ctx, `INSERT INTO monitors (org_id,name,type,target,interval_seconds,timeout_ms) VALUES ($1,'Existing monitor','tcp','example.test:443',60,1000)`, orgID); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := tx.Exec(ctx, `INSERT INTO notification_channels (org_id,name,type,config) VALUES ($1,'Existing channel','webhook','{}')`, orgID); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := tx.Exec(ctx, up); err != nil {
+ t.Fatalf("up: %v", err)
+ }
+ var groups, monitors, channels int
+ err = tx.QueryRow(ctx, `SELECT
+ (SELECT count(*) FROM alert_groups WHERE org_id=$1 AND is_default),
+ (SELECT count(*) FROM monitor_alert_groups WHERE org_id=$1),
+ (SELECT count(*) FROM alert_group_channels WHERE org_id=$1)`, orgID).Scan(&groups, &monitors, &channels)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if groups != 1 || monitors != 1 || channels != 1 {
+ t.Fatalf("backfilled groups/monitors/channels = %d/%d/%d, want 1/1/1", groups, monitors, channels)
+ }
+}
diff --git a/internal/migrations/sql/00039_alert_groups.sql b/internal/migrations/sql/00039_alert_groups.sql
new file mode 100644
index 0000000..f2d9097
--- /dev/null
+++ b/internal/migrations/sql/00039_alert_groups.sql
@@ -0,0 +1,78 @@
+-- +goose Up
+CREATE TABLE alert_groups (
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
+ org_id uuid NOT NULL REFERENCES orgs (id) ON DELETE CASCADE,
+ name text NOT NULL CHECK (length(name) BETWEEN 1 AND 100),
+ is_default boolean NOT NULL DEFAULT false,
+ UNIQUE (id, org_id)
+);
+CREATE UNIQUE INDEX alert_groups_default_idx ON alert_groups (org_id) WHERE is_default;
+ALTER TABLE notification_channels ADD UNIQUE (id, org_id);
+CREATE TABLE alert_group_channels (
+ org_id uuid NOT NULL REFERENCES orgs (id) ON DELETE CASCADE,
+ group_id uuid NOT NULL,
+ channel_id uuid NOT NULL,
+ PRIMARY KEY (group_id, channel_id),
+ FOREIGN KEY (group_id, org_id) REFERENCES alert_groups (id, org_id) ON DELETE CASCADE,
+ FOREIGN KEY (channel_id, org_id) REFERENCES notification_channels (id, org_id) ON DELETE CASCADE
+);
+CREATE TABLE monitor_alert_groups (
+ org_id uuid NOT NULL REFERENCES orgs (id) ON DELETE CASCADE,
+ monitor_id uuid NOT NULL,
+ group_id uuid NOT NULL,
+ PRIMARY KEY (monitor_id, group_id),
+ FOREIGN KEY (monitor_id, org_id) REFERENCES monitors (id, org_id) ON DELETE CASCADE,
+ FOREIGN KEY (group_id, org_id) REFERENCES alert_groups (id, org_id) ON DELETE CASCADE
+);
+CREATE INDEX monitor_alert_groups_group_idx ON monitor_alert_groups (group_id);
+CREATE INDEX alert_group_channels_channel_idx ON alert_group_channels (channel_id);
+
+INSERT INTO alert_groups (org_id, name, is_default) SELECT id, 'Default', true FROM orgs;
+INSERT INTO alert_group_channels (org_id, group_id, channel_id)
+SELECT c.org_id, g.id, c.id FROM notification_channels c JOIN alert_groups g ON g.org_id = c.org_id AND g.is_default;
+INSERT INTO monitor_alert_groups (org_id, monitor_id, group_id)
+SELECT m.org_id, m.id, g.id FROM monitors m JOIN alert_groups g ON g.org_id = m.org_id AND g.is_default;
+
+-- Defaults apply to every creation path, including CLI and imports.
+-- +goose StatementBegin
+CREATE FUNCTION alert_groups_defaults() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ IF TG_TABLE_NAME = 'orgs' THEN
+ INSERT INTO alert_groups (org_id, name, is_default) VALUES (NEW.id, 'Default', true);
+ ELSIF TG_TABLE_NAME = 'monitors' THEN
+ INSERT INTO monitor_alert_groups (org_id, monitor_id, group_id)
+ SELECT NEW.org_id, NEW.id, id FROM alert_groups WHERE org_id = NEW.org_id AND is_default;
+ ELSE
+ INSERT INTO alert_group_channels (org_id, group_id, channel_id)
+ SELECT NEW.org_id, id, NEW.id FROM alert_groups WHERE org_id = NEW.org_id AND is_default;
+ END IF;
+ RETURN NEW;
+END
+$$;
+-- +goose StatementEnd
+CREATE TRIGGER org_alert_group AFTER INSERT ON orgs FOR EACH ROW EXECUTE FUNCTION alert_groups_defaults();
+CREATE TRIGGER monitor_alert_group AFTER INSERT ON monitors FOR EACH ROW EXECUTE FUNCTION alert_groups_defaults();
+CREATE TRIGGER channel_alert_group AFTER INSERT ON notification_channels FOR EACH ROW EXECUTE FUNCTION alert_groups_defaults();
+
+ALTER TABLE alert_groups ENABLE ROW LEVEL SECURITY;
+ALTER TABLE alert_groups FORCE ROW LEVEL SECURITY;
+CREATE POLICY alert_groups_tenant ON alert_groups FOR ALL
+USING (app_scope_system() OR org_id = app_org_id()) WITH CHECK (app_scope_system() OR org_id = app_org_id());
+ALTER TABLE alert_group_channels ENABLE ROW LEVEL SECURITY;
+ALTER TABLE alert_group_channels FORCE ROW LEVEL SECURITY;
+CREATE POLICY alert_group_channels_tenant ON alert_group_channels FOR ALL
+USING (app_scope_system() OR org_id = app_org_id()) WITH CHECK (app_scope_system() OR org_id = app_org_id());
+ALTER TABLE monitor_alert_groups ENABLE ROW LEVEL SECURITY;
+ALTER TABLE monitor_alert_groups FORCE ROW LEVEL SECURITY;
+CREATE POLICY monitor_alert_groups_tenant ON monitor_alert_groups FOR ALL
+USING (app_scope_system() OR org_id = app_org_id()) WITH CHECK (app_scope_system() OR org_id = app_org_id());
+
+-- +goose Down
+DROP TRIGGER channel_alert_group ON notification_channels;
+DROP TRIGGER monitor_alert_group ON monitors;
+DROP TRIGGER org_alert_group ON orgs;
+DROP FUNCTION alert_groups_defaults();
+DROP TABLE monitor_alert_groups;
+DROP TABLE alert_group_channels;
+DROP TABLE alert_groups;
+ALTER TABLE notification_channels DROP CONSTRAINT notification_channels_id_org_id_key;
diff --git a/internal/store/alert_groups.sql.go b/internal/store/alert_groups.sql.go
new file mode 100644
index 0000000..b39a4cb
--- /dev/null
+++ b/internal/store/alert_groups.sql.go
@@ -0,0 +1,240 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+// sqlc v1.31.1
+// source: alert_groups.sql
+
+package store
+
+import (
+ "context"
+
+ "github.com/google/uuid"
+)
+
+const addAlertGroupChannel = `-- name: AddAlertGroupChannel :execrows
+INSERT INTO alert_group_channels (org_id, group_id, channel_id)
+SELECT c.org_id, $1, c.id FROM notification_channels c
+WHERE c.id = $2 AND c.org_id = $3
+ON CONFLICT DO NOTHING
+`
+
+type AddAlertGroupChannelParams struct {
+ GroupID uuid.UUID
+ ChannelID uuid.UUID
+ OrgID uuid.UUID
+}
+
+func (q *Queries) AddAlertGroupChannel(ctx context.Context, arg AddAlertGroupChannelParams) (int64, error) {
+ result, err := q.db.Exec(ctx, addAlertGroupChannel, arg.GroupID, arg.ChannelID, arg.OrgID)
+ if err != nil {
+ return 0, err
+ }
+ return result.RowsAffected(), nil
+}
+
+const addMonitorAlertGroup = `-- name: AddMonitorAlertGroup :execrows
+INSERT INTO monitor_alert_groups (org_id, monitor_id, group_id)
+SELECT g.org_id, $1, g.id FROM alert_groups g
+WHERE g.id = $2 AND g.org_id = $3
+ON CONFLICT DO NOTHING
+`
+
+type AddMonitorAlertGroupParams struct {
+ MonitorID uuid.UUID
+ GroupID uuid.UUID
+ OrgID uuid.UUID
+}
+
+func (q *Queries) AddMonitorAlertGroup(ctx context.Context, arg AddMonitorAlertGroupParams) (int64, error) {
+ result, err := q.db.Exec(ctx, addMonitorAlertGroup, arg.MonitorID, arg.GroupID, arg.OrgID)
+ if err != nil {
+ return 0, err
+ }
+ return result.RowsAffected(), nil
+}
+
+const allMonitorAlertGroups = `-- name: AllMonitorAlertGroups :many
+SELECT org_id, monitor_id, group_id FROM monitor_alert_groups ORDER BY monitor_id, group_id
+`
+
+func (q *Queries) AllMonitorAlertGroups(ctx context.Context) ([]MonitorAlertGroup, error) {
+ rows, err := q.db.Query(ctx, allMonitorAlertGroups)
+ if err != nil {
+ return nil, err
+ }
+ defer rows.Close()
+ items := []MonitorAlertGroup{}
+ for rows.Next() {
+ var i MonitorAlertGroup
+ if err := rows.Scan(&i.OrgID, &i.MonitorID, &i.GroupID); err != nil {
+ return nil, err
+ }
+ items = append(items, i)
+ }
+ if err := rows.Err(); err != nil {
+ return nil, err
+ }
+ return items, nil
+}
+
+const createAlertGroup = `-- name: CreateAlertGroup :one
+INSERT INTO alert_groups (org_id, name) VALUES ($1, $2) RETURNING id, org_id, name, is_default
+`
+
+type CreateAlertGroupParams struct {
+ OrgID uuid.UUID
+ Name string
+}
+
+func (q *Queries) CreateAlertGroup(ctx context.Context, arg CreateAlertGroupParams) (AlertGroup, error) {
+ row := q.db.QueryRow(ctx, createAlertGroup, arg.OrgID, arg.Name)
+ var i AlertGroup
+ err := row.Scan(
+ &i.ID,
+ &i.OrgID,
+ &i.Name,
+ &i.IsDefault,
+ )
+ return i, err
+}
+
+const deleteAlertGroup = `-- name: DeleteAlertGroup :execrows
+DELETE FROM alert_groups WHERE id = $1 AND NOT is_default
+`
+
+func (q *Queries) DeleteAlertGroup(ctx context.Context, id uuid.UUID) (int64, error) {
+ result, err := q.db.Exec(ctx, deleteAlertGroup, id)
+ if err != nil {
+ return 0, err
+ }
+ return result.RowsAffected(), nil
+}
+
+const deleteAlertGroupChannels = `-- name: DeleteAlertGroupChannels :exec
+DELETE FROM alert_group_channels WHERE group_id = $1
+`
+
+func (q *Queries) DeleteAlertGroupChannels(ctx context.Context, groupID uuid.UUID) error {
+ _, err := q.db.Exec(ctx, deleteAlertGroupChannels, groupID)
+ return err
+}
+
+const deleteMonitorAlertGroups = `-- name: DeleteMonitorAlertGroups :exec
+DELETE FROM monitor_alert_groups WHERE monitor_id = $1
+`
+
+func (q *Queries) DeleteMonitorAlertGroups(ctx context.Context, monitorID uuid.UUID) error {
+ _, err := q.db.Exec(ctx, deleteMonitorAlertGroups, monitorID)
+ return err
+}
+
+const listAlertGroups = `-- name: ListAlertGroups :many
+SELECT g.id, g.org_id, g.name, g.is_default, ARRAY(SELECT c.channel_id FROM alert_group_channels c WHERE c.group_id = g.id ORDER BY c.channel_id)::uuid[] AS channel_ids
+FROM alert_groups g ORDER BY g.is_default DESC, g.name, g.id
+`
+
+type ListAlertGroupsRow struct {
+ ID uuid.UUID
+ OrgID uuid.UUID
+ Name string
+ IsDefault bool
+ ChannelIds []uuid.UUID
+}
+
+func (q *Queries) ListAlertGroups(ctx context.Context) ([]ListAlertGroupsRow, error) {
+ rows, err := q.db.Query(ctx, listAlertGroups)
+ if err != nil {
+ return nil, err
+ }
+ defer rows.Close()
+ items := []ListAlertGroupsRow{}
+ for rows.Next() {
+ var i ListAlertGroupsRow
+ if err := rows.Scan(
+ &i.ID,
+ &i.OrgID,
+ &i.Name,
+ &i.IsDefault,
+ &i.ChannelIds,
+ ); err != nil {
+ return nil, err
+ }
+ items = append(items, i)
+ }
+ if err := rows.Err(); err != nil {
+ return nil, err
+ }
+ return items, nil
+}
+
+const monitorAlertGroups = `-- name: MonitorAlertGroups :many
+SELECT group_id FROM monitor_alert_groups WHERE monitor_id = $1 ORDER BY group_id
+`
+
+func (q *Queries) MonitorAlertGroups(ctx context.Context, monitorID uuid.UUID) ([]uuid.UUID, error) {
+ rows, err := q.db.Query(ctx, monitorAlertGroups, monitorID)
+ if err != nil {
+ return nil, err
+ }
+ defer rows.Close()
+ items := []uuid.UUID{}
+ for rows.Next() {
+ var group_id uuid.UUID
+ if err := rows.Scan(&group_id); err != nil {
+ return nil, err
+ }
+ items = append(items, group_id)
+ }
+ if err := rows.Err(); err != nil {
+ return nil, err
+ }
+ return items, nil
+}
+
+const monitorChannelIDs = `-- name: MonitorChannelIDs :many
+SELECT DISTINCT c.id FROM notification_channels c
+JOIN alert_group_channels gc ON gc.channel_id = c.id AND gc.org_id = c.org_id
+JOIN monitor_alert_groups mg ON mg.group_id = gc.group_id AND mg.org_id = gc.org_id
+WHERE mg.monitor_id = $1 AND c.enabled
+`
+
+func (q *Queries) MonitorChannelIDs(ctx context.Context, monitorID uuid.UUID) ([]uuid.UUID, error) {
+ rows, err := q.db.Query(ctx, monitorChannelIDs, monitorID)
+ if err != nil {
+ return nil, err
+ }
+ defer rows.Close()
+ items := []uuid.UUID{}
+ for rows.Next() {
+ var id uuid.UUID
+ if err := rows.Scan(&id); err != nil {
+ return nil, err
+ }
+ items = append(items, id)
+ }
+ if err := rows.Err(); err != nil {
+ return nil, err
+ }
+ return items, nil
+}
+
+const updateAlertGroup = `-- name: UpdateAlertGroup :one
+UPDATE alert_groups SET name = $2 WHERE id = $1 RETURNING id, org_id, name, is_default
+`
+
+type UpdateAlertGroupParams struct {
+ ID uuid.UUID
+ Name string
+}
+
+func (q *Queries) UpdateAlertGroup(ctx context.Context, arg UpdateAlertGroupParams) (AlertGroup, error) {
+ row := q.db.QueryRow(ctx, updateAlertGroup, arg.ID, arg.Name)
+ var i AlertGroup
+ err := row.Scan(
+ &i.ID,
+ &i.OrgID,
+ &i.Name,
+ &i.IsDefault,
+ )
+ return i, err
+}
diff --git a/internal/store/incidents.sql.go b/internal/store/incidents.sql.go
index e5b6202..fdc24f4 100644
--- a/internal/store/incidents.sql.go
+++ b/internal/store/incidents.sql.go
@@ -241,30 +241,6 @@ func (q *Queries) ListChannels(ctx context.Context) ([]NotificationChannel, erro
return items, nil
}
-const listEnabledChannelIDs = `-- name: ListEnabledChannelIDs :many
-SELECT id FROM notification_channels WHERE org_id = $1 AND enabled
-`
-
-func (q *Queries) ListEnabledChannelIDs(ctx context.Context, orgID uuid.UUID) ([]uuid.UUID, error) {
- rows, err := q.db.Query(ctx, listEnabledChannelIDs, orgID)
- if err != nil {
- return nil, err
- }
- defer rows.Close()
- items := []uuid.UUID{}
- for rows.Next() {
- var id uuid.UUID
- if err := rows.Scan(&id); err != nil {
- return nil, err
- }
- items = append(items, id)
- }
- if err := rows.Err(); err != nil {
- return nil, err
- }
- return items, nil
-}
-
const listIncidents = `-- name: ListIncidents :many
SELECT i.id, i.org_id, i.monitor_id, i.started_at, i.resolved_at, i.cause, m.name AS monitor_name
FROM incidents i
diff --git a/internal/store/models.go b/internal/store/models.go
index 2dfbede..fcce215 100644
--- a/internal/store/models.go
+++ b/internal/store/models.go
@@ -41,6 +41,19 @@ type AgentStorage struct {
Modified time.Time
}
+type AlertGroup struct {
+ ID uuid.UUID
+ OrgID uuid.UUID
+ Name string
+ IsDefault bool
+}
+
+type AlertGroupChannel struct {
+ OrgID uuid.UUID
+ GroupID uuid.UUID
+ ChannelID uuid.UUID
+}
+
type AlertmanagerAlert struct {
OrgID uuid.UUID
Fingerprint string
@@ -214,6 +227,12 @@ type Monitor struct {
GroupID *uuid.UUID
}
+type MonitorAlertGroup struct {
+ OrgID uuid.UUID
+ MonitorID uuid.UUID
+ GroupID uuid.UUID
+}
+
type MonitorGroup struct {
ID uuid.UUID
OrgID uuid.UUID
diff --git a/internal/store/querier.go b/internal/store/querier.go
index 861630a..d82c260 100644
--- a/internal/store/querier.go
+++ b/internal/store/querier.go
@@ -13,8 +13,10 @@ import (
type Querier interface {
APITokenOrg(ctx context.Context, hash []byte) (uuid.UUID, error)
+ AddAlertGroupChannel(ctx context.Context, arg AddAlertGroupChannelParams) (int64, error)
AddMaintenanceTarget(ctx context.Context, arg AddMaintenanceTargetParams) error
AddMembership(ctx context.Context, arg AddMembershipParams) error
+ AddMonitorAlertGroup(ctx context.Context, arg AddMonitorAlertGroupParams) (int64, error)
AddMonitorRegion(ctx context.Context, arg AddMonitorRegionParams) error
AddStatusPageMonitor(ctx context.Context, arg AddStatusPageMonitorParams) error
AgentInstancesByID(ctx context.Context, ids []uuid.UUID) ([]AgentInstancesByIDRow, error)
@@ -23,6 +25,7 @@ type Querier interface {
AlertmanagerMonitors(ctx context.Context, orgID *uuid.UUID) ([]AlertmanagerMonitorsRow, error)
// System scope: the receiver a webhook token belongs to.
AlertmanagerReceiverByHash(ctx context.Context, tokenHash []byte) (AlertmanagerReceiverByHashRow, error)
+ AllMonitorAlertGroups(ctx context.Context) ([]MonitorAlertGroup, error)
AllMonitorRegions(ctx context.Context) ([]AllMonitorRegionsRow, error)
AnyUserExists(ctx context.Context) (bool, error)
// How much one instance checked for the organization in the last hour.
@@ -38,6 +41,7 @@ type Querier interface {
CountUnusedRecoveryCodes(ctx context.Context, userID uuid.UUID) (int64, error)
CreateAPIToken(ctx context.Context, arg CreateAPITokenParams) (ApiToken, error)
CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent, error)
+ CreateAlertGroup(ctx context.Context, arg CreateAlertGroupParams) (AlertGroup, error)
CreateAlertmanagerReceiver(ctx context.Context, arg CreateAlertmanagerReceiverParams) (CreateAlertmanagerReceiverRow, error)
CreateAssignment(ctx context.Context, arg CreateAssignmentParams) (RoleAssignment, error)
CreateChannel(ctx context.Context, arg CreateChannelParams) (NotificationChannel, error)
@@ -57,6 +61,8 @@ type Querier interface {
DeleteAPIToken(ctx context.Context, id uuid.UUID) (int64, error)
DeleteAccountAudit(ctx context.Context, actorUserID *uuid.UUID) error
DeleteAgent(ctx context.Context, arg DeleteAgentParams) (int64, error)
+ DeleteAlertGroup(ctx context.Context, id uuid.UUID) (int64, error)
+ DeleteAlertGroupChannels(ctx context.Context, groupID uuid.UUID) error
DeleteAlertmanagerReceiver(ctx context.Context, id uuid.UUID) (int64, error)
DeleteAssignment(ctx context.Context, id uuid.UUID) (int64, error)
DeleteAssignmentsForResource(ctx context.Context, arg DeleteAssignmentsForResourceParams) error
@@ -67,6 +73,7 @@ type Querier interface {
DeleteLegalDocument(ctx context.Context, arg DeleteLegalDocumentParams) error
DeleteMaintenance(ctx context.Context, id uuid.UUID) (int64, error)
DeleteMonitor(ctx context.Context, id uuid.UUID) (int64, error)
+ DeleteMonitorAlertGroups(ctx context.Context, monitorID uuid.UUID) error
DeleteMonitorRegions(ctx context.Context, monitorID uuid.UUID) error
DeleteOrg(ctx context.Context, id uuid.UUID) (int64, error)
DeleteOrgStorage(ctx context.Context, orgID uuid.UUID) error
@@ -149,13 +156,13 @@ type Querier interface {
ListAPITokens(ctx context.Context, arg ListAPITokensParams) ([]ListAPITokensRow, error)
// Agents owned by org, or platform agents when org is NULL.
ListAgents(ctx context.Context, orgID *uuid.UUID) ([]ListAgentsRow, error)
+ ListAlertGroups(ctx context.Context) ([]ListAlertGroupsRow, error)
ListAlertmanagerReceivers(ctx context.Context) ([]ListAlertmanagerReceiversRow, error)
ListAssignments(ctx context.Context, orgID uuid.UUID) ([]ListAssignmentsRow, error)
// Newest first, paged by time. kind narrows to one kind; the row policy
// already limits what the scope can see.
ListAuditEvents(ctx context.Context, arg ListAuditEventsParams) ([]ListAuditEventsRow, error)
ListChannels(ctx context.Context) ([]NotificationChannel, error)
- ListEnabledChannelIDs(ctx context.Context, orgID uuid.UUID) ([]uuid.UUID, error)
// System scope: every enabled monitor with its regions, for reconciling the
// schedule.
ListEnabledMonitorsForSchedule(ctx context.Context) ([]ListEnabledMonitorsForScheduleRow, error)
@@ -188,6 +195,8 @@ type Querier interface {
MarkNotificationSent(ctx context.Context, id uuid.UUID) error
// Every role a member holds, with the scope it applies to.
MemberGrants(ctx context.Context, arg MemberGrantsParams) ([]MemberGrantsRow, error)
+ MonitorAlertGroups(ctx context.Context, monitorID uuid.UUID) ([]uuid.UUID, error)
+ MonitorChannelIDs(ctx context.Context, monitorID uuid.UUID) ([]uuid.UUID, error)
MonitorIncidents(ctx context.Context, monitorID uuid.UUID) ([]Incident, error)
MonitorRegions(ctx context.Context, monitorID uuid.UUID) ([]uuid.UUID, error)
// System scope: monitors to hand to a checker of region, skipping ones that
@@ -260,6 +269,7 @@ type Querier interface {
// Writes at most once a minute per instance; agents poll far more often.
TouchAgentInstance(ctx context.Context, arg TouchAgentInstanceParams) error
TouchIdentity(ctx context.Context, arg TouchIdentityParams) error
+ UpdateAlertGroup(ctx context.Context, arg UpdateAlertGroupParams) (AlertGroup, error)
UpdateChannel(ctx context.Context, arg UpdateChannelParams) (NotificationChannel, error)
UpdateGroup(ctx context.Context, arg UpdateGroupParams) (MonitorGroup, error)
UpdateMaintenance(ctx context.Context, arg UpdateMaintenanceParams) (MaintenanceWindow, error)
diff --git a/internal/store/queries/alert_groups.sql b/internal/store/queries/alert_groups.sql
new file mode 100644
index 0000000..f6edcdf
--- /dev/null
+++ b/internal/store/queries/alert_groups.sql
@@ -0,0 +1,42 @@
+-- name: ListAlertGroups :many
+SELECT g.*, ARRAY(SELECT c.channel_id FROM alert_group_channels c WHERE c.group_id = g.id ORDER BY c.channel_id)::uuid[] AS channel_ids
+FROM alert_groups g ORDER BY g.is_default DESC, g.name, g.id;
+
+-- name: CreateAlertGroup :one
+INSERT INTO alert_groups (org_id, name) VALUES ($1, $2) RETURNING *;
+
+-- name: UpdateAlertGroup :one
+UPDATE alert_groups SET name = $2 WHERE id = $1 RETURNING *;
+
+-- name: DeleteAlertGroup :execrows
+DELETE FROM alert_groups WHERE id = $1 AND NOT is_default;
+
+-- name: DeleteAlertGroupChannels :exec
+DELETE FROM alert_group_channels WHERE group_id = $1;
+
+-- name: AddAlertGroupChannel :execrows
+INSERT INTO alert_group_channels (org_id, group_id, channel_id)
+SELECT c.org_id, sqlc.arg(group_id), c.id FROM notification_channels c
+WHERE c.id = sqlc.arg(channel_id) AND c.org_id = sqlc.arg(org_id)
+ON CONFLICT DO NOTHING;
+
+-- name: AllMonitorAlertGroups :many
+SELECT * FROM monitor_alert_groups ORDER BY monitor_id, group_id;
+
+-- name: MonitorAlertGroups :many
+SELECT group_id FROM monitor_alert_groups WHERE monitor_id = $1 ORDER BY group_id;
+
+-- name: DeleteMonitorAlertGroups :exec
+DELETE FROM monitor_alert_groups WHERE monitor_id = $1;
+
+-- name: AddMonitorAlertGroup :execrows
+INSERT INTO monitor_alert_groups (org_id, monitor_id, group_id)
+SELECT g.org_id, sqlc.arg(monitor_id), g.id FROM alert_groups g
+WHERE g.id = sqlc.arg(group_id) AND g.org_id = sqlc.arg(org_id)
+ON CONFLICT DO NOTHING;
+
+-- name: MonitorChannelIDs :many
+SELECT DISTINCT c.id FROM notification_channels c
+JOIN alert_group_channels gc ON gc.channel_id = c.id AND gc.org_id = c.org_id
+JOIN monitor_alert_groups mg ON mg.group_id = gc.group_id AND mg.org_id = gc.org_id
+WHERE mg.monitor_id = $1 AND c.enabled;
diff --git a/internal/store/queries/incidents.sql b/internal/store/queries/incidents.sql
index ac8655b..6fc9fd9 100644
--- a/internal/store/queries/incidents.sql
+++ b/internal/store/queries/incidents.sql
@@ -16,9 +16,6 @@ JOIN monitors m ON m.id = i.monitor_id
ORDER BY i.started_at DESC
LIMIT 200;
--- name: ListEnabledChannelIDs :many
-SELECT id FROM notification_channels WHERE org_id = $1 AND enabled;
-
-- name: EnqueueNotification :exec
INSERT INTO notifications (org_id, channel_id, incident_id, event)
VALUES ($1, $2, $3, $4)
diff --git a/internal/web/alert_groups.templ b/internal/web/alert_groups.templ
new file mode 100644
index 0000000..a19acc5
--- /dev/null
+++ b/internal/web/alert_groups.templ
@@ -0,0 +1,77 @@
+package web
+
+import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n"
+
+// AlertGroupOption is a selectable group or channel in an alert routing form.
+type AlertGroupOption struct {
+ ID string
+ Name string
+ Default bool
+ Checked bool
+}
+
+// AlertGroupRow describes a group and its available notification channels.
+type AlertGroupRow struct {
+ ID string
+ Name string
+ Default bool
+ Channels []AlertGroupOption
+}
+
+templ alertGroupOptions(name string, options []AlertGroupOption) {
+
+ for _, opt := range options {
+
+
+ { opt.Name }
+ if opt.Default {
+ { i18n.T(ctx, "alert_groups.default") }
+ }
+
+ }
+}
+
+templ alertGroupsSettings(v ChannelsView) {
+
+ @sectionHeading("alert_groups.title")
+ { i18n.T(ctx, "alert_groups.intro") }
+
+ for _, g := range v.AlertGroups {
+
+ }
+ if v.CanWrite {
+
+ }
+
+
+}
diff --git a/internal/web/alert_groups_templ.go b/internal/web/alert_groups_templ.go
new file mode 100644
index 0000000..c35bb6a
--- /dev/null
+++ b/internal/web/alert_groups_templ.go
@@ -0,0 +1,400 @@
+// Code generated by templ - DO NOT EDIT.
+
+// templ: version: v0.3.1118
+
+package web
+
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
+
+import "github.com/a-h/templ"
+import templruntime "github.com/a-h/templ/runtime"
+
+import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n"
+
+// AlertGroupOption is a selectable group or channel in an alert routing form.
+type AlertGroupOption struct {
+ ID string
+ Name string
+ Default bool
+ Checked bool
+}
+
+// AlertGroupRow describes a group and its available notification channels.
+type AlertGroupRow struct {
+ ID string
+ Name string
+ Default bool
+ Channels []AlertGroupOption
+}
+
+func alertGroupOptions(name string, options []AlertGroupOption) 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 _, opt := range options {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var5 string
+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(opt.Name)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/alert_groups.templ`, Line: 26, Col: 19}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
+ 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 opt.Default {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var6 string
+ templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "alert_groups.default"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/alert_groups.templ`, Line: 28, Col: 74}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
+ 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
+ }
+ }
+ return nil
+ })
+}
+
+func alertGroupsSettings(v ChannelsView) 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, 12, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = sectionHeading("alert_groups.title").Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var8 string
+ templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "alert_groups.intro"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/alert_groups.templ`, Line: 37, Col: 82}
+ }
+ _, 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, 14, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, g := range v.AlertGroups {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ if v.CanWrite {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "
")
+ 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
+ }
+ return nil
+ })
+}
+
+var _ = templruntime.GeneratedTemplate
diff --git a/internal/web/monitors.templ b/internal/web/monitors.templ
index dbb5c37..6909486 100644
--- a/internal/web/monitors.templ
+++ b/internal/web/monitors.templ
@@ -450,6 +450,7 @@ type RegionOption struct {
// MonitorForm is the data of the monitor editor; ID is empty for new ones.
type MonitorForm struct {
+ AlertGroups []AlertGroupOption
ID string
Name string
Type string
@@ -611,6 +612,11 @@ templ MonitorEditor(p Page, me Me, f MonitorForm) {
@formError()
@valueField(i18n.T(ctx, "sso.field.name"), "name", f.Name, "", true)
+
+ { i18n.T(ctx, "alert_groups.title") }
+ @alertGroupOptions("alert_group_ids", f.AlertGroups)
+ { i18n.T(ctx, "alert_groups.monitor_hint") }
+
{ i18n.T(ctx, "groups.group") }
@groupSelect("group_id", f.Groups, f.GroupID, f.TopLevel)
@@ -875,6 +881,7 @@ type ChannelRow struct {
// ChannelsView is the data of the notification channels page.
type ChannelsView struct {
+ AlertGroups []AlertGroupRow
Channels []ChannelRow
EmailAvailable bool
CanWrite bool
@@ -885,6 +892,7 @@ type ChannelsView struct {
templ ChannelsPage(p Page, me Me, v ChannelsView) {
@consoleShell(p, me) {
@settingsHeading("channels.title", "channels.intro")
+ @alertGroupsSettings(v)
if len(v.Channels) > 0 {
for _, ch := range v.Channels {
diff --git a/internal/web/monitors_templ.go b/internal/web/monitors_templ.go
index e131139..c5a3c11 100644
--- a/internal/web/monitors_templ.go
+++ b/internal/web/monitors_templ.go
@@ -1882,6 +1882,7 @@ type RegionOption struct {
// MonitorForm is the data of the monitor editor; ID is empty for new ones.
type MonitorForm struct {
+ AlertGroups []AlertGroupOption
ID string
Name string
Type string
@@ -2011,7 +2012,7 @@ func headersField(value string) templ.Component {
var templ_7745c5c3_Var87 string
templ_7745c5c3_Var87, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.headers"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 560, Col: 116}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 561, Col: 116}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var87))
if templ_7745c5c3_Err != nil {
@@ -2024,7 +2025,7 @@ func headersField(value string) templ.Component {
var templ_7745c5c3_Var88 string
templ_7745c5c3_Var88, templ_7745c5c3_Err = templ.JoinStringErrs(value)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 561, Col: 214}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 562, Col: 214}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var88))
if templ_7745c5c3_Err != nil {
@@ -2037,7 +2038,7 @@ func headersField(value string) templ.Component {
var templ_7745c5c3_Var89 string
templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.headers_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 562, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 563, Col: 84}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var89))
if templ_7745c5c3_Err != nil {
@@ -2076,7 +2077,7 @@ func typeFields(typ, current string) templ.Component {
var templ_7745c5c3_Var91 string
templ_7745c5c3_Var91, templ_7745c5c3_Err = templruntime.NewAttributeExpression(typ).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 567, Col: 26}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 568, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var91)
if templ_7745c5c3_Err != nil {
@@ -2138,7 +2139,7 @@ func numberField(label, name string, value, min, max int, hint string) templ.Com
var templ_7745c5c3_Var93 string
templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinStringErrs(label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 574, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 575, Col: 90}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93))
if templ_7745c5c3_Err != nil {
@@ -2151,7 +2152,7 @@ func numberField(label, name string, value, min, max int, hint string) templ.Com
var templ_7745c5c3_Var94 string
templ_7745c5c3_Var94, templ_7745c5c3_Err = templruntime.NewAttributeExpression(name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 577, Col: 14}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 578, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var94)
if templ_7745c5c3_Err != nil {
@@ -2164,7 +2165,7 @@ func numberField(label, name string, value, min, max int, hint string) templ.Com
var templ_7745c5c3_Var95 string
templ_7745c5c3_Var95, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(value)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 579, Col: 30}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 580, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var95)
if templ_7745c5c3_Err != nil {
@@ -2177,7 +2178,7 @@ func numberField(label, name string, value, min, max int, hint string) templ.Com
var templ_7745c5c3_Var96 string
templ_7745c5c3_Var96, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(min)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 580, Col: 26}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 581, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var96)
if templ_7745c5c3_Err != nil {
@@ -2190,7 +2191,7 @@ func numberField(label, name string, value, min, max int, hint string) templ.Com
var templ_7745c5c3_Var97 string
templ_7745c5c3_Var97, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(max)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 581, Col: 26}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 582, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var97)
if templ_7745c5c3_Err != nil {
@@ -2208,7 +2209,7 @@ func numberField(label, name string, value, min, max int, hint string) templ.Com
var templ_7745c5c3_Var98 string
templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(hint)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 585, Col: 53}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 586, Col: 53}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
if templ_7745c5c3_Err != nil {
@@ -2268,7 +2269,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var101 string
templ_7745c5c3_Var101, 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: 594, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 595, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
if templ_7745c5c3_Err != nil {
@@ -2286,7 +2287,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var102 string
templ_7745c5c3_Var102, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/monitors/" + f.ID)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 596, Col: 48}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 597, Col: 48}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var102)
if templ_7745c5c3_Err != nil {
@@ -2299,7 +2300,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var103 string
templ_7745c5c3_Var103, 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: 596, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 597, Col: 97}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
if templ_7745c5c3_Err != nil {
@@ -2317,7 +2318,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var104 string
templ_7745c5c3_Var104, 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: 599, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 600, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
if templ_7745c5c3_Err != nil {
@@ -2340,7 +2341,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var105 string
templ_7745c5c3_Var105, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/monitors/" + f.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 605, Col: 38}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 606, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var105)
if templ_7745c5c3_Err != nil {
@@ -2353,7 +2354,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var106 string
templ_7745c5c3_Var106, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/monitors/" + f.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 607, Col: 35}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 608, Col: 35}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var106)
if templ_7745c5c3_Err != nil {
@@ -2376,20 +2377,54 @@ 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, 181, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "")
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, "groups.group"))
+ templ_7745c5c3_Var107, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "alert_groups.title"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 615, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 616, Col: 117}
}
_, 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, 182, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = alertGroupOptions("alert_group_ids", f.AlertGroups).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 183, "")
+ 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, "alert_groups.monitor_hint"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 618, Col: 82}
+ }
+ _, 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, 184, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var109 string
+ templ_7745c5c3_Var109, 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: 621, Col: 115}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var109))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 185, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2397,76 +2432,76 @@ 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, 183, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 186, " ")
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.type"))
+ var templ_7745c5c3_Var110 string
+ templ_7745c5c3_Var110, 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: 619, Col: 116}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 625, Col: 116}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var108))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 184, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, t := range f.Types {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 185, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 191, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var110 string
- templ_7745c5c3_Var110, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.type_"+t))
+ var templ_7745c5c3_Var112 string
+ templ_7745c5c3_Var112, 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: 622, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 628, Col: 86}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var112))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 189, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 190, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2474,25 +2509,25 @@ 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, 193, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "
")
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.target_hint"))
+ var templ_7745c5c3_Var113 string
+ templ_7745c5c3_Var113, 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: 628, Col: 83}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 634, Col: 83}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var111))
+ _, 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, 194, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, t := range []string{"postgres", "mysql", "mssql", "mongodb", "redis"} {
- templ_7745c5c3_Var112 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var114 := 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 {
@@ -2510,13 +2545,13 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}
return nil
})
- templ_7745c5c3_Err = typeFields(t, f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var112), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields(t, f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var114), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
for _, t := range []string{"mqtt", "kafka", "rabbitmq"} {
- templ_7745c5c3_Var113 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var115 := 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 {
@@ -2534,54 +2569,11 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}
return nil
})
- templ_7745c5c3_Err = typeFields(t, f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var113), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields(t, f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var115), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Var114 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
- }
- ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, "")
- 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.grpc_hint"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 641, Col: 75}
- }
- _, 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, 196, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = valueField(i18n.T(ctx, "monitors.grpc_service"), "config.service", f.Proto.Service, "shop.v1.Orders", false).Render(ctx, templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = tlsField(f.Proto.TLS, "verify", "require", "disable").Render(ctx, templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- return nil
- })
- templ_7745c5c3_Err = typeFields("grpc", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var114), templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
templ_7745c5c3_Var116 := 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)
@@ -2594,20 +2586,24 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 198, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var117 string
- templ_7745c5c3_Var117, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.smtp_hint"))
+ templ_7745c5c3_Var117, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.grpc_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 646, Col: 75}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 647, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var117))
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, 199, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = valueField(i18n.T(ctx, "monitors.grpc_service"), "config.service", f.Proto.Service, "shop.v1.Orders", false).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2615,13 +2611,9 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = checkbox(i18n.T(ctx, "monitors.smtp_implicit_tls"), "config.implicit_tls", f.Proto.ImplicitTLS).Render(ctx, templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
return nil
})
- templ_7745c5c3_Err = typeFields("smtp", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var116), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("grpc", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var116), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2637,20 +2629,63 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 200, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var119 string
- templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.radius_hint"))
+ templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.smtp_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 651, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 652, Col: 75}
}
_, 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, 200, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 201, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = tlsField(f.Proto.TLS, "verify", "require", "disable").Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = checkbox(i18n.T(ctx, "monitors.smtp_implicit_tls"), "config.implicit_tls", f.Proto.ImplicitTLS).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+ templ_7745c5c3_Err = typeFields("smtp", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var118), templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Var120 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
+ templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
+ if !templ_7745c5c3_IsBuffer {
+ defer func() {
+ templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err == nil {
+ templ_7745c5c3_Err = templ_7745c5c3_BufErr
+ }
+ }()
+ }
+ ctx = templ.InitializeContext(ctx)
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 202, "")
+ 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, "monitors.radius_hint"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 657, Col: 77}
+ }
+ _, 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, 203, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2672,11 +2707,11 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}
return nil
})
- templ_7745c5c3_Err = typeFields("radius", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var118), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("radius", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var120), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var120 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var122 := 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 {
@@ -2688,79 +2723,79 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 201, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "
")
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, "monitors.snmp_hint"))
+ var templ_7745c5c3_Var123 string
+ templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.snmp_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 658, Col: 75}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 664, Col: 75}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var123))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 202, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var122 string
- templ_7745c5c3_Var122, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.snmp_version"))
+ var templ_7745c5c3_Var124 string
+ templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.snmp_version"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 660, Col: 125}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 666, Col: 125}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var122))
+ _, 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, 203, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range []string{"2c", "1"} {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var124 string
- templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.JoinStringErrs("v" + v)
+ var templ_7745c5c3_Var126 string
+ templ_7745c5c3_Var126, templ_7745c5c3_Err = templ.JoinStringErrs("v" + v)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 663, Col: 72}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 669, Col: 72}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var124))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var126))
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
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2772,66 +2807,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, 210, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 213, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var125 string
- templ_7745c5c3_Var125, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.snmp_condition"))
+ var templ_7745c5c3_Var127 string
+ templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.snmp_condition"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 671, Col: 128}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 677, Col: 128}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var125))
+ _, 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, 211, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, c := range []string{"", "eq", "ne", "contains", "gt", "ge", "lt", "le"} {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var127 string
- templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.snmp_cond_"+condKey(c)))
+ var templ_7745c5c3_Var129 string
+ templ_7745c5c3_Var129, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.snmp_cond_"+condKey(c)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 674, Col: 113}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 680, Col: 113}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var127))
+ _, 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, 216, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, "")
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
}
@@ -2839,52 +2874,13 @@ 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, 218, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
- templ_7745c5c3_Err = typeFields("snmp", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var120), templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Var128 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
- }
- ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var129 string
- templ_7745c5c3_Var129, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.steam_hint"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 682, Col: 76}
- }
- _, 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, 220, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = numberField(i18n.T(ctx, "monitors.game_min_free_slots"), "config.min_free_slots", f.Game.MinFreeSlots, 0, 10000, i18n.T(ctx, "monitors.game_min_free_slots_hint")).Render(ctx, templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- return nil
- })
- templ_7745c5c3_Err = typeFields("steam", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var128), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("snmp", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var122), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2900,79 +2896,20 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var131 string
- templ_7745c5c3_Var131, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.minecraft_hint"))
+ templ_7745c5c3_Var131, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.steam_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 686, Col: 80}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 688, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var131))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "
")
- 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, "monitors.minecraft_edition"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 688, Col: 130}
- }
- _, 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, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- for _, e := range []string{"java", "bedrock"} {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var134 string
- templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.minecraft_"+e))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 691, Col: 100}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var134))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, " ")
- 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, 223, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -2982,11 +2919,11 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}
return nil
})
- templ_7745c5c3_Err = typeFields("minecraft", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var130), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("steam", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var130), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var135 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var132 := 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 {
@@ -2998,30 +2935,89 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, "
")
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, "monitors.docker_hint"))
+ var templ_7745c5c3_Var133 string
+ templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.minecraft_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 698, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 692, Col: 80}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var136))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var133))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 231, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = valueField(i18n.T(ctx, "monitors.docker_host"), "config.host", f.DockerHost, "unix:///var/run/docker.sock", false).Render(ctx, templ_7745c5c3_Buffer)
+ var templ_7745c5c3_Var134 string
+ templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.minecraft_edition"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 694, Col: 130}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var134))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 226, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, e := range []string{"java", "bedrock"} {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 227, "")
+ 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, "monitors.minecraft_"+e))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 697, Col: 100}
+ }
+ _, 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, 231, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = numberField(i18n.T(ctx, "monitors.game_min_free_slots"), "config.min_free_slots", f.Game.MinFreeSlots, 0, 10000, i18n.T(ctx, "monitors.game_min_free_slots_hint")).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
- templ_7745c5c3_Err = typeFields("docker", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var135), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("minecraft", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var132), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3037,233 +3033,34 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "
")
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, "monitors.alertmanager_hint"))
+ templ_7745c5c3_Var138, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.docker_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 703, Col: 49}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 704, Col: 77}
}
_, 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, 233, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var139 string
- templ_7745c5c3_Var139, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "alertmanager.title"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 704, Col: 111}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var139))
- 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
- }
- var templ_7745c5c3_Var140 string
- templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.matchers"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 707, Col: 123}
- }
- _, 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, 235, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- for i, m := range f.Matchers {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- for _, op := range MatcherOps {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 242, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var147 string
- templ_7745c5c3_Var147, templ_7745c5c3_Err = templ.JoinStringErrs(op)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 713, Col: 60}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var147))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- 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, 251, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var151 string
- templ_7745c5c3_Var151, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.matchers_hint"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 719, Col: 80}
- }
- _, 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, 252, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = numberField(i18n.T(ctx, "monitors.stale_hours"), "config.stale_hours", f.StaleHours, 1, 720, i18n.T(ctx, "monitors.stale_hours_hint")).Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = valueField(i18n.T(ctx, "monitors.docker_host"), "config.host", f.DockerHost, "unix:///var/run/docker.sock", false).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
- templ_7745c5c3_Err = typeFields("alertmanager", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var137), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("docker", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var137), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var152 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var139 := 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 {
@@ -3275,30 +3072,229 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 253, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "
")
+ 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, "monitors.alertmanager_hint"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 709, Col: 49}
+ }
+ _, 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, 236, " ")
+ 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, "alertmanager.title"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 710, Col: 111}
+ }
+ _, 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, 237, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var142 string
+ templ_7745c5c3_Var142, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.matchers"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 713, Col: 123}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var142))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for i, m := range f.Matchers {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, op := range MatcherOps {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 245, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var149 string
+ templ_7745c5c3_Var149, templ_7745c5c3_Err = templ.JoinStringErrs(op)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 719, Col: 60}
+ }
+ _, 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, 249, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var153 string
- templ_7745c5c3_Var153, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.heartbeat_hint"))
+ templ_7745c5c3_Var153, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.matchers_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 724, Col: 80}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 725, Col: 80}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var153))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = numberField(i18n.T(ctx, "monitors.grace"), "config.grace_seconds", f.GraceSeconds, 0, 86400, i18n.T(ctx, "monitors.grace_hint")).Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = numberField(i18n.T(ctx, "monitors.stale_hours"), "config.stale_hours", f.StaleHours, 1, 720, i18n.T(ctx, "monitors.stale_hours_hint")).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
- templ_7745c5c3_Err = typeFields("heartbeat", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var152), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("alertmanager", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var139), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3314,66 +3310,105 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var155 string
- templ_7745c5c3_Var155, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.method"))
+ templ_7745c5c3_Var155, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.heartbeat_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 729, Col: 119}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 730, Col: 80}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var155))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- if f.Method != "HEAD" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 257, " selected")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 258, ">GET HEAD ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var156 string
- templ_7745c5c3_Var156, 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: 736, Col: 126}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var156))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var157 string
- templ_7745c5c3_Var157, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.ExpectStatus).Resolve(ctx)
+ templ_7745c5c3_Var157, 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: 737, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 735, Col: 119}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var157)
+ _, 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, 262, "\" class=\"w-full border border-rule bg-transparent px-2.5 py-1.5 font-mono text-sm outline-none focus:border-ink\"> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 259, " GET HEAD ")
+ 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, "monitors.expect_status"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 742, Col: 126}
+ }
+ _, 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, 264, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3399,11 +3434,11 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}
return nil
})
- templ_7745c5c3_Err = typeFields("http", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var154), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("http", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var156), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var158 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var160 := 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 {
@@ -3415,184 +3450,161 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var159 string
- templ_7745c5c3_Var159, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.prom_hint"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 746, Col: 75}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var159))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 264, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var160 string
- templ_7745c5c3_Var160, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.prom_query"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 748, Col: 123}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var160))
- 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
+ }
+ var templ_7745c5c3_Var165 string
+ templ_7745c5c3_Var165, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.assertion_op"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 759, Col: 126}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var165))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, op := range AssertionOps[:6] {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 275, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var165 string
- templ_7745c5c3_Var165, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.op_"+opKey(op)))
+ var templ_7745c5c3_Var167 string
+ templ_7745c5c3_Var167, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.op_"+opKey(op)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 756, Col: 98}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 762, Col: 98}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var165))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var167))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 276, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 274, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var166 string
- templ_7745c5c3_Var166, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.prom_threshold"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 761, Col: 128}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var166))
- 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, 277, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var168 string
- templ_7745c5c3_Var168, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.prom_mode"))
+ templ_7745c5c3_Var168, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.prom_threshold"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 766, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 767, Col: 128}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var168))
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, 278, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- if f.PromMode == "any" {
+ var templ_7745c5c3_Var170 string
+ templ_7745c5c3_Var170, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.prom_mode"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 772, Col: 122}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var170))
+ 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
+ }
+ var templ_7745c5c3_Var172 string
+ templ_7745c5c3_Var172, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.prom_mode_any"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 775, Col: 100}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var172))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 286, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3629,11 +3664,11 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}
return nil
})
- templ_7745c5c3_Err = typeFields("prometheus", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var158), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("prometheus", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var160), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var171 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var173 := 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 {
@@ -3645,92 +3680,92 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 284, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var172 string
- templ_7745c5c3_Var172, 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: 778, Col: 119}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var172))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 285, " GET POST ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var173 string
- templ_7745c5c3_Var173, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.json_body"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 785, Col: 122}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var173))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 290, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 288, " GET POST ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var175 string
- templ_7745c5c3_Var175, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.expect_status"))
+ templ_7745c5c3_Var175, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.json_body"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 789, Col: 126}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 791, Col: 122}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var175))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 292, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 294, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var177 string
+ templ_7745c5c3_Var177, 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: 795, Col: 126}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var177))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 295, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3742,203 +3777,203 @@ 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, 294, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 297, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var177 string
- templ_7745c5c3_Var177, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.assertions"))
+ var templ_7745c5c3_Var179 string
+ templ_7745c5c3_Var179, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.assertions"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 795, Col: 125}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 801, Col: 125}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var177))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var179))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 295, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 298, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var178 string
- templ_7745c5c3_Var178, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.assertions_hint"))
+ var templ_7745c5c3_Var180 string
+ templ_7745c5c3_Var180, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.assertions_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 796, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 802, Col: 82}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var178))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var180))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 296, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 299, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i, a := range f.Assertions {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 297, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 303, "\" class=\"min-w-0 border border-rule bg-transparent px-2 py-1 font-mono text-xs outline-none focus:border-ink\"> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, op := range AssertionOps {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 303, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 309, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var185 string
- templ_7745c5c3_Var185, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.op_"+opKey(op)))
+ var templ_7745c5c3_Var187 string
+ templ_7745c5c3_Var187, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.op_"+opKey(op)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 802, Col: 95}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 808, Col: 95}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var185))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var187))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 307, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 310, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 308, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 312, "\" value=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var189 string
+ templ_7745c5c3_Var189, templ_7745c5c3_Err = templruntime.NewAttributeExpression(a.Value).Resolve(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 811, Col: 89}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var189)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 313, "\" placeholder=\"ok\" aria-label=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var190 string
+ templ_7745c5c3_Var190, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.assertion_value")).Resolve(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 811, Col: 161}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var190)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 314, "\" class=\"min-w-0 border border-rule bg-transparent px-2 py-1 font-mono text-xs outline-none focus:border-ink\"> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 312, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 315, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
- templ_7745c5c3_Err = typeFields("json", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var171), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("json", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var173), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var189 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var191 := 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 {
@@ -3950,66 +3985,66 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 313, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 316, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var190 string
- templ_7745c5c3_Var190, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.dns_record"))
+ var templ_7745c5c3_Var192 string
+ templ_7745c5c3_Var192, 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: 812, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 818, Col: 123}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var190))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var192))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 314, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 317, " ")
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, 315, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 321, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var192 string
- templ_7745c5c3_Var192, templ_7745c5c3_Err = templ.JoinStringErrs(r)
+ var templ_7745c5c3_Var194 string
+ templ_7745c5c3_Var194, templ_7745c5c3_Err = templ.JoinStringErrs(r)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 815, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 821, Col: 62}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var192))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var194))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 319, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 322, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 320, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 323, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4023,11 +4058,11 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}
return nil
})
- templ_7745c5c3_Err = typeFields("dns", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var189), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("dns", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var191), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var193 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var195 := 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 {
@@ -4049,11 +4084,11 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
}
return nil
})
- templ_7745c5c3_Err = typeFields("tls", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var193), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = typeFields("tls", f.Type).Render(templ.WithChildren(ctx, templ_7745c5c3_Var195), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 321, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 324, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4061,17 +4096,17 @@ 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, 322, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 327, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4079,7 +4114,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, 325, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 328, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4087,141 +4122,141 @@ 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, 326, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 332, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var194 string
- templ_7745c5c3_Var194, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.regions"))
+ var templ_7745c5c3_Var196 string
+ templ_7745c5c3_Var196, 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: 834, Col: 121}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 840, Col: 121}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var194))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var196))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 330, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 333, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var195 string
- templ_7745c5c3_Var195, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.regions_hint"))
+ var templ_7745c5c3_Var197 string
+ templ_7745c5c3_Var197, 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: 835, Col: 78}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 841, Col: 78}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var195))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var197))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 331, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 334, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, r := range f.Regions {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 332, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 338, " class=\"accent-ink\"> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var197 string
- templ_7745c5c3_Var197, templ_7745c5c3_Err = templ.JoinStringErrs(r.Name)
+ var templ_7745c5c3_Var199 string
+ templ_7745c5c3_Var199, 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: 839, Col: 15}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 845, Col: 15}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var197))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var199))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 336, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 339, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if r.Own {
- var templ_7745c5c3_Var198 string
- templ_7745c5c3_Var198, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "regions.own"))
+ var templ_7745c5c3_Var200 string
+ templ_7745c5c3_Var200, 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: 842, Col: 37}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 848, Col: 37}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var198))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var200))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 337, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 340, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- var templ_7745c5c3_Var199 string
- templ_7745c5c3_Var199, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "regions.platform"))
+ var templ_7745c5c3_Var201 string
+ templ_7745c5c3_Var201, 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: 844, Col: 42}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 850, Col: 42}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var199))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var201))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 338, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 341, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 339, "· ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 342, "· ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var200 string
- templ_7745c5c3_Var200, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "regions.live", "Count", int(r.Live)))
+ var templ_7745c5c3_Var202 string
+ templ_7745c5c3_Var202, 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: 846, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 852, Col: 62}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var200))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var202))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 340, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 343, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 341, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 344, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4234,51 +4269,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, 342, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 345, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 346, "\" data-confirm=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var204 string
+ templ_7745c5c3_Var204, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.delete_confirm")).Resolve(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 863, Col: 59}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var204)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 347, "\" data-next=\"/\" class=\"mt-6 text-sm text-down hover:underline\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var205 string
+ templ_7745c5c3_Var205, 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: 866, Col: 38}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var205))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 348, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 346, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 349, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4303,6 +4338,7 @@ type ChannelRow struct {
// ChannelsView is the data of the notification channels page.
type ChannelsView struct {
+ AlertGroups []AlertGroupRow
Channels []ChannelRow
EmailAvailable bool
CanWrite bool
@@ -4327,7 +4363,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var205 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var207 := 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 {
@@ -4343,13 +4379,17 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+ templ_7745c5c3_Err = alertGroupsSettings(v).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
if len(v.Channels) > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 347, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 350, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, ch := range v.Channels {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 348, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 351, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4364,149 +4404,149 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 349, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var206 string
- templ_7745c5c3_Var206, 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: 897, Col: 21}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var206))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 350, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var207 string
- templ_7745c5c3_Var207, 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: 898, Col: 70}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var207))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 351, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 352, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var208 string
- templ_7745c5c3_Var208, templ_7745c5c3_Err = templ.JoinStringErrs(ch.Target)
+ templ_7745c5c3_Var208, 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: 899, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 905, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var208))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 352, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 353, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var209 string
+ templ_7745c5c3_Var209, 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: 906, Col: 70}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var209))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 354, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var210 string
+ templ_7745c5c3_Var210, 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: 907, Col: 77}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var210))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 355, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if v.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 353, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 356, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var213 string
- templ_7745c5c3_Var213, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "channels.delete_confirm")).Resolve(ctx)
+ templ_7745c5c3_Var213, 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: 903, Col: 124}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 910, Col: 187}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var213)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var213))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 358, "\" class=\"text-muted hover:text-down\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 359, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 360, "\" data-confirm=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var215 string
+ templ_7745c5c3_Var215, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "channels.delete_confirm")).Resolve(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 911, Col: 124}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var215)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 361, "\" class=\"text-muted hover:text-down\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var216 string
+ templ_7745c5c3_Var216, 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: 911, Col: 193}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var216))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 362, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 360, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 363, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 361, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 364, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 362, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 365, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if v.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 363, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 366, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4514,7 +4554,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, 364, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4560,7 +4600,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, 368, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 382, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 380, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 383, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var220 string
- templ_7745c5c3_Var220, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "error.email_not_configured"))
+ var templ_7745c5c3_Var222 string
+ templ_7745c5c3_Var222, 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: 948, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 956, Col: 79}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var220))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var222))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 381, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 384, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 382, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 385, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4687,20 +4727,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, 383, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 386, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var221 string
- templ_7745c5c3_Var221, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.service_intro"))
+ var templ_7745c5c3_Var223 string
+ templ_7745c5c3_Var223, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.service_intro"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 953, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 961, Col: 89}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var221))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var223))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 384, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
return nil
})
- templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var205), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var207), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4972,208 +5012,208 @@ func providerField(f ProviderField) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 411, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 414, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var232 string
- templ_7745c5c3_Var232, templ_7745c5c3_Err = templ.JoinStringErrs(f.Label)
+ var templ_7745c5c3_Var234 string
+ templ_7745c5c3_Var234, templ_7745c5c3_Err = templ.JoinStringErrs(f.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1023, Col: 12}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1031, Col: 12}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var232))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var234))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 412, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 415, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !f.Required {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 413, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 416, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var233 string
- templ_7745c5c3_Var233, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + i18n.T(ctx, "channels.optional"))
+ var templ_7745c5c3_Var235 string
+ templ_7745c5c3_Var235, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + i18n.T(ctx, "channels.optional"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1025, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1033, Col: 89}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var233))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var235))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 414, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 417, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 415, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 418, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
switch {
case f.Kind == "select":
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 416, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 420, "\" class=\"w-full border border-rule bg-transparent px-2 py-1.5 font-mono text-sm\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, o := range f.Options {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 418, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 424, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var236 string
- templ_7745c5c3_Var236, templ_7745c5c3_Err = templ.JoinStringErrs(o)
+ var templ_7745c5c3_Var238 string
+ templ_7745c5c3_Var238, templ_7745c5c3_Err = templ.JoinStringErrs(o)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1032, Col: 58}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1040, Col: 58}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var236))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var238))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 422, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 425, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 423, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 426, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
case f.Secret:
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 424, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- default:
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 428, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ default:
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 431, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 433, "\" value=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var242 string
+ templ_7745c5c3_Var242, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.Default).Resolve(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1049, Col: 22}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var242)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 434, "\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if f.Required {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 435, " required")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 436, " placeholder=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var243 string
+ templ_7745c5c3_Var243, templ_7745c5c3_Err = templruntime.NewAttributeExpression(map[bool]string{true: "https://", false: ""}[f.Kind == "url"]).Resolve(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1051, Col: 80}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var243)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 437, "\" 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
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 435, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 438, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5198,85 +5238,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, 436, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 440, "\" 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, 438, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var244 string
- templ_7745c5c3_Var244, 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: 1053, Col: 48}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var244))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 439, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- for _, g := range groups {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 440, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 441, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var246 string
- templ_7745c5c3_Var246, templ_7745c5c3_Err = templ.JoinStringErrs(g.Label)
+ templ_7745c5c3_Var246, 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: 1056, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1061, Col: 48}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var246))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 444, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 442, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 445, " ")
+ for _, g := range groups {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 443, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var248 string
+ templ_7745c5c3_Var248, 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: 1064, Col: 66}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var248))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 447, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 448, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5319,7 +5359,7 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var248 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var250 := 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 {
@@ -5331,20 +5371,20 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 446, "← ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 449, "← ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var249 string
- templ_7745c5c3_Var249, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
+ var templ_7745c5c3_Var251 string
+ templ_7745c5c3_Var251, 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: 1081, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1089, Col: 115}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var249))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var251))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 447, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 450, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5353,69 +5393,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, 448, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 451, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, g := range v.Groups {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 449, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 453, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var251 string
- templ_7745c5c3_Var251, templ_7745c5c3_Err = templ.JoinStringErrs(g.Name)
+ var templ_7745c5c3_Var253 string
+ templ_7745c5c3_Var253, 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: 1088, Col: 21}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1096, Col: 21}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var251))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var253))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 451, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 454, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if g.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 452, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 455, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var252 string
- templ_7745c5c3_Var252, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "sso.action.edit"))
+ var templ_7745c5c3_Var254 string
+ templ_7745c5c3_Var254, 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: 1091, Col: 99}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1099, Col: 99}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var252))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var254))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 453, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 457, "\" data-method=\"put\" data-next=\"/groups\" class=\"mt-3 w-72\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5427,20 +5467,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, 455, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 458, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var254 string
- templ_7745c5c3_Var254, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.parent"))
+ var templ_7745c5c3_Var256 string
+ templ_7745c5c3_Var256, 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: 1096, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1104, Col: 122}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var254))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var256))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 456, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 459, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5448,7 +5488,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, 457, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 460, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5456,66 +5496,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, 458, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 461, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 462, "\" data-confirm=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var258 string
+ templ_7745c5c3_Var258, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "groups.delete_confirm")).Resolve(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1109, Col: 120}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var258)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 463, "\" class=\"mt-4 text-sm text-down hover:underline\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var259 string
+ templ_7745c5c3_Var259, 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: 1109, Col: 200}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var259))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 464, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 462, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 465, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 463, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 466, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 464, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 467, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if v.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 465, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 468, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5523,7 +5563,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, 466, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 469, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5535,20 +5575,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, 467, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 470, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var258 string
- templ_7745c5c3_Var258, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.parent"))
+ var templ_7745c5c3_Var260 string
+ templ_7745c5c3_Var260, 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: 1116, Col: 117}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1124, Col: 117}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var258))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var260))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 468, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 471, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5556,7 +5596,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, 469, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 472, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5564,14 +5604,14 @@ 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, 470, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 473, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
return nil
})
- templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var248), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var250), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5603,7 +5643,7 @@ func pingSection(url string) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 471, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 474, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5611,55 +5651,55 @@ func pingSection(url string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 472, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var260 string
- templ_7745c5c3_Var260, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.ping_intro"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1136, Col: 83}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var260))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 473, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var261 string
- templ_7745c5c3_Var261, templ_7745c5c3_Err = templ.JoinStringErrs("curl -fsS -m 10 --retry 3 " + url + "\n")
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1137, Col: 137}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var261))
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 475, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var262 string
- templ_7745c5c3_Var262, templ_7745c5c3_Err = templ.JoinStringErrs("curl -fsS -m 10 --retry 3 --data-raw \"$output\" " + url + "/fail")
+ templ_7745c5c3_Var262, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.ping_intro"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1137, Col: 208}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1144, Col: 83}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var262))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 474, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 476, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var263 string
- templ_7745c5c3_Var263, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.ping_secret"))
+ templ_7745c5c3_Var263, templ_7745c5c3_Err = templ.JoinStringErrs("curl -fsS -m 10 --retry 3 " + url + "\n")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1138, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1145, Col: 137}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var263))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 475, " ")
+ var templ_7745c5c3_Var264 string
+ templ_7745c5c3_Var264, templ_7745c5c3_Err = templ.JoinStringErrs("curl -fsS -m 10 --retry 3 --data-raw \"$output\" " + url + "/fail")
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1145, Col: 208}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var264))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 477, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var265 string
+ templ_7745c5c3_Var265, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.ping_secret"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1146, Col: 84}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var265))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 478, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5705,20 +5745,20 @@ func dbFields(typ string, d DBForm) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 476, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 479, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var265 string
- templ_7745c5c3_Var265, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_hint"))
+ var templ_7745c5c3_Var267 string
+ templ_7745c5c3_Var267, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1164, Col: 69}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1172, Col: 69}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var265))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var267))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 477, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 480, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5746,33 +5786,33 @@ func dbFields(typ string, d DBForm) templ.Component {
return templ_7745c5c3_Err
}
if typ != "redis" && typ != "mongodb" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 478, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 481, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var266 string
- templ_7745c5c3_Var266, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_query"))
+ var templ_7745c5c3_Var268 string
+ templ_7745c5c3_Var268, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_query"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1175, Col: 118}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1183, Col: 118}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var266))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var268))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 479, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 482, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var267 string
- templ_7745c5c3_Var267, templ_7745c5c3_Err = templ.JoinStringErrs(d.Query)
+ var templ_7745c5c3_Var269 string
+ templ_7745c5c3_Var269, templ_7745c5c3_Err = templ.JoinStringErrs(d.Query)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1176, Col: 185}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1184, Col: 185}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var267))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var269))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 480, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 483, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5804,56 +5844,56 @@ func secretField(label, name string, set bool) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 481, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 484, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var269 string
- templ_7745c5c3_Var269, templ_7745c5c3_Err = templ.JoinStringErrs(label)
+ var templ_7745c5c3_Var271 string
+ templ_7745c5c3_Var271, templ_7745c5c3_Err = templ.JoinStringErrs(label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1186, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1194, Col: 90}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var269))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var271))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 482, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 489, " 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
}
@@ -5879,66 +5919,66 @@ func tlsField(value string, modes ...string) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 487, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 490, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var273 string
- templ_7745c5c3_Var273, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_tls"))
+ var templ_7745c5c3_Var275 string
+ templ_7745c5c3_Var275, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_tls"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1202, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1210, Col: 115}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var273))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var275))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 488, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 491, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, m := range modes {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 489, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 495, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var275 string
- templ_7745c5c3_Var275, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_tls_"+m))
+ var templ_7745c5c3_Var277 string
+ templ_7745c5c3_Var277, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_tls_"+m))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1205, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1213, Col: 84}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var275))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var277))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 493, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 496, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 494, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 497, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5963,20 +6003,20 @@ func brokerFields(typ string, b BrokerForm) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 495, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 498, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var277 string
- templ_7745c5c3_Var277, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.broker_hint_"+typ))
+ var templ_7745c5c3_Var279 string
+ templ_7745c5c3_Var279, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.broker_hint_"+typ))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1212, Col: 78}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1220, Col: 78}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var277))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var279))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 496, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 499, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -6003,66 +6043,66 @@ func brokerFields(typ string, b BrokerForm) templ.Component {
return templ_7745c5c3_Err
}
case "kafka":
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 497, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 500, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var278 string
- templ_7745c5c3_Var278, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.broker_sasl"))
+ var templ_7745c5c3_Var280 string
+ templ_7745c5c3_Var280, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.broker_sasl"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1222, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1230, Col: 122}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var278))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var280))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 498, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 501, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, m := range []string{"plain", "scram-sha-256", "scram-sha-512"} {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 499, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 505, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var280 string
- templ_7745c5c3_Var280, templ_7745c5c3_Err = templ.JoinStringErrs(strings.ToUpper(m))
+ var templ_7745c5c3_Var282 string
+ templ_7745c5c3_Var282, templ_7745c5c3_Err = templ.JoinStringErrs(strings.ToUpper(m))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1225, Col: 72}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1233, Col: 72}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var280))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var282))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 503, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 506, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 504, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 507, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/web/testdata/forms.html b/internal/web/testdata/forms.html
index bb0a20b..ab32598 100644
--- a/internal/web/testdata/forms.html
+++ b/internal/web/testdata/forms.html
@@ -13,6 +13,10 @@ X-Empty:
HEAD
+
+
+
+
save
@@ -42,6 +46,15 @@ window.axios = { create: () => ({ interceptors: { request: { use() {} } }, reque
check("numbered names build arrays", body.config.assertions, [{ path: "status", op: "==" }, { path: "queue.depth", op: "<" }]);
check("header lines become an object", body.config.headers, { Authorization: "Bearer a:b", "X-Empty": "" });
check("regions sent", body.regions, ["r1"]);
+ check("default alert group selected", body.alert_group_ids, ["default"]);
+ check("empty channel list stays an array", body.channel_ids, []);
+ form.querySelector('[name="alert_group_ids"][value="default"]').checked = false;
+ body = await submit();
+ check("cleared alert groups sent explicitly", body.alert_group_ids, []);
+ form.querySelector('[name="alert_group_ids"][value="ops"]').checked = true;
+ body = await submit();
+ check("custom alert group selected", body.alert_group_ids, ["ops"]);
+
const sel = form.querySelector("[data-type-select]");
sel.value = "heartbeat";