From 52819e64bbbd10a8428812796d6d11a66e5c8c6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?=
Date: Sun, 22 Nov 2026 17:40:19 +0100
Subject: [PATCH 1/3] feat(notify): the remaining notification services of
Uptime Kuma
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Adds 93 services, bringing the total to 109 plus webhook and email:
chat and messengers (DingTalk, Feishu, LINE, Nextcloud Talk, Threema,
WhatsApp gateways, Nostr, Home Assistant, …), push (Bark, Gorush,
ServerChan, …), SMS and calls (Twilio, Plivo, 46elks, Alibaba Cloud,
Teltonika routers, …), email APIs (SendGrid, Brevo, Resend, Microsoft
Graph, …) and incident management (Grafana OnCall, Jira Service
Management, Splunk On-Call, Squadcast, SIGNL4, …). Customers bring
their own credentials; secrets are sealed like the others.
Services pair incidents by their ID where they can resolve alerts.
Signed requests (DingTalk, Nextcloud Talk, Alibaba Cloud) and replies
that report failures with status 200 are handled. Nostr messages are
sealed and gift-wrapped (NIP-17/59) with go-nostr, but sent over our own
WebSocket connections so relays go through the network guard. Messages
now carry the monitor's name, ID and target.
The channel form groups services, the i18n test derives provider keys
from the registry, and channel types may contain digits.
Refs #92
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
---
README.md | 2 +-
go.mod | 17 +-
go.sum | 119 +-
internal/api/console.go | 10 +-
internal/api/providers.go | 2 +-
internal/api/providers_test.go | 12 +-
internal/i18n/i18n_test.go | 22 +-
internal/i18n/locales/de.json | 199 +++
internal/i18n/locales/en.json | 199 +++
.../sql/00038_channel_type_digits.sql | 9 +
internal/notify/chat.go | 357 +++++
internal/notify/email.go | 131 ++
internal/notify/incident.go | 228 +++
internal/notify/nostr.go | 130 ++
internal/notify/providers.go | 179 ++-
internal/notify/push.go | 171 +++
internal/notify/services_test.go | 392 +++++
internal/notify/sms.go | 413 ++++++
internal/web/monitors.templ | 23 +-
internal/web/monitors_templ.go | 1290 +++++++++--------
20 files changed, 3239 insertions(+), 666 deletions(-)
create mode 100644 internal/migrations/sql/00038_channel_type_digits.sql
create mode 100644 internal/notify/chat.go
create mode 100644 internal/notify/email.go
create mode 100644 internal/notify/incident.go
create mode 100644 internal/notify/nostr.go
create mode 100644 internal/notify/push.go
create mode 100644 internal/notify/services_test.go
create mode 100644 internal/notify/sms.go
diff --git a/README.md b/README.md
index 0f77d62..5218746 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ It is built for teams and hosting providers: organizations with members, roles a
- **Checks:** HTTP(S) with keyword, JSON APIs with conditions on values, Prometheus queries, TCP, TLS certificate expiry, DNS, ICMP; PostgreSQL, MySQL/MariaDB, SQL Server, MongoDB, Redis; MQTT, Kafka, RabbitMQ; gRPC health, SMTP, RADIUS, SNMP; Steam and Minecraft servers; Docker containers; heartbeats pinged by cron jobs, and Prometheus Alertmanager alerts. Credentials are stored encrypted. Platform admins can switch off types an installation cannot offer.
- **Multi-region:** checkers run per region, several per region for load and failover; any number of regions per monitor.
-- **Alerting:** incidents with webhooks (signed), email, Slack, Discord, Microsoft Teams, Google Chat, Mattermost, Rocket.Chat, Telegram, Matrix, ntfy, Gotify, Pushover, Pushbullet, Signal, PagerDuty, Opsgenie and Apprise; confirmations, maintenance windows (one-off or recurring).
+- **Alerting:** incidents with webhooks (signed), email and over 100 services: chat and messengers (Slack, Discord, Microsoft Teams, Telegram, Matrix, WhatsApp gateways, Nostr, …), push (ntfy, Gotify, Pushover, …), SMS and calls (Twilio, Plivo, …), email APIs (SendGrid, Microsoft 365, …) and incident management (PagerDuty, Opsgenie, Grafana OnCall, Jira Service Management, …), plus Apprise; customers bring their own credentials. Confirmations, maintenance windows (one-off or recurring).
- **History:** charts and SLA from one hour to a year, per region; see what the checker saw (redirect chain, timing, certificate, response body).
- **Status pages:** unlimited, custom domains with automatic TLS, themes, Markdown, legal notice; served from cache during outages.
- **Organizations:** members, custom roles scoped to monitor groups or status pages, API tokens, OpenID Connect SSO per organization, enforced 2FA, audit log.
diff --git a/go.mod b/go.mod
index 63ec9f4..a9c1919 100644
--- a/go.mod
+++ b/go.mod
@@ -6,6 +6,7 @@ require (
github.com/a-h/templ v0.3.1118
github.com/caarlos0/env/v11 v11.4.2
github.com/caddyserver/certmagic v0.25.6
+ github.com/coder/websocket v1.8.15
github.com/coreos/go-oidc/v3 v3.21.0
github.com/eclipse/paho.mqtt.golang v1.5.1
github.com/gin-gonic/gin v1.12.0
@@ -17,6 +18,7 @@ require (
github.com/jackc/pgx/v5 v5.13.0
github.com/microsoft/go-mssqldb v1.12.0
github.com/mochi-mqtt/server/v2 v2.7.9
+ github.com/nbd-wtf/go-nostr v0.52.3
github.com/nicksnyder/go-i18n/v2 v2.7.0
github.com/pquerna/otp v1.5.0
github.com/pressly/goose/v3 v3.30.1
@@ -37,9 +39,13 @@ require (
require (
filippo.io/edwards25519 v1.2.0 // indirect
+ github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3 // indirect
github.com/a-h/parse v0.0.42 // indirect
github.com/andybalholm/brotli v1.3.0 // indirect
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
+ github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
+ github.com/btcsuite/btcd/btcutil v1.1.5 // indirect
+ github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic v1.15.0 // indirect
github.com/bytedance/sonic/loader v0.5.0 // indirect
@@ -48,6 +54,8 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cli/browser v1.3.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
+ github.com/decred/dcrd/crypto/blake256 v1.1.0 // indirect
+ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.16 // indirect
@@ -62,11 +70,13 @@ require (
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.3 // indirect
+ github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.20.4 // indirect
github.com/klauspost/cpuid/v2 v2.4.0 // indirect
github.com/leodido/go-urn v1.5.0 // indirect
github.com/libdns/libdns v1.1.1 // indirect
+ github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.16 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/mfridman/interpolate v0.2.0 // indirect
@@ -77,11 +87,15 @@ require (
github.com/natefinch/atomic v1.0.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pierrec/lz4/v4 v4.1.33 // indirect
+ github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect
github.com/quic-go/qpack v0.6.0 // indirect
github.com/quic-go/quic-go v0.59.0 // indirect
github.com/rs/xid v1.4.0 // indirect
github.com/sethvargo/go-retry v0.5.0 // indirect
github.com/shopspring/decimal v1.6.0 // indirect
+ github.com/tidwall/gjson v1.18.0 // indirect
+ github.com/tidwall/match v1.1.1 // indirect
+ github.com/tidwall/pretty v1.2.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.3.1 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
@@ -93,10 +107,11 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap/exp v0.3.0 // indirect
golang.org/x/arch v0.22.0 // indirect
+ golang.org/x/exp v0.0.0-20261109185158-a52e3aef5920 // indirect
golang.org/x/mod v0.43.0 // indirect
golang.org/x/sync v0.25.0 // indirect
golang.org/x/sys v0.50.0 // indirect
- golang.org/x/tools v0.52.0 // indirect
+ golang.org/x/tools v0.52.1-0.20261106145633-d407941a339a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c // indirect
google.golang.org/protobuf v1.36.12 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/go.sum b/go.sum
index a4cdbd8..8bc8432 100644
--- a/go.sum
+++ b/go.sum
@@ -16,10 +16,13 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.10.1 h1:0O6j18nQDo
github.com/AzureAD/microsoft-authentication-library-for-go v1.10.1/go.mod h1:xdYAf5bjkOpsd3auA8riiJW4vneBubt9caavL7626jQ=
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
+github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3 h1:ClzzXMDDuUbWfNNZqGeYq4PnYOlwlOVIvSyNaIy0ykg=
+github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3/go.mod h1:we0YA5CsBbH5+/NUzC/AlMmxaDtWlXeNsqrwXjTzmzA=
github.com/a-h/parse v0.0.42 h1:OUb8soeTG5+mRWieRyS/OyNU7Xl0+4wr4kPKKPa/WUQ=
github.com/a-h/parse v0.0.42/go.mod h1:X9OHJ1IjgakwZoDSoHYhdtKKD0zXZ2agpoIztPAA95w=
github.com/a-h/templ v0.3.1118 h1:rZv90g1xVb7ieNz4j5WK6yQePZfsg7j7fVvP8qVmeJI=
github.com/a-h/templ v0.3.1118/go.mod h1:ttKggixbDULrwkJzfEO5fa4IPGTKiRt3qP09zjPuCS4=
+github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/andybalholm/brotli v1.3.0 h1:IdkhjSe/+34U+fP7FSR2Q6Poj1hnHUa2GoWmzXJd6qY=
github.com/andybalholm/brotli v1.3.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI=
@@ -28,6 +31,30 @@ github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
+github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
+github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
+github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A=
+github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA=
+github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
+github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
+github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
+github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A=
+github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
+github.com/btcsuite/btcd/btcutil v1.1.5 h1:+wER79R5670vs/ZusMTF1yTcRYE5GUsFbdjdisflzM8=
+github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00=
+github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
+github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
+github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ=
+github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
+github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
+github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
+github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
+github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
+github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
+github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
+github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
+github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
+github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M=
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE=
@@ -48,17 +75,30 @@ github.com/cli/browser v1.3.0 h1:LejqCrpWr+1pRqmEPDGnTZOjsMe7sehifLynZJuqJpo=
github.com/cli/browser v1.3.0/go.mod h1:HH8s+fOAxjhQoBUAsKuPCbqUuxZDhQ2/aD+SzsEfBTk=
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
+github.com/coder/websocket v1.8.15 h1:6B2JPeOGlpff2Uz6vOEH1Vzpi0iUz20A+lPVhPHtNUA=
+github.com/coder/websocket v1.8.15/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
github.com/coreos/go-oidc/v3 v3.21.0 h1:wZo4Q9Pum8dYEj0eMUPrqR+kvuGkeUplbLpNCkBqoWM=
github.com/coreos/go-oidc/v3 v3.21.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4=
+github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
+github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8=
+github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
+github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
+github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc=
+github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40=
+github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
github.com/dustin/go-humanize v1.1.0 h1:dbKTrvD0klcbBV/h4AWJdMuZogJACoMlvWIWZ5b2xWg=
github.com/dustin/go-humanize v1.1.0/go.mod h1:hc1CvRkJMsgxqjmjMQF3QNRAZBwY8AXBAzKYoSX9sFI=
+github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
github.com/eclipse/paho.mqtt.golang v1.5.1 h1:/VSOv3oDLlpqR2Epjn1Q7b2bSTplJIeV2ISgCl2W7nE=
github.com/eclipse/paho.mqtt.golang v1.5.1/go.mod h1:1/yJCneuyOoCOzKSsOTUc0AJfpsItBGWvYpBLimhArU=
github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w=
github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho=
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
github.com/gabriel-vasile/mimetype v1.4.16 h1:5izNFuvA37st1dDRAcA7TtmngBmRgiIPDmTtiEvjx1E=
@@ -89,17 +129,30 @@ github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0kt
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
+github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gosnmp/gosnmp v1.47.0 h1:nQ0H9erruu03QP0lviAJ6vB6iiIGE0R5u73MKFr6QPs=
github.com/gosnmp/gosnmp v1.47.0/go.mod h1:LWPVcDKeRsiioQGeITGTQha4mdlx9lgmRmXz6zGINQ4=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
@@ -108,10 +161,16 @@ github.com/jackc/pgx/v5 v5.13.0 h1:Hl08k64maU0nrRyVUEbwCnK6/gT0EhMrtAqBHz9/gA4=
github.com/jackc/pgx/v5 v5.13.0/go.mod h1:u2Fi6no03HCSBYE+ZVdLxbwdu3xyi2vU+K/YNJioSds=
github.com/jackc/puddle/v2 v2.2.3 h1:f8HoREISb3l5eO9coPgK7U3hKLhWGokOFVcThl5jrao=
github.com/jackc/puddle/v2 v2.2.3/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
+github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
+github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg=
github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
+github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
+github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
+github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
+github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/klauspost/compress v1.20.4 h1:dD0v/bvxtjCBqQu6sx1TNWkalEY5lNTIe+HY9w8TeNI=
github.com/klauspost/compress v1.20.4/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
github.com/klauspost/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV913Dw=
@@ -130,6 +189,8 @@ github.com/letsencrypt/pebble/v2 v2.10.1 h1:oKHx3lgN4e5Nno2LKTMrVx+b+NkDptkO9aDi
github.com/letsencrypt/pebble/v2 v2.10.1/go.mod h1:KtYhQ4YTjT5MtoCZ6RTCXlbrrz6cKyXROCuTpIUDJFY=
github.com/libdns/libdns v1.1.1 h1:wPrHrXILoSHKWJKGd0EiAVmiJbFShguILTg9leS/P/U=
github.com/libdns/libdns v1.1.1/go.mod h1:4Bj9+5CQiNMVGf87wjX4CY3HQJypUHRuLvlsfsZqLWQ=
+github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
+github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
github.com/mattn/go-colorable v0.1.16 h1:+2YjeAe7xP1OQbZW1jERPWWCDLlNqFNCvjiqGiAt84A=
github.com/mattn/go-colorable v0.1.16/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI=
@@ -151,10 +212,21 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/natefinch/atomic v1.0.1 h1:ZPYKxkqQOx3KZ+RsbnP/YsgvxWQPGxjC0oBt2AhwV0A=
github.com/natefinch/atomic v1.0.1/go.mod h1:N/D/ELrljoqDyT3rZrsUmtsuzvHkeB/wWjHV22AZRbM=
+github.com/nbd-wtf/go-nostr v0.52.3 h1:Xd87pXfJEJRXHpM+fLjQQln8dBNNaoPA10V7BbyP4KI=
+github.com/nbd-wtf/go-nostr v0.52.3/go.mod h1:4avYoc9mDGZ9wHsvCOhHH9vPzKucCfuYBtJUSpHTfNk=
github.com/ncruces/go-strftime v1.1.0 h1:vtPmPWMkb539RGV9WpWT9EwJGvrOCKvMNI4obWL47Hk=
github.com/ncruces/go-strftime v1.1.0/go.mod h1:yVaq7iwCN09vHRrKBrrflXT0M9tTMG2KmZ9Fj7xeG/g=
github.com/nicksnyder/go-i18n/v2 v2.7.0 h1:oiVQUmuCeNggvm/fUVb6/R0aP82BDVphZnmVHwut+J0=
github.com/nicksnyder/go-i18n/v2 v2.7.0/go.mod h1:ZMYiWg8ndQSGNk4zbzbyJjrrVjQjuQ8pERFrnBik+c8=
+github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
+github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
+github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
+github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/pierrec/lz4/v4 v4.1.33 h1:GjG1TJ1V4IzKP8L96muuuDNpTwd7D+l2ccXrjAbe014=
@@ -166,6 +238,8 @@ github.com/pquerna/otp v1.5.0 h1:NMMR+WrmaqXU4EzdGJEE1aUUI0AMRzsp96fFFWNPwxs=
github.com/pquerna/otp v1.5.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
github.com/pressly/goose/v3 v3.30.1 h1:KO28meBdbAUIdMbTP7bl9dp1FYZGXcYWb2O7miT09lE=
github.com/pressly/goose/v3 v3.30.1/go.mod h1:CHGwuG2acDerUaXwz2i5T18VSauXpYDiL4WxzDvcOIM=
+github.com/puzpuzpuz/xsync/v3 v3.5.1 h1:GJYJZwO6IdxN/IKbneznS6yPkVC+c3zyY/j19c++5Fg=
+github.com/puzpuzpuz/xsync/v3 v3.5.1/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA=
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=
@@ -189,6 +263,7 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
@@ -196,6 +271,14 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
+github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
+github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
+github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
+github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
+github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
+github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
+github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
+github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/twmb/franz-go v1.22.3 h1:RHe35s34pKefMLyL+ZYJ6mQVtfFZz4zHDHVkTyACur0=
@@ -243,16 +326,25 @@ go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM=
go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/arch v0.22.0 h1:c/Zle32i5ttqRXjdLyyHZESLD/bB90DCU1g9l/0YBDI=
golang.org/x/arch v0.22.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
+golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c=
golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U=
+golang.org/x/exp v0.0.0-20261109185158-a52e3aef5920 h1:qr+tk4P56rtbVVAJDyAr5LAOiaD/XhZCoRTr4SfLxAk=
+golang.org/x/exp v0.0.0-20261109185158-a52e3aef5920/go.mod h1:J3U+E8RzytcGvwz+uJuAP4zULJ2TkAQBnmPZMexpdXs=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.43.0 h1:MFuq5J6s35W9D3IjkwyWc9vHh0nENOrt5K8Iof4ofmg=
golang.org/x/mod v0.43.0/go.mod h1:4ec1JnuyBz5+FIVhg86UsA39YG8BpnrZdJYSNHmGzHY=
+golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
@@ -261,12 +353,21 @@ golang.org/x/net v0.63.0 h1:HCoTmNh9EpD1PpK8gBNFY4gcTY4N+KQEO8ylfIKqFJ0=
golang.org/x/net v0.63.0/go.mod h1:15JLg3IX1bLjHK264EZQEbIpTiR/KVLuo9CTRWd0pig=
golang.org/x/oauth2 v0.38.0 h1:uW7XQbcu1eoiQS7uMJvLOjPMl04bTbmY1VeRPxvbspI=
golang.org/x/oauth2 v0.38.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -282,6 +383,7 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
@@ -294,20 +396,33 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
-golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs=
-golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs=
+golang.org/x/tools v0.52.1-0.20261106145633-d407941a339a h1:Yqozs0FNPRoPGS4hNGlrNwRENWr5H5nVG9sN/f+5640=
+golang.org/x/tools v0.52.1-0.20261106145633-d407941a339a/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c h1:XXChExL+Tm7Ubp0x0VXUEncPLHrkXIgoVWqnxmKNbAA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
google.golang.org/grpc v1.85.0 h1:BPBCfuVRQ1qvBhKDOq9uvQllMvO59rKsYhXpp7Dd8vw=
google.golang.org/grpc v1.85.0/go.mod h1:0rQrOD58yjal/0EaVbGBANindixsCZNQPDV3VKtaKuQ=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/internal/api/console.go b/internal/api/console.go
index b409472..fc7595b 100644
--- a/internal/api/console.go
+++ b/internal/api/console.go
@@ -709,7 +709,7 @@ func (s *Server) channelsView(c *gin.Context, p *principal, page web.Page, me we
v := web.ChannelsView{EmailAvailable: s.smtp != nil, CanWrite: p.Grants.Can(authz.NotificationsWrite), Languages: s.catalog.Supported()}
ctx2 := c.Request.Context()
for _, pr := range notify.Providers {
- opt := web.ProviderOption{Type: pr.Type}
+ opt := web.ProviderOption{Type: pr.Type, Group: pr.Group}
if help := i18n.T(ctx2, "channels.help_"+pr.Type); help != "channels.help_"+pr.Type {
opt.Help = help
}
@@ -721,6 +721,14 @@ func (s *Server) channelsView(c *gin.Context, p *principal, page web.Page, me we
}
v.Providers = append(v.Providers, opt)
}
+ // By group, then by name; the first is preselected.
+ groupOrder := []string{"chat", "push", "sms", "email", "incident", "other"}
+ slices.SortStableFunc(v.Providers, func(a, b web.ProviderOption) int {
+ if d := slices.Index(groupOrder, a.Group) - slices.Index(groupOrder, b.Group); d != 0 {
+ return d
+ }
+ return strings.Compare(strings.ToLower(i18n.T(ctx2, "channels.type_"+a.Type)), strings.ToLower(i18n.T(ctx2, "channels.type_"+b.Type)))
+ })
for _, r := range rows {
cv := viewChannel(r)
target := cv.URL
diff --git a/internal/api/providers.go b/internal/api/providers.go
index 0405872..824350d 100644
--- a/internal/api/providers.go
+++ b/internal/api/providers.go
@@ -129,7 +129,7 @@ func (s *Server) openProviderSettings(typ string, raw []byte) (map[string]string
func (s *Server) messageFor(ev notify.Event, locale string) notify.Message {
l := s.catalog.Match(locale)
data := map[string]any{"Monitor": ev.Monitor.Name}
- m := notify.Message{Event: ev.Kind, Key: ev.IncidentID}
+ m := notify.Message{Event: ev.Kind, Key: ev.IncidentID, Monitor: ev.Monitor.Name, MonitorID: ev.Monitor.ID, Target: ev.Monitor.Target}
var lines []string
switch ev.Kind {
case notify.Opened:
diff --git a/internal/api/providers_test.go b/internal/api/providers_test.go
index 06c8cfa..6b4f4f7 100644
--- a/internal/api/providers_test.go
+++ b/internal/api/providers_test.go
@@ -99,7 +99,17 @@ func TestProviderChannel(t *testing.T) {
if !strings.Contains(bodies[0], "Test von UptimeSebi") || !strings.Contains(bodies[1], `"chat_id":"-100999"`) {
t.Errorf("telegram bodies = %v", bodies)
}
- if _, _, page := owner.page("/settings/channels"); !strings.Contains(page, `name="settings.bot_token"`) || !strings.Contains(page, "-100999") {
+ _, _, page := owner.page("/settings/channels")
+ if !strings.Contains(page, `name="settings.bot_token"`) || !strings.Contains(page, "-100999") {
t.Error("the channels page lacks the service form or the channel")
}
+ // Services are grouped, and every one has its settings form.
+ if !strings.Contains(page, ``) {
+ t.Error("the services are not grouped")
+ }
+ for _, p := range notify.Providers {
+ if !strings.Contains(page, ` 0 {
+ t["mentioned_mobile_list"] = mobiles
+ }
+ reply, err := c.callJSON(ctx, http.MethodPost, "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="+url.QueryEscape(cfg["bot_key"]), nil,
+ map[string]any{"msgtype": "text", "text": t})
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if str(v["errcode"]) != "0" {
+ return "WeCom: " + str(v["errmsg"])
+ }
+ return ""
+ })
+ }},
+ {Type: "yunzhijia", Group: "chat", Fields: []Field{urlField("webhook_url", true, ""), secret("token", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ u := cfg["webhook_url"] + "?yzjtype=0&yzjtoken=" + url.QueryEscape(cfg["token"])
+ reply, err := c.callJSON(ctx, http.MethodPost, u, nil, map[string]any{"content": m.text()})
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if v["success"] != true {
+ return "Yunzhijia: " + str(v["errmsg"])
+ }
+ return ""
+ })
+ }},
+ {Type: "zohocliq", Group: "chat", Fields: []Field{secretURL("webhook_url")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, map[string]any{"text": m.text()})
+ }},
+ {Type: "threema", Group: "chat", Fields: []Field{
+ text("gateway_id", true), secret("gateway_secret", true),
+ {Name: "recipient_type", Kind: "select", Options: []string{"identity", "phone", "email"}, Default: "identity"},
+ text("recipient", true),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ v := url.Values{"from": {cfg["gateway_id"]}, "secret": {cfg["gateway_secret"]}, "text": {m.text()}}
+ switch cfg["recipient_type"] {
+ case "phone":
+ v.Set("phone", cfg["recipient"])
+ case "email":
+ v.Set("email", cfg["recipient"])
+ default:
+ v.Set("to", cfg["recipient"])
+ }
+ _, err := c.form(ctx, "https://msgapi.threema.ch/send_simple", nil, v)
+ return err
+ }},
+ {Type: "evolution", Group: "chat", Fields: []Field{
+ urlField("api_url", true, ""), secret("api_key", true), text("instance", true), text("recipient", true),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // Evolution API, a WhatsApp gateway.
+ u := trimURL(cfg["api_url"]) + "/message/sendText/" + url.PathEscape(cfg["instance"])
+ return c.json(ctx, http.MethodPost, u, http.Header{"apikey": {cfg["api_key"]}}, map[string]any{"number": cfg["recipient"], "text": m.text()})
+ }},
+ {Type: "waha", Group: "chat", Fields: []Field{
+ urlField("api_url", true, ""), secret("api_key", false), text("session", true), text("chat_id", true),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ return c.json(ctx, http.MethodPost, trimURL(cfg["api_url"])+"/api/sendText", http.Header{"X-Api-Key": {cfg["api_key"]}},
+ map[string]any{"session": cfg["session"], "chatId": cfg["chat_id"], "text": m.text()})
+ }},
+ {Type: "whapi", Group: "chat", Fields: []Field{secret("api_token", true), text("recipient", true), urlField("api_url", false, "https://gate.whapi.cloud")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ return c.json(ctx, http.MethodPost, trimURL(or(cfg["api_url"], "https://gate.whapi.cloud"))+"/messages/text", bearer(cfg["api_token"]),
+ map[string]any{"to": cfg["recipient"], "body": m.text()})
+ }},
+ {Type: "openwa", Group: "chat", Fields: []Field{
+ urlField("api_url", true, ""), secret("api_key", true), text("session", true), text("chat_ids", true),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ u := trimURL(cfg["api_url"]) + "/api/sessions/" + url.PathEscape(cfg["session"]) + "/messages/send-text"
+ for _, id := range list(cfg["chat_ids"]) {
+ if err := c.json(ctx, http.MethodPost, u, http.Header{"X-Api-Key": {cfg["api_key"]}}, map[string]any{"chatId": id, "text": m.text()}); err != nil {
+ return err
+ }
+ }
+ return nil
+ }},
+ {Type: "onesender", Group: "chat", Fields: []Field{
+ urlField("api_url", true, ""), secret("api_token", true), messageTypeField, text("recipient", true),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ to, kind := cfg["recipient"]+"@s.whatsapp.net", "individual"
+ if cfg["message_type"] == "group" {
+ to, kind = cfg["recipient"]+"@g.us", "group"
+ }
+ return c.json(ctx, http.MethodPost, cfg["api_url"], bearer(cfg["api_token"]), map[string]any{
+ "to": to, "type": "text", "recipient_type": kind, "text": map[string]any{"body": m.text()},
+ })
+ }},
+ {Type: "messenger360", Group: "chat", Fields: []Field{secret("api_token", true), text("recipients", false), text("group_ids", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // 360messenger, a WhatsApp gateway.
+ recipients, groups := list(cfg["recipients"]), list(cfg["group_ids"])
+ if len(recipients)+len(groups) == 0 {
+ return fmt.Errorf("no recipient or group set")
+ }
+ h := bearer(cfg["api_token"])
+ for _, r := range recipients {
+ if err := c.json(ctx, http.MethodPost, "https://api.360messenger.com/v2/sendMessage", h, map[string]any{"phonenumber": r, "text": m.text()}); err != nil {
+ return err
+ }
+ }
+ for _, g := range groups {
+ if err := c.json(ctx, http.MethodPost, "https://api.360messenger.com/v2/sendGroup", h, map[string]any{"groupId": g, "text": m.text()}); err != nil {
+ return err
+ }
+ }
+ return nil
+ }},
+ {Type: "nostr", Group: "chat", Fields: []Field{secret("sender_nsec", true), text("recipients", true), text("relays", true)}, send: sendNostr},
+ {Type: "homeassistant", Group: "chat", Fields: []Field{urlField("server_url", true, ""), secret("access_token", true), text("service", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // A notify service such as mobile_app_phone; "notify" reaches
+ // the default ones.
+ u := trimURL(cfg["server_url"]) + "/api/services/notify/" + url.PathEscape(or(cfg["service"], "notify"))
+ body := map[string]any{"title": m.Title, "message": m.Body + "\n" + m.URL}
+ if cfg["service"] != "persistent_notification" {
+ body["data"] = map[string]any{"name": m.Monitor, "status": m.status(), "url": m.URL}
+ }
+ return c.json(ctx, http.MethodPost, u, bearer(cfg["access_token"]), body)
+ }},
+ {Type: "indigo", Group: "chat", Fields: []Field{urlField("server_url", true, ""), secret("api_key", true), text("variable_id", false), text("action_group_id", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // Indigo home automation: set a variable to the message and run
+ // an action group.
+ variable, _ := strconv.Atoi(cfg["variable_id"])
+ group, _ := strconv.Atoi(cfg["action_group_id"])
+ if variable == 0 && group == 0 {
+ return fmt.Errorf("set a variable ID, an action group ID or both")
+ }
+ u := trimURL(cfg["server_url"]) + "/v2/api/command"
+ h := bearer(cfg["api_key"])
+ if variable != 0 {
+ if err := c.json(ctx, http.MethodPost, u, h, map[string]any{"id": "uptimesebi", "message": "indigo.variable.updateValue",
+ "objectId": variable, "parameters": map[string]any{"value": m.text()}}); err != nil {
+ return err
+ }
+ }
+ if group != 0 {
+ return c.json(ctx, http.MethodPost, u, h, map[string]any{"id": "uptimesebi", "message": "indigo.actionGroup.execute", "objectId": group})
+ }
+ return nil
+ }},
+ {Type: "googlesheets", Group: "chat", Fields: []Field{secretURL("webhook_url")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // A Google Apps Script web app appending rows.
+ return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, map[string]any{
+ "timestamp": time.Now().UTC().Format(time.RFC3339), "status": strings.ToUpper(m.status()),
+ "monitorName": or(m.Monitor, "N/A"), "monitorUrl": or(m.Target, "N/A"), "message": m.Title + "\n" + m.Body,
+ })
+ }},
+ {Type: "callmebot", Group: "chat", Fields: []Field{secretURL("endpoint_url")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // The URL CallMeBot hands out, with phone and API key.
+ _, err := c.get(ctx, cfg["endpoint_url"], nil, url.Values{"text": {m.text()}})
+ return err
+ }},
+}
+
+func randomHex(n int) string {
+ b := make([]byte, n)
+ _, _ = rand.Read(b)
+ return hex.EncodeToString(b)
+}
diff --git a/internal/notify/email.go b/internal/notify/email.go
new file mode 100644
index 0000000..eb3c321
--- /dev/null
+++ b/internal/notify/email.go
@@ -0,0 +1,131 @@
+package notify
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// Email delivery services reached over their APIs instead of SMTP.
+
+func emailFields(extra ...Field) []Field {
+ return append(extra,
+ text("from_email", true), text("from_name", false), text("to_email", true),
+ text("cc_email", false), text("bcc_email", false), text("subject", false),
+ )
+}
+
+func subject(cfg map[string]string, m Message) string { return or(cfg["subject"], m.Title) }
+
+func addresses(s string, as func(string) any) []any {
+ var out []any
+ for _, a := range list(s) {
+ out = append(out, as(a))
+ }
+ return out
+}
+
+func emailObj(a string) any { return map[string]string{"email": a} }
+
+var emailProviders = []Provider{
+ {Type: "brevo", Group: "email", Fields: emailFields(secret("api_key", true)),
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ body := map[string]any{
+ "sender": map[string]any{"email": cfg["from_email"], "name": or(cfg["from_name"], "UptimeSebi")},
+ "to": addresses(cfg["to_email"], emailObj),
+ "subject": subject(cfg, m),
+ "textContent": m.text(),
+ }
+ if cc := addresses(cfg["cc_email"], emailObj); cc != nil {
+ body["cc"] = cc
+ }
+ if bcc := addresses(cfg["bcc_email"], emailObj); bcc != nil {
+ body["bcc"] = bcc
+ }
+ return c.json(ctx, http.MethodPost, "https://api.brevo.com/v3/smtp/email", http.Header{"api-key": {cfg["api_key"]}}, body)
+ }},
+ {Type: "resend", Group: "email", Fields: emailFields(secret("api_key", true)),
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ body := map[string]any{
+ "from": or(cfg["from_name"], "UptimeSebi") + " <" + cfg["from_email"] + ">", "to": list(cfg["to_email"]),
+ "subject": subject(cfg, m), "text": m.text(),
+ }
+ if cc := list(cfg["cc_email"]); cc != nil {
+ body["cc"] = cc
+ }
+ if bcc := list(cfg["bcc_email"]); bcc != nil {
+ body["bcc"] = bcc
+ }
+ return c.json(ctx, http.MethodPost, "https://api.resend.com/emails", bearer(cfg["api_key"]), body)
+ }},
+ {Type: "sendgrid", Group: "email", Fields: emailFields(secret("api_key", true)),
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ p := map[string]any{"to": addresses(cfg["to_email"], emailObj)}
+ if cc := addresses(cfg["cc_email"], emailObj); cc != nil {
+ p["cc"] = cc
+ }
+ if bcc := addresses(cfg["bcc_email"], emailObj); bcc != nil {
+ p["bcc"] = bcc
+ }
+ return c.json(ctx, http.MethodPost, "https://api.sendgrid.com/v3/mail/send", bearer(cfg["api_key"]), map[string]any{
+ "personalizations": []any{p},
+ "from": map[string]any{"email": cfg["from_email"], "name": or(cfg["from_name"], "UptimeSebi")},
+ "subject": subject(cfg, m),
+ "content": []map[string]any{{"type": "text/plain", "value": m.text()}},
+ })
+ }},
+ {Type: "turbosmtp", Group: "email", Fields: emailFields(
+ text("consumer_key", true), secret("consumer_secret", true),
+ Field{Name: "region", Kind: "select", Options: []string{"us", "eu"}, Default: "us"},
+ ), send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ host := "api.turbo-smtp.com"
+ if cfg["region"] == "eu" {
+ host = "api.eu.turbo-smtp.com"
+ }
+ body := map[string]any{
+ "from": cfg["from_email"], "to": strings.Join(list(cfg["to_email"]), ","), "subject": subject(cfg, m), "content": m.text(),
+ }
+ if cc := list(cfg["cc_email"]); cc != nil {
+ body["cc"] = strings.Join(cc, ",")
+ }
+ if bcc := list(cfg["bcc_email"]); bcc != nil {
+ body["bcc"] = strings.Join(bcc, ",")
+ }
+ h := http.Header{"consumerKey": {cfg["consumer_key"]}, "consumerSecret": {cfg["consumer_secret"]}}
+ return c.json(ctx, http.MethodPost, "https://"+host+"/api/v2/mail/send", h, body)
+ }},
+ {Type: "microsoftgraph", Group: "email", Fields: []Field{
+ text("tenant_id", true), text("client_id", true), secret("client_secret", true), text("mailbox", true),
+ text("to_email", true), text("cc_email", false), text("bcc_email", false), text("subject", false),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // An app registration with the Mail.Send application permission
+ // sends as the mailbox.
+ reply, err := c.form(ctx, "https://login.microsoftonline.com/"+url.PathEscape(cfg["tenant_id"])+"/oauth2/v2.0/token", nil, url.Values{
+ "client_id": {cfg["client_id"]}, "client_secret": {cfg["client_secret"]},
+ "scope": {"https://graph.microsoft.com/.default"}, "grant_type": {"client_credentials"},
+ })
+ if err != nil {
+ return err
+ }
+ var tok struct {
+ AccessToken string `json:"access_token"`
+ }
+ if json.Unmarshal(reply, &tok) != nil || tok.AccessToken == "" {
+ return errors.New("Microsoft Entra issued no access token")
+ }
+ recipients := func(s string) []any {
+ return addresses(s, func(a string) any { return map[string]any{"emailAddress": map[string]string{"address": a}} })
+ }
+ return c.json(ctx, http.MethodPost, "https://graph.microsoft.com/v1.0/users/"+url.PathEscape(cfg["mailbox"])+"/sendMail", bearer(tok.AccessToken),
+ map[string]any{
+ "message": map[string]any{
+ "subject": subject(cfg, m), "body": map[string]any{"contentType": "Text", "content": m.text()},
+ "toRecipients": recipients(cfg["to_email"]), "ccRecipients": recipients(cfg["cc_email"]), "bccRecipients": recipients(cfg["bcc_email"]),
+ },
+ "saveToSentItems": false,
+ })
+ }},
+}
diff --git a/internal/notify/incident.go b/internal/notify/incident.go
new file mode 100644
index 0000000..a58efc4
--- /dev/null
+++ b/internal/notify/incident.go
@@ -0,0 +1,228 @@
+package notify
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "net/http"
+ "net/url"
+ "strings"
+ "time"
+)
+
+// Incident management and operations tools. Where a service pairs alerts
+// with their resolution, the incident ID is the key.
+
+// kumaPayload is the body Uptime Kuma sends, which some services accept
+// as a format of their own ("uptimekuma" integrations).
+func kumaPayload(m Message) map[string]any {
+ p := map[string]any{"msg": m.Title + "\n" + m.Body}
+ if m.Event != Test {
+ status := 0
+ if m.Event == Resolved {
+ status = 1
+ }
+ p["heartbeat"] = map[string]any{
+ "status": status, "msg": m.Body, "time": time.Now().UTC().Format(time.DateTime),
+ "monitorID": m.MonitorID.String(), "incidentID": m.Key.String(),
+ }
+ p["monitor"] = map[string]any{"id": m.MonitorID.String(), "name": m.Monitor, "url": m.Target, "consoleUrl": m.URL}
+ }
+ return p
+}
+
+var severityField = func(options []string, def string) Field {
+ return Field{Name: "severity", Kind: "select", Options: options, Default: def}
+}
+
+var incidentProviders = []Provider{
+ {Type: "alerta", Group: "incident", Fields: []Field{
+ urlField("api_url", true, ""), secret("api_key", true), text("environment", true),
+ severityField([]string{"critical", "major", "minor", "warning"}, "critical"),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ severity := cfg["severity"]
+ if m.Event == Resolved {
+ severity = "normal"
+ }
+ return c.json(ctx, http.MethodPost, cfg["api_url"], http.Header{"Authorization": {"Key " + cfg["api_key"]}}, map[string]any{
+ "environment": cfg["environment"], "severity": or(severity, "critical"), "correlate": []string{"service_up", "service_down"},
+ "service": []string{"UptimeSebi"}, "resource": or(m.Monitor, "UptimeSebi"), "event": "service_" + m.status(),
+ "group": "uptimesebi", "value": m.status(), "text": m.Title + "\n" + m.Body, "origin": "uptimesebi",
+ "tags": []string{"uptimesebi"}, "type": "uptimesebiAlert", "attributes": map[string]any{"url": m.URL},
+ })
+ }},
+ {Type: "alertnow", Group: "incident", Fields: []Field{secretURL("webhook_url")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ status, typ := "open", "ERROR"
+ if m.Event == Resolved {
+ status, typ = "close", "INFO"
+ }
+ return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, map[string]any{
+ "summary": m.Title + " - " + m.Body + " >> " + m.URL, "status": status, "event_type": typ, "event_id": m.Key.String(),
+ })
+ }},
+ {Type: "flashduty", Group: "incident", Fields: []Field{secret("integration_key", true), severityField([]string{"Critical", "Warning", "Info"}, "Critical")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ u := cfg["integration_key"]
+ if !strings.HasPrefix(u, "http") {
+ u = "https://api.flashcat.cloud/event/push/alert/standard?integration_key=" + url.QueryEscape(u)
+ }
+ status := "Info"
+ switch m.Event {
+ case Opened:
+ status = or(cfg["severity"], "Critical")
+ case Resolved:
+ status = "Ok"
+ }
+ return c.json(ctx, http.MethodPost, u, nil, map[string]any{
+ "title": m.Title, "description": m.Body, "event_status": status, "alert_key": m.Key.String(),
+ "labels": map[string]string{"resource": m.Target, "check": m.Monitor},
+ })
+ }},
+ {Type: "goalert", Group: "incident", Fields: []Field{urlField("server_url", true, ""), secret("token", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ v := url.Values{"summary": {truncate(m.Title, 250)}, "details": {m.Body + "\n" + m.URL}, "dedup": {m.Key.String()}}
+ if m.Event == Resolved {
+ v.Set("action", "close")
+ }
+ _, err := c.form(ctx, trimURL(cfg["server_url"])+"/api/v2/generic/incoming?token="+url.QueryEscape(cfg["token"]), nil, v)
+ return err
+ }},
+ {Type: "grafanaoncall", Group: "incident", Fields: []Field{secretURL("webhook_url")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ state := "alerting"
+ if m.Event == Resolved {
+ state = "ok"
+ }
+ return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, map[string]any{
+ "title": m.Title, "message": m.Body, "state": state, "alert_uid": m.Key.String(), "link_to_upstream_details": m.URL,
+ })
+ }},
+ {Type: "heiioncall", Group: "incident", Fields: []Field{secret("api_key", true), text("trigger_id", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ action := "alert"
+ if m.Event == Resolved {
+ action = "resolve"
+ }
+ return c.json(ctx, http.MethodPost, "https://heiioncall.com/triggers/"+url.PathEscape(cfg["trigger_id"])+"/"+action, bearer(cfg["api_key"]),
+ map[string]any{"msg": m.Title + "\n" + m.Body, "url": m.URL, "name": m.Monitor})
+ }},
+ {Type: "jsm", Group: "incident", Fields: []Field{
+ text("cloud_id", true), text("email", true), secret("api_token", true),
+ {Name: "priority", Kind: "select", Options: []string{"P1", "P2", "P3", "P4", "P5"}, Default: "P3"},
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // Jira Service Management Operations (formerly Opsgenie).
+ base := "https://api.atlassian.com/jsm/ops/api/" + url.PathEscape(cfg["cloud_id"]) + "/v1/alerts"
+ h := basic(cfg["email"], cfg["api_token"])
+ alias := m.Key.String()
+ if m.Event == Resolved {
+ reply, err := c.get(ctx, base+"/alias", h, url.Values{"alias": {alias}})
+ if err != nil {
+ return err
+ }
+ var alert struct {
+ ID string `json:"id"`
+ }
+ if json.Unmarshal(reply, &alert) != nil || alert.ID == "" {
+ return errors.New("Jira Service Management: alert to close not found")
+ }
+ return c.json(ctx, http.MethodPost, base+"/"+url.PathEscape(alert.ID)+"/close", h, map[string]any{"source": "UptimeSebi"})
+ }
+ return c.json(ctx, http.MethodPost, base, h, map[string]any{
+ "message": truncate(m.Title, 130), "alias": alias, "description": m.Body + "\n" + m.URL,
+ "source": "UptimeSebi", "priority": or(cfg["priority"], "P3"), "tags": []string{"UptimeSebi"},
+ })
+ }},
+ {Type: "pagertree", Group: "incident", Fields: []Field{
+ secretURL("integration_url"),
+ {Name: "urgency", Kind: "select", Options: []string{"high", "critical", "medium", "low", "silent"}, Default: "high"},
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ event := "create"
+ if m.Event == Resolved {
+ event = "resolve"
+ }
+ return c.json(ctx, http.MethodPost, cfg["integration_url"], nil, map[string]any{
+ "event_type": event, "id": m.Key.String(), "title": m.Title, "description": m.Body + "\n" + m.URL, "urgency": or(cfg["urgency"], "high"),
+ })
+ }},
+ {Type: "signl4", Group: "incident", Fields: []Field{secretURL("webhook_url")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ p := kumaPayload(m)
+ p["title"], p["message"], p["X-S4-SourceSystem"], p["monitorUrl"] = m.Title, m.Body, "UptimeSebi", m.URL
+ if m.Event != Test {
+ p["X-S4-ExternalID"] = "UptimeSebi-" + m.Key.String()
+ p["X-S4-Status"] = map[string]string{"down": "new", "up": "resolved"}[m.status()]
+ }
+ return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, p)
+ }},
+ {Type: "splunk", Group: "incident", Fields: []Field{secretURL("rest_url"), severityField([]string{"CRITICAL", "WARNING", "INFO"}, "CRITICAL")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // Splunk On-Call (VictorOps) REST endpoint, including the
+ // routing key.
+ typ := or(cfg["severity"], "CRITICAL")
+ switch m.Event {
+ case Resolved:
+ typ = "RECOVERY"
+ case Test:
+ typ = "INFO"
+ }
+ return c.json(ctx, http.MethodPost, cfg["rest_url"], nil, map[string]any{
+ "message_type": typ, "entity_id": "UptimeSebi/" + m.Key.String(), "entity_display_name": m.Title,
+ "state_message": m.Body + "\n" + m.URL, "monitoring_tool": "UptimeSebi",
+ })
+ }},
+ {Type: "squadcast", Group: "incident", Fields: []Field{secretURL("webhook_url")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ body := map[string]any{"message": m.Title, "description": m.Body + "\n" + m.URL, "source": "uptimesebi", "tags": map[string]any{"AlertAddress": m.Target}}
+ if m.Event != Test {
+ body["event_id"] = m.Key.String()
+ body["status"] = map[string]string{"down": "trigger", "up": "resolve"}[m.status()]
+ }
+ return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, body)
+ }},
+ {Type: "trigv", Group: "incident", Fields: []Field{secret("api_key", true), text("channel", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ level := map[string]string{"down": "error", "up": "success"}[m.status()]
+ body := map[string]any{"channel": or(cfg["channel"], "general"), "title": truncate(m.Title, 255),
+ "description": truncate(m.Body, 1000), "level": or(level, "info")}
+ if m.URL != "" {
+ body["url"] = m.URL
+ }
+ return c.json(ctx, http.MethodPost, "https://api.trigv.com/v1/events", bearer(cfg["api_key"]), body)
+ }},
+ {Type: "halopsa", Group: "incident", Fields: []Field{secretURL("webhook_url"), text("username", false), secret("password", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ var h http.Header
+ if cfg["username"] != "" {
+ h = basic(cfg["username"], cfg["password"])
+ }
+ status := map[string]string{"down": "DOWN", "up": "UP"}[m.status()]
+ return c.json(ctx, http.MethodPost, cfg["webhook_url"], h, map[string]any{
+ "title": m.Title, "status": or(status, "NOTIFICATION"), "monitor": or(m.Monitor, "No Monitor"), "monitor_id": m.MonitorID.String(),
+ "message": m.Body + "\n" + m.URL, "timestamp": time.Now().UTC().Format(time.RFC3339),
+ })
+ }},
+ {Type: "flowtriq", Group: "incident", Fields: []Field{secretURL("webhook_url"), secret("api_key", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ var h http.Header
+ if cfg["api_key"] != "" {
+ h = http.Header{"X-API-Key": {cfg["api_key"]}}
+ }
+ status := map[string]string{"down": "down", "up": "up"}[m.status()]
+ return c.json(ctx, http.MethodPost, cfg["webhook_url"], h, map[string]any{
+ "source": "uptimesebi", "status": or(status, "info"), "monitor": or(m.Monitor, "Unknown"), "msg": m.Title + "\n" + m.Body,
+ })
+ }},
+ {Type: "keep", Group: "incident", Fields: []Field{urlField("server_url", true, ""), secret("api_key", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ return c.json(ctx, http.MethodPost, trimURL(cfg["server_url"])+"/alerts/event/uptimekuma", http.Header{"x-api-key": {cfg["api_key"]}}, kumaPayload(m))
+ }},
+ {Type: "opsimate", Group: "incident", Fields: []Field{urlField("server_url", true, ""), secret("api_token", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ return c.json(ctx, http.MethodPost, trimURL(cfg["server_url"])+"/api/v1/alerts/custom/uptimekuma", http.Header{"x-api-token": {cfg["api_token"]}}, kumaPayload(m))
+ }},
+ {Type: "pinglet", Group: "incident", Fields: []Field{urlField("publish_url", true, ""), secret("api_key", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ return c.json(ctx, http.MethodPost, trimURL(cfg["publish_url"])+"?rewrite=uptimekuma", bearer(cfg["api_key"]), kumaPayload(m))
+ }},
+}
diff --git a/internal/notify/nostr.go b/internal/notify/nostr.go
new file mode 100644
index 0000000..a250341
--- /dev/null
+++ b/internal/notify/nostr.go
@@ -0,0 +1,130 @@
+package notify
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "strings"
+ "time"
+
+ "github.com/coder/websocket"
+ "github.com/nbd-wtf/go-nostr"
+ "github.com/nbd-wtf/go-nostr/nip19"
+ "github.com/nbd-wtf/go-nostr/nip44"
+ "github.com/nbd-wtf/go-nostr/nip59"
+)
+
+// Nostr private messages (NIP-17): the message is sealed for each
+// recipient and gift-wrapped (NIP-59). Relays are reached over our own
+// WebSocket connections, so the network guard applies to them.
+
+func sendNostr(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ sk, err := nostrKey(cfg["sender_nsec"], "nsec")
+ if err != nil {
+ return err
+ }
+ pub, err := nostr.GetPublicKey(sk)
+ if err != nil {
+ return err
+ }
+ var events []nostr.Event
+ for _, r := range list(cfg["recipients"]) {
+ to, err := nostrKey(r, "npub")
+ if err != nil {
+ return err
+ }
+ rumor := nostr.Event{Kind: nostr.KindDirectMessage, Content: m.text(), Tags: nostr.Tags{{"p", to}}, CreatedAt: nostr.Now(), PubKey: pub}
+ rumor.ID = rumor.GetID()
+ wrap, err := nip59.GiftWrap(rumor, to,
+ func(plain string) (string, error) {
+ key, err := nip44.GenerateConversationKey(to, sk)
+ if err != nil {
+ return "", err
+ }
+ return nip44.Encrypt(plain, key)
+ },
+ func(e *nostr.Event) error { return e.Sign(sk) }, nil)
+ if err != nil {
+ return err
+ }
+ events = append(events, wrap)
+ }
+ if len(events) == 0 {
+ return errors.New("no recipient set")
+ }
+ var errs []error
+ delivered := 0
+ for _, relay := range list(cfg["relays"]) {
+ if err := c.publishNostr(ctx, relay, events); err != nil {
+ errs = append(errs, fmt.Errorf("%s: %w", relayHost(relay), err))
+ continue
+ }
+ delivered++
+ }
+ if delivered == 0 {
+ return errors.Join(append([]error{errors.New("no relay accepted the message")}, errs...)...)
+ }
+ return nil
+}
+
+// nostrKey decodes a bech32 key with prefix want to hex.
+func nostrKey(s, want string) (string, error) {
+ prefix, v, err := nip19.Decode(strings.TrimSpace(s))
+ if err != nil || prefix != want {
+ return "", fmt.Errorf("not an %s key", want)
+ }
+ return v.(string), nil
+}
+
+func relayHost(relay string) string {
+ h := strings.TrimPrefix(strings.TrimPrefix(relay, "wss://"), "ws://")
+ return strings.SplitN(h, "/", 2)[0]
+}
+
+// publishNostr sends events to a relay and waits for it to accept each.
+func (c *client) publishNostr(ctx context.Context, relay string, events []nostr.Event) error {
+ if !strings.HasPrefix(relay, "wss://") && !strings.HasPrefix(relay, "ws://") {
+ return errors.New("relays are wss:// URLs")
+ }
+ ctx, cancel := context.WithTimeout(ctx, 8*time.Second)
+ defer cancel()
+ conn, _, err := websocket.Dial(ctx, relay, &websocket.DialOptions{HTTPClient: c.hc})
+ if err != nil {
+ return err
+ }
+ defer func() { _ = conn.CloseNow() }()
+ for _, e := range events {
+ msg, _ := json.Marshal([]any{"EVENT", e})
+ if err := conn.Write(ctx, websocket.MessageText, msg); err != nil {
+ return err
+ }
+ for {
+ _, data, err := conn.Read(ctx)
+ if err != nil {
+ return err
+ }
+ var reply []json.RawMessage
+ if json.Unmarshal(data, &reply) != nil || len(reply) < 3 {
+ continue
+ }
+ var kind, id string
+ var ok bool
+ _ = json.Unmarshal(reply[0], &kind)
+ _ = json.Unmarshal(reply[1], &id)
+ _ = json.Unmarshal(reply[2], &ok)
+ if kind != "OK" || id != e.ID {
+ continue
+ }
+ if !ok {
+ var reason string
+ if len(reply) > 3 {
+ _ = json.Unmarshal(reply[3], &reason)
+ }
+ return errors.New("rejected: " + truncate(reason, 200))
+ }
+ break
+ }
+ }
+ return conn.Close(websocket.StatusNormalClosure, "")
+}
diff --git a/internal/notify/providers.go b/internal/notify/providers.go
index 4fcb3dd..5f09030 100644
--- a/internal/notify/providers.go
+++ b/internal/notify/providers.go
@@ -3,12 +3,15 @@ package notify
import (
"bytes"
"context"
+ "encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
+ "net"
"net/http"
"net/url"
+ "slices"
"strconv"
"strings"
"time"
@@ -29,6 +32,22 @@ type Message struct {
// Key identifies the incident across its events, for services that
// pair "opened" with "resolved" such as PagerDuty.
Key uuid.UUID
+ // Monitor, MonitorID and Target describe the monitor, for services
+ // with fields of their own for them.
+ Monitor string
+ MonitorID uuid.UUID
+ Target string
+}
+
+// status is "down", "up" or "test".
+func (m Message) status() string {
+ switch m.Event {
+ case Opened:
+ return "down"
+ case Resolved:
+ return "up"
+ }
+ return "test"
}
// Field is a setting of a provider. Secret fields are stored sealed and
@@ -45,7 +64,10 @@ type Field struct {
// Provider delivers messages to one kind of service.
type Provider struct {
- Type string
+ Type string
+ // Group sorts the service in forms: "chat", "push", "sms", "email" or
+ // "incident".
+ Group string
Fields []Field
send func(ctx context.Context, c *client, cfg map[string]string, m Message) error
}
@@ -68,12 +90,20 @@ func Lookup(t string) (Provider, bool) {
return Provider{}, false
}
-type client struct{ hc *http.Client }
+type client struct {
+ hc *http.Client
+ d *net.Dialer
+}
+
+// transport is replaced in tests to reach fixed service addresses.
+var transport = func(d *net.Dialer) http.RoundTripper {
+ return &http.Transport{DialContext: d.DialContext, DisableKeepAlives: true}
+}
func newClient(allowPrivate bool) *client {
d := netguard.Dialer(allowPrivate, 5*time.Second)
- return &client{hc: &http.Client{
- Transport: &http.Transport{DialContext: d.DialContext, DisableKeepAlives: true},
+ return &client{d: d, hc: &http.Client{
+ Transport: transport(d),
// Redirects would bypass the address the customer configured.
CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse },
}}
@@ -82,9 +112,16 @@ func newClient(allowPrivate bool) *client {
// do sends a request and turns non-2xx answers into errors that quote the
// start of the service's reply, which usually says what is wrong.
func (c *client) do(ctx context.Context, method, rawURL string, header http.Header, body io.Reader) error {
+ _, err := c.call(ctx, method, rawURL, header, body)
+ return err
+}
+
+// call is do returning the reply, for services that report failures in
+// successful answers.
+func (c *client) call(ctx context.Context, method, rawURL string, header http.Header, body io.Reader) ([]byte, error) {
req, err := http.NewRequestWithContext(ctx, method, rawURL, body)
if err != nil {
- return err
+ return nil, err
}
for k, vs := range header {
req.Header[k] = vs
@@ -95,29 +132,111 @@ func (c *client) do(ctx context.Context, method, rawURL string, header http.Head
if errors.As(err, &uerr) {
// The URL may carry a secret, as Telegram's bot token in the path:
// name only the host.
- return fmt.Errorf("%s: %w", req.URL.Host, uerr.Err)
+ return nil, fmt.Errorf("%s: %w", req.URL.Host, uerr.Err)
}
if err != nil {
- return err
+ return nil, err
}
defer func() { _ = resp.Body.Close() }()
- reply, _ := io.ReadAll(io.LimitReader(resp.Body, 512))
+ reply, _ := io.ReadAll(io.LimitReader(resp.Body, 64<<10))
if resp.StatusCode < 200 || resp.StatusCode > 299 {
- return fmt.Errorf("%s answered %d: %s", req.URL.Host, resp.StatusCode, strings.TrimSpace(string(reply)))
+ return nil, fmt.Errorf("%s answered %d: %s", req.URL.Host, resp.StatusCode, truncate(strings.TrimSpace(string(reply)), 300))
}
- return nil
+ return reply, nil
}
func (c *client) json(ctx context.Context, method, rawURL string, header http.Header, v any) error {
+ _, err := c.callJSON(ctx, method, rawURL, header, v)
+ return err
+}
+
+func (c *client) callJSON(ctx context.Context, method, rawURL string, header http.Header, v any) ([]byte, error) {
body, err := json.Marshal(v)
if err != nil {
- return err
+ return nil, err
}
if header == nil {
header = http.Header{}
}
header.Set("Content-Type", "application/json")
- return c.do(ctx, method, rawURL, header, bytes.NewReader(body))
+ return c.call(ctx, method, rawURL, header, bytes.NewReader(body))
+}
+
+// form posts URL-encoded values and returns the reply.
+func (c *client) form(ctx context.Context, rawURL string, header http.Header, v url.Values) ([]byte, error) {
+ if header == nil {
+ header = http.Header{}
+ }
+ header.Set("Content-Type", "application/x-www-form-urlencoded")
+ return c.call(ctx, http.MethodPost, rawURL, header, strings.NewReader(v.Encode()))
+}
+
+// get sends a GET with query parameters and returns the reply.
+func (c *client) get(ctx context.Context, rawURL string, header http.Header, q url.Values) ([]byte, error) {
+ if len(q) > 0 {
+ sep := "?"
+ if strings.Contains(rawURL, "?") {
+ sep = "&"
+ }
+ rawURL += sep + q.Encode()
+ }
+ return c.call(ctx, http.MethodGet, rawURL, header, nil)
+}
+
+// basic returns an Authorization header with HTTP basic credentials.
+func basic(user, password string) http.Header {
+ return http.Header{"Authorization": {"Basic " + base64.StdEncoding.EncodeToString([]byte(user+":"+password))}}
+}
+
+func bearer(token string) http.Header { return http.Header{"Authorization": {"Bearer " + token}} }
+
+// replyCheck decodes a JSON reply and fails with what bad reports, for
+// services that answer 200 to failed requests.
+func replyCheck(reply []byte, err error, bad func(map[string]any) string) error {
+ if err != nil {
+ return err
+ }
+ var v map[string]any
+ if json.Unmarshal(reply, &v) != nil {
+ return fmt.Errorf("unexpected answer: %s", truncate(string(reply), 200))
+ }
+ if msg := bad(v); msg != "" {
+ return errors.New(truncate(msg, 300))
+ }
+ return nil
+}
+
+// str formats a JSON value from a reply for messages and comparisons.
+func str(v any) string {
+ switch v := v.(type) {
+ case nil:
+ return ""
+ case string:
+ return v
+ case float64:
+ return strconv.FormatFloat(v, 'f', -1, 64)
+ }
+ b, _ := json.Marshal(v)
+ return string(b)
+}
+
+// list splits comma, semicolon or newline separated values.
+func list(s string) []string {
+ var out []string
+ for _, v := range strings.FieldsFunc(s, func(r rune) bool { return r == ',' || r == ';' || r == '\n' }) {
+ if v = strings.TrimSpace(v); v != "" {
+ out = append(out, v)
+ }
+ }
+ return out
+}
+
+// or returns s, or def when s is blank.
+func or(s, def string) string {
+ if strings.TrimSpace(s) == "" {
+ return def
+ }
+ return strings.TrimSpace(s)
}
// text joins title, body and link for services that take plain text.
@@ -138,14 +257,16 @@ var webhookField = Field{Name: "webhook_url", Required: true, Secret: true, Kind
// Providers lists the supported services. Webhook and email are handled by
// their own types; Apprise reaches the services not listed here.
-var Providers = []Provider{
- {Type: "slack", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+var Providers = slices.Concat(baseProviders, chatProviders, pushProviders, smsProviders, emailProviders, incidentProviders)
+
+var baseProviders = []Provider{
+ {Type: "slack", Group: "chat", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, map[string]any{"text": m.text()})
}},
- {Type: "discord", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ {Type: "discord", Group: "chat", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, map[string]any{"content": m.text(), "username": "UptimeSebi"})
}},
- {Type: "teams", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ {Type: "teams", Group: "chat", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
// Teams workflows take Adaptive Cards.
blocks := []map[string]any{{"type": "TextBlock", "text": m.Title, "weight": "Bolder", "size": "Medium", "wrap": true}}
if m.Body != "" {
@@ -160,20 +281,20 @@ var Providers = []Provider{
"type": "message", "attachments": []map[string]any{{"contentType": "application/vnd.microsoft.card.adaptive", "content": card}},
})
}},
- {Type: "googlechat", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ {Type: "googlechat", Group: "chat", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, map[string]any{"text": m.text()})
}},
- {Type: "mattermost", Fields: []Field{webhookField, {Name: "channel", Kind: "text"}}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ {Type: "mattermost", Group: "chat", Fields: []Field{webhookField, {Name: "channel", Kind: "text"}}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
body := map[string]any{"text": m.text(), "username": "UptimeSebi"}
if cfg["channel"] != "" {
body["channel"] = cfg["channel"]
}
return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, body)
}},
- {Type: "rocketchat", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ {Type: "rocketchat", Group: "chat", Fields: []Field{webhookField}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
return c.json(ctx, http.MethodPost, cfg["webhook_url"], nil, map[string]any{"text": m.text()})
}},
- {Type: "telegram", Fields: []Field{
+ {Type: "telegram", Group: "chat", Fields: []Field{
{Name: "bot_token", Required: true, Secret: true, Kind: "text"},
{Name: "chat_id", Required: true, Kind: "text"},
{Name: "thread_id", Kind: "number"},
@@ -189,7 +310,7 @@ var Providers = []Provider{
}
return c.json(ctx, http.MethodPost, api+"/bot"+cfg["bot_token"]+"/sendMessage", nil, body)
}},
- {Type: "matrix", Fields: []Field{
+ {Type: "matrix", Group: "chat", Fields: []Field{
{Name: "homeserver_url", Required: true, Kind: "url"},
{Name: "access_token", Required: true, Secret: true, Kind: "text"},
{Name: "room_id", Required: true, Kind: "text"},
@@ -199,7 +320,7 @@ var Providers = []Provider{
h := http.Header{"Authorization": {"Bearer " + cfg["access_token"]}}
return c.json(ctx, http.MethodPut, u, h, map[string]any{"msgtype": "m.text", "body": m.text()})
}},
- {Type: "ntfy", Fields: []Field{
+ {Type: "ntfy", Group: "push", Fields: []Field{
{Name: "server_url", Kind: "url", Default: "https://ntfy.sh"},
{Name: "topic", Required: true, Kind: "text"},
{Name: "priority", Kind: "select", Options: []string{"3", "1", "2", "4", "5"}, Default: "4"},
@@ -221,7 +342,7 @@ var Providers = []Provider{
}
return c.do(ctx, http.MethodPost, server+"/"+url.PathEscape(cfg["topic"]), h, strings.NewReader(m.Body))
}},
- {Type: "gotify", Fields: []Field{
+ {Type: "gotify", Group: "push", Fields: []Field{
{Name: "server_url", Required: true, Kind: "url"},
{Name: "app_token", Required: true, Secret: true, Kind: "text"},
{Name: "priority", Kind: "number", Default: "8"},
@@ -231,7 +352,7 @@ var Providers = []Provider{
return c.json(ctx, http.MethodPost, trimURL(cfg["server_url"])+"/message", h,
map[string]any{"title": m.Title, "message": m.Body + "\n" + m.URL, "priority": prio})
}},
- {Type: "pushover", Fields: []Field{
+ {Type: "pushover", Group: "push", Fields: []Field{
{Name: "user_key", Required: true, Secret: true, Kind: "text"},
{Name: "app_token", Required: true, Secret: true, Kind: "text"},
{Name: "priority", Kind: "select", Options: []string{"0", "-1", "1"}, Default: "1"},
@@ -247,13 +368,13 @@ var Providers = []Provider{
h := http.Header{"Content-Type": {"application/x-www-form-urlencoded"}}
return c.do(ctx, http.MethodPost, pushoverURL, h, strings.NewReader(form.Encode()))
}},
- {Type: "pushbullet", Fields: []Field{{Name: "access_token", Required: true, Secret: true, Kind: "text"}},
+ {Type: "pushbullet", Group: "push", Fields: []Field{{Name: "access_token", Required: true, Secret: true, Kind: "text"}},
send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
h := http.Header{"Access-Token": {cfg["access_token"]}}
return c.json(ctx, http.MethodPost, pushbulletURL, h,
map[string]any{"type": "note", "title": m.Title, "body": m.Body + "\n" + m.URL})
}},
- {Type: "signal", Fields: []Field{
+ {Type: "signal", Group: "chat", Fields: []Field{
{Name: "api_url", Required: true, Kind: "url"},
{Name: "number", Required: true, Kind: "text"},
{Name: "recipients", Required: true, Kind: "text"},
@@ -269,7 +390,7 @@ var Providers = []Provider{
return c.json(ctx, http.MethodPost, trimURL(cfg["api_url"])+"/v2/send", nil,
map[string]any{"message": m.text(), "number": cfg["number"], "recipients": recipients})
}},
- {Type: "pagerduty", Fields: []Field{
+ {Type: "pagerduty", Group: "incident", Fields: []Field{
{Name: "routing_key", Required: true, Secret: true, Kind: "text"},
{Name: "severity", Kind: "select", Options: []string{"critical", "error", "warning", "info"}, Default: "critical"},
}, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
@@ -288,7 +409,7 @@ var Providers = []Provider{
}
return c.json(ctx, http.MethodPost, pagerdutyURL, nil, body)
}},
- {Type: "opsgenie", Fields: []Field{
+ {Type: "opsgenie", Group: "incident", Fields: []Field{
{Name: "api_key", Required: true, Secret: true, Kind: "text"},
{Name: "region", Kind: "select", Options: []string{"us", "eu"}, Default: "us"},
{Name: "priority", Kind: "select", Options: []string{"P1", "P2", "P3", "P4", "P5"}, Default: "P2"},
@@ -307,7 +428,7 @@ var Providers = []Provider{
"priority": cfg["priority"], "source": "UptimeSebi",
})
}},
- {Type: "apprise", Fields: []Field{
+ {Type: "apprise", Group: "other", Fields: []Field{
{Name: "api_url", Required: true, Kind: "url"},
{Name: "urls", Secret: true, Kind: "text"},
{Name: "config_key", Kind: "text"},
diff --git a/internal/notify/push.go b/internal/notify/push.go
new file mode 100644
index 0000000..9a4e5af
--- /dev/null
+++ b/internal/notify/push.go
@@ -0,0 +1,171 @@
+package notify
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "regexp"
+)
+
+// Push services for phones and desktops.
+
+var serverChanTurbo = regexp.MustCompile(`^(?i)sctp(\d+)t`)
+
+var pushProviders = []Provider{
+ {Type: "bark", Group: "push", Fields: []Field{secretURL("endpoint_url"), text("group", false), text("sound", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // The endpoint includes the device key, e.g.
+ // https://api.day.app/KEY.
+ return c.json(ctx, http.MethodPost, trimURL(cfg["endpoint_url"]), nil, map[string]any{
+ "title": m.Title, "body": m.Body, "url": m.URL,
+ "group": or(cfg["group"], "UptimeSebi"), "sound": or(cfg["sound"], "telegraph"),
+ })
+ }},
+ {Type: "gorush", Group: "push", Fields: []Field{
+ urlField("server_url", true, ""), secret("device_token", true),
+ {Name: "platform", Kind: "select", Options: []string{"ios", "android", "huawei"}, Default: "ios"},
+ text("topic", false),
+ {Name: "priority", Kind: "select", Options: []string{"high", "normal"}, Default: "high"},
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ platform := map[string]int{"ios": 1, "android": 2, "huawei": 3}[cfg["platform"]]
+ return c.json(ctx, http.MethodPost, trimURL(cfg["server_url"])+"/api/push", nil, map[string]any{
+ "notifications": []map[string]any{{
+ "tokens": []string{cfg["device_token"]}, "platform": platform, "title": m.Title, "message": m.Body,
+ "priority": or(cfg["priority"], "high"), "topic": cfg["topic"],
+ }},
+ })
+ }},
+ {Type: "lunasea", Group: "push", Fields: []Field{
+ {Name: "target", Kind: "select", Options: []string{"device", "user"}, Default: "device"},
+ secret("target_id", true),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ target := "device"
+ if cfg["target"] == "user" {
+ target = "user"
+ }
+ return c.json(ctx, http.MethodPost, "https://notify.lunasea.app/v1/custom/"+target+"/"+url.PathEscape(cfg["target_id"]), nil,
+ map[string]any{"title": m.Title, "body": m.Body})
+ }},
+ {Type: "notifery", Group: "push", Fields: []Field{secret("api_key", true), text("group", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ body := map[string]any{"title": m.Title, "message": m.Body + "\n" + m.URL}
+ if cfg["group"] != "" {
+ body["group"] = cfg["group"]
+ }
+ switch m.Event {
+ case Opened:
+ body["code"] = 1
+ case Resolved:
+ body["code"] = 0
+ }
+ return c.json(ctx, http.MethodPost, "https://api.notifery.com/event", http.Header{"x-api-key": {cfg["api_key"]}}, body)
+ }},
+ {Type: "notifyapp", Group: "push", Fields: []Field{text("device_id", true), secret("token", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ u := "https://push.getnotifyapp.com/notify-json/" + url.PathEscape(cfg["device_id"]) + "?token=" + url.QueryEscape(cfg["token"])
+ return c.json(ctx, http.MethodPost, u, nil, map[string]any{"title": m.Title, "text": m.Body, "timeSensitive": m.Event == Opened})
+ }},
+ {Type: "pushdeer", Group: "push", Fields: []Field{secret("push_key", true), urlField("server_url", false, "https://api2.pushdeer.com")},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ reply, err := c.callJSON(ctx, http.MethodPost, trimURL(or(cfg["server_url"], "https://api2.pushdeer.com"))+"/message/push", nil,
+ map[string]any{"pushkey": cfg["push_key"], "text": m.Title, "desp": m.Body + "\n\n" + m.URL, "type": "markdown"})
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if e := str(v["error"]); e != "" {
+ return "PushDeer: " + e
+ }
+ return ""
+ })
+ }},
+ {Type: "pushplus", Group: "push", Fields: []Field{secret("send_key", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ reply, err := c.callJSON(ctx, http.MethodPost, "https://www.pushplus.plus/send", nil,
+ map[string]any{"token": cfg["send_key"], "title": m.Title, "content": m.Body + "\n" + m.URL, "template": "txt"})
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if str(v["code"]) != "200" {
+ return "PushPlus: " + str(v["msg"])
+ }
+ return ""
+ })
+ }},
+ {Type: "pushy", Group: "push", Fields: []Field{secret("api_key", true), text("device_token", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ return c.json(ctx, http.MethodPost, "https://api.pushy.me/push?api_key="+url.QueryEscape(cfg["api_key"]), nil, map[string]any{
+ "to": cfg["device_token"], "data": map[string]any{"message": m.Title, "url": m.URL},
+ "notification": map[string]any{"title": m.Title, "body": m.Body, "badge": 1, "sound": "ping.aiff"},
+ })
+ }},
+ {Type: "serverchan", Group: "push", Fields: []Field{secret("send_key", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ key := cfg["send_key"]
+ u := "https://sctapi.ftqq.com/" + url.PathEscape(key) + ".send"
+ // ServerChan³ keys name their own host.
+ if g := serverChanTurbo.FindStringSubmatch(key); g != nil {
+ u = "https://" + g[1] + ".push.ft07.com/send/" + url.PathEscape(key) + ".send"
+ }
+ return c.json(ctx, http.MethodPost, u, nil, map[string]any{"title": m.Title, "desp": m.Body + "\n\n" + m.URL})
+ }},
+ {Type: "signalgrid", Group: "push", Fields: []Field{secret("client_key", true), text("channel", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ typ := map[string]string{"down": "CRIT", "up": "SUCCESS"}[m.status()]
+ reply, err := c.form(ctx, "https://api.signalgrid.co/v1/push", nil, url.Values{
+ "client_key": {cfg["client_key"]}, "channel": {cfg["channel"]}, "title": {m.Title},
+ "body": {m.Body + "\n" + m.URL}, "type": {or(typ, "INFO")}, "critical": {"false"},
+ })
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if code := str(v["code"]); code != "" && code != "200" {
+ return "Signalgrid: " + str(v["text"])
+ }
+ return ""
+ })
+ }},
+ {Type: "spugpush", Group: "push", Fields: []Field{secret("template_key", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ return c.json(ctx, http.MethodPost, "https://push.spug.cc/send/"+url.PathEscape(cfg["template_key"]), nil,
+ map[string]any{"title": m.Title, "content": m.Body + "\n" + m.URL})
+ }},
+ {Type: "techulus", Group: "push", Fields: []Field{secret("api_key", true), text("channel", false), text("sound", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ body := map[string]any{"title": m.Title, "body": m.Body + "\n" + m.URL, "timeSensitive": m.Event == Opened}
+ if cfg["channel"] != "" {
+ body["channel"] = cfg["channel"]
+ }
+ if cfg["sound"] != "" {
+ body["sound"] = cfg["sound"]
+ }
+ return c.json(ctx, http.MethodPost, "https://push.techulus.com/api/v1/notify/"+url.PathEscape(cfg["api_key"]), nil, body)
+ }},
+ {Type: "wpush", Group: "push", Fields: []Field{secret("api_key", true), text("channel", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ reply, err := c.callJSON(ctx, http.MethodPost, "https://api.wpush.cn/api/v1/send", nil,
+ map[string]any{"title": m.Title, "content": m.Body + "\n" + m.URL, "apikey": cfg["api_key"], "channel": cfg["channel"]})
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if str(v["code"]) != "0" {
+ return "WPush: " + str(v["message"])
+ }
+ return ""
+ })
+ }},
+ {Type: "wxpusher", Group: "push", Fields: []Field{secret("spt", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // Simple push tokens, up to ten per request.
+ spts := list(cfg["spt"])
+ for i := 0; i < len(spts); i += 10 {
+ reply, err := c.callJSON(ctx, http.MethodPost, "https://wxpusher.zjiecode.com/api/send/message/simple-push", nil, map[string]any{
+ "content": m.text(), "summary": truncate(m.Title, 100), "contentType": 1, "sptList": spts[i:min(i+10, len(spts))],
+ })
+ if err := replyCheck(reply, err, func(v map[string]any) string {
+ if str(v["code"]) != "1000" {
+ return "WxPusher: " + str(v["msg"])
+ }
+ return ""
+ }); err != nil {
+ return err
+ }
+ }
+ if len(spts) == 0 {
+ return fmt.Errorf("no SPT set")
+ }
+ return nil
+ }},
+}
diff --git a/internal/notify/services_test.go b/internal/notify/services_test.go
new file mode 100644
index 0000000..cb7ed40
--- /dev/null
+++ b/internal/notify/services_test.go
@@ -0,0 +1,392 @@
+package notify
+
+import (
+ "context"
+ "crypto/hmac"
+ "crypto/sha256"
+ "encoding/base64"
+ "encoding/hex"
+ "encoding/json"
+ "io"
+ "net"
+ "net/http"
+ "net/http/httptest"
+ "net/url"
+ "strings"
+ "sync"
+ "testing"
+
+ "github.com/coder/websocket"
+ "github.com/google/uuid"
+ "github.com/nbd-wtf/go-nostr"
+ "github.com/nbd-wtf/go-nostr/nip19"
+ "github.com/nbd-wtf/go-nostr/nip44"
+ "github.com/nbd-wtf/go-nostr/nip59"
+)
+
+// call is a request a fake service received, with the host it was meant
+// for.
+type call struct {
+ Method, Host, Path string
+ Query url.Values
+ Header http.Header
+ Body string
+}
+
+func (c call) form() url.Values { v, _ := url.ParseQuery(c.Body); return v }
+
+func (c call) json() map[string]any {
+ var v map[string]any
+ _ = json.Unmarshal([]byte(c.Body), &v)
+ return v
+}
+
+// services routes every request to one fake server, whatever host it was
+// addressed to, and answers with reply.
+func services(t *testing.T, reply func(call) (int, string)) func() []call {
+ t.Helper()
+ var mu sync.Mutex
+ var calls []call
+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ b, _ := io.ReadAll(r.Body)
+ c := call{r.Method, r.Header.Get("X-Test-Host"), r.URL.Path, r.URL.Query(), r.Header.Clone(), string(b)}
+ mu.Lock()
+ calls = append(calls, c)
+ mu.Unlock()
+ status, body := reply(c)
+ w.WriteHeader(status)
+ _, _ = io.WriteString(w, body)
+ }))
+ t.Cleanup(srv.Close)
+ target, _ := url.Parse(srv.URL)
+ old := transport
+ transport = func(*net.Dialer) http.RoundTripper {
+ return roundTrip(func(r *http.Request) (*http.Response, error) {
+ r = r.Clone(r.Context())
+ r.Header.Set("X-Test-Host", r.URL.Host)
+ r.URL.Scheme, r.URL.Host, r.Host = "http", target.Host, target.Host
+ return http.DefaultTransport.RoundTrip(r)
+ })
+ }
+ t.Cleanup(func() { transport = old })
+ return func() []call { mu.Lock(); defer mu.Unlock(); return append([]call(nil), calls...) }
+}
+
+type roundTrip func(*http.Request) (*http.Response, error)
+
+func (f roundTrip) RoundTrip(r *http.Request) (*http.Response, error) { return f(r) }
+
+var (
+ testKey = uuid.MustParse("00000000-0000-0000-0000-0000000000aa")
+ testOpened = Message{Event: Opened, Title: "Shop is down", Body: "eu: unexpected status 502", URL: "https://uptime.example/monitors/1", Key: testKey, Monitor: "Shop", Target: "https://shop.example"}
+ testResolve = func() Message { m := testOpened; m.Event, m.Title = Resolved, "Shop is up again"; return m }()
+)
+
+// serviceCase sends msg through typ with cfg; check inspects the requests.
+type serviceCase struct {
+ typ string
+ cfg map[string]string
+ msg Message
+ reply string
+ check func(t *testing.T, calls []call)
+}
+
+// one asserts a single request to host and path containing all of want in
+// its URL, headers or body.
+func one(host, path string, want ...string) func(*testing.T, []call) {
+ return func(t *testing.T, calls []call) {
+ t.Helper()
+ if len(calls) != 1 {
+ t.Fatalf("%d requests, want 1", len(calls))
+ }
+ c := calls[0]
+ if c.Host != host || !strings.HasPrefix(c.Path, path) {
+ t.Errorf("request to %s%s, want %s%s", c.Host, c.Path, host, path)
+ }
+ all := c.Path + "?" + c.Query.Encode() + "\n" + c.Body
+ for k, v := range c.Header {
+ all += "\n" + k + ": " + strings.Join(v, ",")
+ }
+ decoded, _ := url.QueryUnescape(all)
+ for _, w := range want {
+ if !strings.Contains(all, w) && !strings.Contains(decoded, w) {
+ t.Errorf("request lacks %q:\n%s", w, all)
+ }
+ }
+ }
+}
+
+func TestServices(t *testing.T) {
+ var current *serviceCase
+ calls := services(t, func(call) (int, string) {
+ if current.reply != "" {
+ return http.StatusOK, current.reply
+ }
+ return http.StatusOK, "{}"
+ })
+ basicAuth := func(u, p string) string { return "Basic " + base64.StdEncoding.EncodeToString([]byte(u+":"+p)) }
+
+ cases := []serviceCase{
+ // Chat and messengers.
+ {typ: "bale", cfg: map[string]string{"bot_token": "b0t", "chat_id": "42"}, check: one("tapi.bale.ai", "/botb0t/sendMessage", `"chat_id":"42"`, "Shop is down")},
+ {typ: "bitrix", cfg: map[string]string{"webhook_url": "https://corp.bitrix24.de/rest/1/k3y", "user_id": "7"}, check: one("corp.bitrix24.de", "/rest/1/k3y/im.notify.system.add.json", "user_id=7", "Shop is down")},
+ {typ: "clickup", cfg: map[string]string{"api_token": "pk_1", "workspace_id": "w1", "channel_id": "c1"}, check: one("api.clickup.com", "/api/v3/workspaces/w1/chat/channels/c1/messages", "Authorization: pk_1", "Shop is down")},
+ {typ: "dingtalk", cfg: map[string]string{"webhook_url": "https://oapi.dingtalk.com/robot/send?access_token=at", "sign_secret": "SECabc"}, reply: `{"errcode":0,"errmsg":"ok"}`,
+ check: func(t *testing.T, calls []call) {
+ one("oapi.dingtalk.com", "/robot/send", "access_token=at", "Shop is down")(t, calls)
+ ts, sign := calls[0].Query.Get("timestamp"), calls[0].Query.Get("sign")
+ mac := hmac.New(sha256.New, []byte("SECabc"))
+ mac.Write([]byte(ts + "\nSECabc"))
+ if sign != base64.StdEncoding.EncodeToString(mac.Sum(nil)) {
+ t.Error("DingTalk signature does not verify")
+ }
+ }},
+ {typ: "feishu", cfg: map[string]string{"webhook_url": "https://open.feishu.cn/open-apis/bot/v2/hook/x"}, reply: `{"code":0}`, check: one("open.feishu.cn", "/open-apis/bot/v2/hook/x", `"msg_type":"text"`, "Shop is down")},
+ {typ: "fluxer", cfg: map[string]string{"webhook_url": "https://api.fluxer.app/webhooks/1/t"}, check: one("api.fluxer.app", "/webhooks/1/t", `"content":"Shop is down`)},
+ {typ: "kook", cfg: map[string]string{"bot_token": "kt", "channel_id": "ch"}, reply: `{"code":0}`, check: one("www.kookapp.cn", "/api/v3/message/create", "Authorization: Bot kt", `"target_id":"ch"`)},
+ {typ: "line", cfg: map[string]string{"access_token": "lt", "user_id": "U1"}, check: one("api.line.me", "/v2/bot/message/push", "Bearer lt", `"to":"U1"`, "Shop is down")},
+ {typ: "max", cfg: map[string]string{"bot_token": "mt", "chat_id": "-5"}, check: one("platform-api.max.ru", "/messages", "chat_id=-5", "Authorization: mt", "Shop is down")},
+ {typ: "milky", cfg: map[string]string{"api_url": "http://qq.lan:3000", "access_token": "mk", "message_type": "group", "receiver_id": "123"}, check: one("qq.lan:3000", "/api/send_group_message", `"group_id":123`, "Bearer mk")},
+ {typ: "onebot", cfg: map[string]string{"api_url": "http://qq.lan:5700", "message_type": "private", "receiver_id": "9"}, check: one("qq.lan:5700", "/send_msg", `"message_type":"private"`, `"user_id":"9"`)},
+ {typ: "onechat", cfg: map[string]string{"access_token": "oc", "receiver_id": "r", "bot_id": "b"}, check: one("chat-api.one.th", "/message/api/v1/push_message", "Bearer oc", `"bot_id":"b"`)},
+ {typ: "nextcloudtalk", cfg: map[string]string{"server_url": "https://cloud.example", "conversation_token": "ct", "bot_secret": "bs"},
+ check: func(t *testing.T, calls []call) {
+ one("cloud.example", "/ocs/v2.php/apps/spreed/api/v1/bot/ct/message", "Shop is down")(t, calls)
+ c := calls[0]
+ mac := hmac.New(sha256.New, []byte("bs"))
+ mac.Write([]byte(c.Header.Get("X-Nextcloud-Talk-Bot-Random") + c.json()["message"].(string)))
+ if c.Header.Get("X-Nextcloud-Talk-Bot-Signature") != hex.EncodeToString(mac.Sum(nil)) {
+ t.Error("Nextcloud Talk signature does not verify")
+ }
+ }},
+ {typ: "pumble", cfg: map[string]string{"webhook_url": "https://api.pumble.com/workspaces/w/x"}, check: one("api.pumble.com", "/workspaces/w/x", `"color":"#DC3645"`)},
+ {typ: "stackfield", cfg: map[string]string{"webhook_url": "https://www.stackfield.com/apiwebhook/x"}, check: one("www.stackfield.com", "/apiwebhook/x", `"Title":"Shop is down`)},
+ {typ: "vk", cfg: map[string]string{"access_token": "vt", "peer_id": "2000000001"}, reply: `{"response":1}`, check: one("api.vk.ru", "/method/messages.send", "access_token=vt", "v=5.199", "peer_id=2000000001")},
+ {typ: "vkteams", cfg: map[string]string{"bot_token": "vkt", "chat_id": "c@chat"}, reply: `{"ok":true}`, check: one("myteam.mail.ru", "/bot/v1/messages/sendText", "token=vkt", "chatId=c@chat")},
+ {typ: "wecom", cfg: map[string]string{"bot_key": "wk", "mentioned_mobiles": "138, 139"}, reply: `{"errcode":0}`, check: one("qyapi.weixin.qq.com", "/cgi-bin/webhook/send", "key=wk", `"mentioned_mobile_list":["138","139"]`)},
+ {typ: "yunzhijia", cfg: map[string]string{"webhook_url": "https://www.yunzhijia.com/gateway/robot/webhook/send", "token": "yt"}, reply: `{"success":true}`, check: one("www.yunzhijia.com", "/gateway/robot/webhook/send", "yzjtoken=yt", "Shop is down")},
+ {typ: "zohocliq", cfg: map[string]string{"webhook_url": "https://cliq.zoho.eu/api/v2/channelsbyname/ops/message?zapikey=z"}, check: one("cliq.zoho.eu", "/api/v2/channelsbyname/ops/message", `"text":"Shop is down`)},
+ {typ: "threema", cfg: map[string]string{"gateway_id": "*UPTIME1", "gateway_secret": "ts", "recipient_type": "phone", "recipient": "41791234567"}, check: one("msgapi.threema.ch", "/send_simple", "from=*UPTIME1", "phone=41791234567", "secret=ts")},
+ {typ: "evolution", cfg: map[string]string{"api_url": "https://evo.example", "api_key": "ek", "instance": "main", "recipient": "4917"}, check: one("evo.example", "/message/sendText/main", "Apikey: ek", `"number":"4917"`)},
+ {typ: "waha", cfg: map[string]string{"api_url": "http://waha.lan:3000", "api_key": "wk", "session": "default", "chat_id": "49@c.us"}, check: one("waha.lan:3000", "/api/sendText", "X-Api-Key: wk", `"chatId":"49@c.us"`)},
+ {typ: "whapi", cfg: map[string]string{"api_token": "wt", "recipient": "4917"}, check: one("gate.whapi.cloud", "/messages/text", "Bearer wt", `"to":"4917"`)},
+ {typ: "openwa", cfg: map[string]string{"api_url": "http://wa.lan", "api_key": "ok", "session": "s1", "chat_ids": "1@c.us"}, check: one("wa.lan", "/api/sessions/s1/messages/send-text", "X-Api-Key: ok", `"chatId":"1@c.us"`)},
+ {typ: "onesender", cfg: map[string]string{"api_url": "https://os.example/api/v1/messages", "api_token": "ot", "message_type": "group", "recipient": "123"}, check: one("os.example", "/api/v1/messages", "Bearer ot", `"to":"123@g.us"`)},
+ {typ: "messenger360", cfg: map[string]string{"api_token": "m3", "recipients": "4917"}, check: one("api.360messenger.com", "/v2/sendMessage", "Bearer m3", `"phonenumber":"4917"`)},
+ {typ: "homeassistant", cfg: map[string]string{"server_url": "http://ha.lan:8123", "access_token": "ha", "service": "mobile_app_phone"}, check: one("ha.lan:8123", "/api/services/notify/mobile_app_phone", "Bearer ha", "Shop is down")},
+ {typ: "indigo", cfg: map[string]string{"server_url": "https://indigo.lan", "api_key": "ik", "variable_id": "12"}, check: one("indigo.lan", "/v2/api/command", "indigo.variable.updateValue", `"objectId":12`)},
+ {typ: "googlesheets", cfg: map[string]string{"webhook_url": "https://script.google.com/macros/s/x/exec"}, check: one("script.google.com", "/macros/s/x/exec", `"status":"DOWN"`, `"monitorName":"Shop"`)},
+ {typ: "callmebot", cfg: map[string]string{"endpoint_url": "https://api.callmebot.com/whatsapp.php?phone=49&apikey=cb"}, check: one("api.callmebot.com", "/whatsapp.php", "apikey=cb", "text=Shop is down")},
+
+ // Push.
+ {typ: "bark", cfg: map[string]string{"endpoint_url": "https://api.day.app/devkey"}, check: one("api.day.app", "/devkey", `"title":"Shop is down"`, `"group":"UptimeSebi"`)},
+ {typ: "gorush", cfg: map[string]string{"server_url": "https://push.example", "device_token": "dt", "platform": "android"}, check: one("push.example", "/api/push", `"platform":2`, `"tokens":["dt"]`)},
+ {typ: "lunasea", cfg: map[string]string{"target": "user", "target_id": "u1"}, check: one("notify.lunasea.app", "/v1/custom/user/u1", "Shop is down")},
+ {typ: "notifery", cfg: map[string]string{"api_key": "nk"}, check: one("api.notifery.com", "/event", "X-Api-Key: nk", `"code":1`)},
+ {typ: "notifyapp", cfg: map[string]string{"device_id": "d1", "token": "nt"}, check: one("push.getnotifyapp.com", "/notify-json/d1", "token=nt", `"timeSensitive":true`)},
+ {typ: "pushdeer", cfg: map[string]string{"push_key": "PDU1"}, reply: `{"code":0}`, check: one("api2.pushdeer.com", "/message/push", `"pushkey":"PDU1"`)},
+ {typ: "pushplus", cfg: map[string]string{"send_key": "pp"}, reply: `{"code":200}`, check: one("www.pushplus.plus", "/send", `"token":"pp"`)},
+ {typ: "pushy", cfg: map[string]string{"api_key": "pk", "device_token": "dt"}, check: one("api.pushy.me", "/push", "api_key=pk", `"to":"dt"`)},
+ {typ: "serverchan", cfg: map[string]string{"send_key": "sctp123tABC"}, check: one("123.push.ft07.com", "/send/sctp123tABC.send", `"title":"Shop is down"`)},
+ {typ: "signalgrid", cfg: map[string]string{"client_key": "sg", "channel": "ops"}, reply: `{"code":200}`, check: one("api.signalgrid.co", "/v1/push", "client_key=sg", "type=CRIT")},
+ {typ: "spugpush", cfg: map[string]string{"template_key": "tk"}, check: one("push.spug.cc", "/send/tk", "Shop is down")},
+ {typ: "techulus", cfg: map[string]string{"api_key": "tk", "channel": "ops"}, check: one("push.techulus.com", "/api/v1/notify/tk", `"channel":"ops"`)},
+ {typ: "wpush", cfg: map[string]string{"api_key": "wk", "channel": "wechat"}, reply: `{"code":0}`, check: one("api.wpush.cn", "/api/v1/send", `"apikey":"wk"`)},
+ {typ: "wxpusher", cfg: map[string]string{"spt": "SPT_1, SPT_2"}, reply: `{"code":1000}`, check: one("wxpusher.zjiecode.com", "/api/send/message/simple-push", `"sptList":["SPT_1","SPT_2"]`)},
+
+ // SMS and calls.
+ {typ: "elks46", cfg: map[string]string{"username": "u", "auth_token": "p", "sender": "Uptime", "phone_number": "+4670"}, check: one("api.46elks.com", "/a1/sms", basicAuth("u", "p"), "to=+4670")},
+ {typ: "aliyunsms", cfg: map[string]string{"access_key_id": "id", "access_key_secret": "sk", "sign_name": "S", "template_code": "T1", "phone_number": "138"}, reply: `{"Code":"OK"}`,
+ check: func(t *testing.T, calls []call) {
+ one("dysmsapi.aliyuncs.com", "/", "PhoneNumbers=138", "TemplateCode=T1")(t, calls)
+ v := calls[0].form()
+ sig := v.Get("Signature")
+ v.Del("Signature")
+ if aliyunSign(v, "sk") != sig || sig == "" {
+ t.Error("Alibaba Cloud signature does not verify")
+ }
+ }},
+ {typ: "amootsms", cfg: map[string]string{"api_token": "at", "line_number": "9821", "phone_numbers": "0912"}, reply: `{"Status":"Success"}`, check: one("portal.amootsms.com", "/rest/SendSimple", "Authorization: at", "Mobiles=0912")},
+ {typ: "bearsms", cfg: map[string]string{"username": "u", "hash_key": "h", "phone_number": "88017"}, reply: `{"status":"OK","data":[{"status":"OK"}]}`, check: one("app.bearsms.com", "/index.php", "u=u", "h=h", "to=88017")},
+ {typ: "cellsynt", cfg: map[string]string{"username": "u", "password": "p", "phone_number": "0046", "sender": "Uptime"}, reply: "OK: abc", check: one("se-1.cellsynt.net", "/sms.php", "destination=0046", "originator=Uptime")},
+ {typ: "clicksend", cfg: map[string]string{"username": "u", "api_key": "k", "phone_number": "+61"}, reply: `{"data":{"messages":[{"status":"SUCCESS"}]}}`, check: one("rest.clicksend.com", "/v3/sms/send", basicAuth("u", "k"), `"to":"+61"`)},
+ {typ: "egosms", cfg: map[string]string{"username": "u", "password": "p", "phone_number": "256"}, check: one("www.egosms.co", "/api/v1/plain/", "number=256", "sender=EGOSMS")},
+ {typ: "freemobile", cfg: map[string]string{"username": "123", "password": "fp"}, check: one("smsapi.free-mobile.fr", "/sendmsg", `"user":"123"`, "msg=Shop is down")},
+ {typ: "gtxmessaging", cfg: map[string]string{"api_key": "gk", "sender": "Uptime", "phone_number": "49"}, check: one("rest.gtx-messaging.net", "/smsc/sendsms/gk/json", "to=49")},
+ {typ: "octopush", cfg: map[string]string{"username": "me@x", "api_key": "ok", "phone_number": "+33"}, check: one("api.octopush.com", "/v1/public/sms-campaign/send", "Api-Key: ok", "Api-Login: me@x", `"phone_number":"+33"`)},
+ {typ: "ooredoo", cfg: map[string]string{"username": "u", "access_key": "ak", "api_token": "bt", "phone_numbers": "7771234, 9607771235"}, reply: `{"response_code":0}`, check: one("o-papi1-lb01.ooredoo.mv", "/bulk_sms/v2", "Bearer bt", "batch=7771234 9607771235")},
+ {typ: "plivo", cfg: map[string]string{"auth_id": "MA1", "auth_token": "pt", "sender": "+1", "phone_number": "+2"}, check: one("api.plivo.com", "/v1/Account/MA1/Message/", basicAuth("MA1", "pt"), `"dst":"+2"`)},
+ {typ: "promosms", cfg: map[string]string{"username": "u", "password": "p", "phone_number": "48", "sms_type": "3"}, reply: `{"response":{"status":0}}`, check: one("promosms.com", "/api/rest/v3_2/sms", basicAuth("u", "p"), `"type":3`)},
+ {typ: "serwersms", cfg: map[string]string{"username": "u", "password": "p", "phone_number": "48"}, reply: `{"success":true}`, check: one("api2.serwersms.pl", "/messages/send_sms", `"phone":"48"`)},
+ {typ: "sevenio", cfg: map[string]string{"api_key": "sk", "phone_number": "49"}, check: one("gateway.seven.io", "/api/sms", "X-Api-Key: sk", `"to":"49"`)},
+ {typ: "smsgateway", cfg: map[string]string{"api_url": "http://phone.lan:8080", "api_key": "gk", "phone_numbers": "49"}, reply: `{"status":"sent"}`, check: one("phone.lan:8080", "/api/v1/sms/send", "X-Api-Key: gk")},
+ {typ: "smsplanet", cfg: map[string]string{"api_token": "st", "sender": "Uptime", "phone_numbers": "48"}, reply: `{"messageId":1}`, check: one("api2.smsplanet.pl", "/sms", "Bearer st", "to=48")},
+ {typ: "smsc", cfg: map[string]string{"username": "u", "password": "p", "phone_number": "7"}, reply: `{"id":1}`, check: one("smsc.kz", "/sys/send.php", "login=u", "phones=7")},
+ {typ: "smseagle", cfg: map[string]string{"api_url": "https://eagle.lan", "access_token": "et", "phone_numbers": "48, 49"}, check: one("eagle.lan", "/api/v2/messages/sms", "Access-Token: et", `"to":["48","49"]`)},
+ {typ: "smsir", cfg: map[string]string{"api_key": "ik", "template_id": "100", "phone_numbers": "09121234567"}, check: one("api.sms.ir", "/v1/send/verify", "X-Api-Key: ik", `"mobile":"9121234567"`, `"templateId":100`)},
+ {typ: "smsmanager", cfg: map[string]string{"api_key": "mk", "phone_numbers": "420"}, check: one("http-api.smsmanager.cz", "/Send", "apikey=mk", "gateway=high")},
+ {typ: "smspartner", cfg: map[string]string{"api_key": "pk", "phone_numbers": "33", "sender": "Uptime"}, reply: `{"success":true}`, check: one("api.smspartner.fr", "/v1/send", `"apiKey":"pk"`)},
+ {typ: "telnyx", cfg: map[string]string{"api_key": "tk", "sender": "+1", "phone_number": "+2"}, check: one("api.telnyx.com", "/v2/messages", "Bearer tk", `"to":"+2"`)},
+ {typ: "teltonika", cfg: map[string]string{"server_url": "https://192.168.1.1/x", "username": "admin", "password": "rp", "modem": "1-1", "phone_number": "+49"}, reply: `{"success":true,"data":{"token":"tt"}}`,
+ check: func(t *testing.T, calls []call) {
+ if len(calls) != 2 || calls[0].Path != "/api/login" || calls[1].Path != "/api/messages/actions/send" || calls[1].Header.Get("Authorization") != "Bearer tt" {
+ t.Errorf("calls = %+v", calls)
+ }
+ }},
+ {typ: "twilio", cfg: map[string]string{"account_sid": "AC1", "auth_token": "tt", "sender": "+1", "phone_number": "+2"}, check: one("api.twilio.com", "/2010-04-01/Accounts/AC1/Messages.json", basicAuth("AC1", "tt"), "To=+2", "From=+1")},
+
+ // Email.
+ {typ: "brevo", cfg: map[string]string{"api_key": "bk", "from_email": "a@x", "to_email": "b@x, c@x", "cc_email": "d@x"}, check: one("api.brevo.com", "/v3/smtp/email", "Api-Key: bk", `"to":[{"email":"b@x"},{"email":"c@x"}]`, `"cc":[{"email":"d@x"}]`)},
+ {typ: "resend", cfg: map[string]string{"api_key": "rk", "from_email": "a@x", "to_email": "b@x"}, check: one("api.resend.com", "/emails", "Bearer rk", `"from":"UptimeSebi \u003ca@x\u003e"`, `"subject":"Shop is down"`)},
+ {typ: "sendgrid", cfg: map[string]string{"api_key": "sg", "from_email": "a@x", "to_email": "b@x", "subject": "Alert"}, check: one("api.sendgrid.com", "/v3/mail/send", "Bearer sg", `"subject":"Alert"`)},
+ {typ: "turbosmtp", cfg: map[string]string{"consumer_key": "ck", "consumer_secret": "cs", "region": "eu", "from_email": "a@x", "to_email": "b@x, c@x"}, check: one("api.eu.turbo-smtp.com", "/api/v2/mail/send", "Consumerkey: ck", `"to":"b@x,c@x"`)},
+ {typ: "microsoftgraph", cfg: map[string]string{"tenant_id": "t1", "client_id": "c1", "client_secret": "cs", "mailbox": "alerts@x", "to_email": "b@x"}, reply: `{"access_token":"gt"}`,
+ check: func(t *testing.T, calls []call) {
+ if len(calls) != 2 || calls[0].Host != "login.microsoftonline.com" || calls[0].form().Get("client_secret") != "cs" ||
+ calls[1].Path != "/v1.0/users/alerts@x/sendMail" || calls[1].Header.Get("Authorization") != "Bearer gt" {
+ t.Errorf("calls = %+v", calls)
+ }
+ }},
+
+ // Incident management.
+ {typ: "alerta", cfg: map[string]string{"api_url": "https://alerta.example/api/alert", "api_key": "ak", "environment": "Production"}, check: one("alerta.example", "/api/alert", "Authorization: Key ak", `"resource":"Shop"`, `"severity":"critical"`)},
+ {typ: "alerta", msg: testResolve, cfg: map[string]string{"api_url": "https://alerta.example/api/alert", "api_key": "ak", "environment": "Production"}, check: one("alerta.example", "/api/alert", `"severity":"normal"`)},
+ {typ: "alertnow", cfg: map[string]string{"webhook_url": "https://alertnowitgr.opsnow.com/x"}, check: one("alertnowitgr.opsnow.com", "/x", `"status":"open"`, testKey.String())},
+ {typ: "flashduty", cfg: map[string]string{"integration_key": "fk"}, check: one("api.flashcat.cloud", "/event/push/alert/standard", "integration_key=fk", `"event_status":"Critical"`)},
+ {typ: "goalert", msg: testResolve, cfg: map[string]string{"server_url": "https://goalert.example", "token": "gt"}, check: one("goalert.example", "/api/v2/generic/incoming", "token=gt", "action=close", "dedup="+testKey.String())},
+ {typ: "grafanaoncall", cfg: map[string]string{"webhook_url": "https://oncall.example/integrations/v1/formatted_webhook/x/"}, check: one("oncall.example", "/integrations/v1/formatted_webhook/x/", `"state":"alerting"`, `"alert_uid":"`+testKey.String())},
+ {typ: "heiioncall", msg: testResolve, cfg: map[string]string{"api_key": "hk", "trigger_id": "tr"}, check: one("heiioncall.com", "/triggers/tr/resolve", "Bearer hk")},
+ {typ: "jsm", cfg: map[string]string{"cloud_id": "cid", "email": "a@x", "api_token": "jt", "priority": "P2"}, check: one("api.atlassian.com", "/jsm/ops/api/cid/v1/alerts", basicAuth("a@x", "jt"), `"alias":"`+testKey.String(), `"priority":"P2"`)},
+ {typ: "jsm", msg: testResolve, cfg: map[string]string{"cloud_id": "cid", "email": "a@x", "api_token": "jt"}, reply: `{"id":"al1"}`,
+ check: func(t *testing.T, calls []call) {
+ if len(calls) != 2 || calls[0].Query.Get("alias") != testKey.String() || calls[1].Path != "/jsm/ops/api/cid/v1/alerts/al1/close" {
+ t.Errorf("calls = %+v", calls)
+ }
+ }},
+ {typ: "pagertree", msg: testResolve, cfg: map[string]string{"integration_url": "https://api.pagertree.com/integration/int_x"}, check: one("api.pagertree.com", "/integration/int_x", `"event_type":"resolve"`, `"id":"`+testKey.String())},
+ {typ: "signl4", cfg: map[string]string{"webhook_url": "https://connect.signl4.com/webhook/team"}, check: one("connect.signl4.com", "/webhook/team", `"X-S4-Status":"new"`, `"X-S4-ExternalID":"UptimeSebi-`+testKey.String())},
+ {typ: "splunk", msg: testResolve, cfg: map[string]string{"rest_url": "https://alert.victorops.com/integrations/generic/20131114/alert/k/route"}, check: one("alert.victorops.com", "/integrations/generic/20131114/alert/k/route", `"message_type":"RECOVERY"`)},
+ {typ: "squadcast", cfg: map[string]string{"webhook_url": "https://api.squadcast.com/v2/incidents/api/x"}, check: one("api.squadcast.com", "/v2/incidents/api/x", `"status":"trigger"`, `"event_id":"`+testKey.String())},
+ {typ: "trigv", cfg: map[string]string{"api_key": "tv"}, check: one("api.trigv.com", "/v1/events", "Bearer tv", `"level":"error"`, `"channel":"general"`)},
+ {typ: "halopsa", cfg: map[string]string{"webhook_url": "https://halo.example/api/webhook", "username": "u", "password": "p"}, check: one("halo.example", "/api/webhook", basicAuth("u", "p"), `"status":"DOWN"`)},
+ {typ: "flowtriq", cfg: map[string]string{"webhook_url": "https://flowtriq.example/hook", "api_key": "fk"}, check: one("flowtriq.example", "/hook", "X-Api-Key: fk", `"status":"down"`)},
+ {typ: "keep", cfg: map[string]string{"server_url": "https://keep.example", "api_key": "kk"}, check: one("keep.example", "/alerts/event/uptimekuma", "X-Api-Key: kk", `"status":0`, `"name":"Shop"`)},
+ {typ: "opsimate", cfg: map[string]string{"server_url": "https://opsimate.example", "api_token": "ot"}, check: one("opsimate.example", "/api/v1/alerts/custom/uptimekuma", "X-Api-Token: ot")},
+ {typ: "pinglet", cfg: map[string]string{"publish_url": "https://pinglet.example/p/x", "api_key": "pk"}, check: one("pinglet.example", "/p/x", "rewrite=uptimekuma", "Bearer pk")},
+ }
+ for i := range cases {
+ tc := &cases[i]
+ t.Run(tc.typ, func(t *testing.T) {
+ current = tc
+ p, ok := Lookup(tc.typ)
+ if !ok {
+ t.Fatalf("unknown provider %s", tc.typ)
+ }
+ before := len(calls())
+ msg := tc.msg
+ if msg.Event == "" {
+ msg = testOpened
+ }
+ if err := p.Send(context.Background(), tc.cfg, msg, true); err != nil {
+ t.Fatalf("Send: %v", err)
+ }
+ tc.check(t, calls()[before:])
+ })
+ }
+
+ // Every provider is exercised here or in TestProviders.
+ tested := map[string]bool{"slack": true, "discord": true, "teams": true, "googlechat": true, "mattermost": true, "rocketchat": true,
+ "telegram": true, "matrix": true, "ntfy": true, "gotify": true, "pushover": true, "pushbullet": true, "signal": true,
+ "pagerduty": true, "opsgenie": true, "apprise": true, "nostr": true}
+ for _, tc := range cases {
+ tested[tc.typ] = true
+ }
+ for _, p := range Providers {
+ if !tested[p.Type] {
+ t.Errorf("%s has no test", p.Type)
+ }
+ }
+}
+
+// Services that answer 200 to failed requests are reported as failed.
+func TestServicesReportRefusals(t *testing.T) {
+ var reply string
+ services(t, func(call) (int, string) { return http.StatusOK, reply })
+ for typ, tc := range map[string]struct {
+ cfg map[string]string
+ reply string
+ want string
+ }{
+ "dingtalk": {map[string]string{"webhook_url": "https://oapi.dingtalk.com/robot/send?access_token=x"}, `{"errcode":310000,"errmsg":"keywords not in content"}`, "keywords not in content"},
+ "vk": {map[string]string{"access_token": "x", "peer_id": "1"}, `{"error":{"error_code":5,"error_msg":"User authorization failed"}}`, "User authorization failed"},
+ "clicksend": {map[string]string{"username": "u", "api_key": "k", "phone_number": "1"}, `{"data":{"messages":[{"status":"INVALID_RECIPIENT"}]}}`, "INVALID_RECIPIENT"},
+ "cellsynt": {map[string]string{"username": "u", "password": "p", "phone_number": "1", "sender": "x"}, "Error: Invalid username", "Invalid username"},
+ "wxpusher": {map[string]string{"spt": "x"}, `{"code":1001,"msg":"spt invalid"}`, "spt invalid"},
+ } {
+ reply = tc.reply
+ p, _ := Lookup(typ)
+ if err := p.Send(context.Background(), tc.cfg, testOpened, true); err == nil || !strings.Contains(err.Error(), tc.want) {
+ t.Errorf("%s: err = %v, want %q", typ, err, tc.want)
+ }
+ }
+}
+
+func TestNostr(t *testing.T) {
+ senderSK, recipientSK := nostr.GeneratePrivateKey(), nostr.GeneratePrivateKey()
+ nsec, _ := nip19.EncodePrivateKey(senderSK)
+ recipientPub, _ := nostr.GetPublicKey(recipientSK)
+ npub, _ := nip19.EncodePublicKey(recipientPub)
+
+ got := make(chan nostr.Event, 1)
+ relay := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ conn, err := websocket.Accept(w, r, nil)
+ if err != nil {
+ return
+ }
+ defer func() { _ = conn.CloseNow() }()
+ _, data, err := conn.Read(r.Context())
+ if err != nil {
+ return
+ }
+ var msg []json.RawMessage
+ var e nostr.Event
+ if json.Unmarshal(data, &msg) != nil || len(msg) != 2 || json.Unmarshal(msg[1], &e) != nil {
+ return
+ }
+ ok, _ := e.CheckSignature()
+ reply, _ := json.Marshal([]any{"OK", e.ID, ok, ""})
+ _ = conn.Write(r.Context(), websocket.MessageText, reply)
+ got <- e
+ _, _, _ = conn.Read(r.Context())
+ }))
+ t.Cleanup(relay.Close)
+ services(t, func(call) (int, string) { return http.StatusNotFound, "" })
+ old := transport
+ transport = func(*net.Dialer) http.RoundTripper { return http.DefaultTransport }
+ t.Cleanup(func() { transport = old })
+
+ p, _ := Lookup("nostr")
+ cfg := map[string]string{"sender_nsec": nsec, "recipients": npub, "relays": "ws://" + strings.TrimPrefix(relay.URL, "http://")}
+ if err := p.Send(context.Background(), cfg, testOpened, true); err != nil {
+ t.Fatalf("Send: %v", err)
+ }
+ wrap := <-got
+ if wrap.Kind != nostr.KindGiftWrap {
+ t.Fatalf("kind = %d, want gift wrap", wrap.Kind)
+ }
+ rumor, err := nip59.GiftUnwrap(wrap, func(otherPub, ciphertext string) (string, error) {
+ key, err := nip44.GenerateConversationKey(otherPub, recipientSK)
+ if err != nil {
+ return "", err
+ }
+ return nip44.Decrypt(ciphertext, key)
+ })
+ if err != nil || !strings.Contains(rumor.Content, "Shop is down") || rumor.Kind != nostr.KindDirectMessage {
+ t.Errorf("unwrapped = %+v, %v", rumor, err)
+ }
+
+ cfg["sender_nsec"] = npub
+ if err := p.Send(context.Background(), cfg, testOpened, true); err == nil {
+ t.Error("a public key accepted as sender")
+ }
+}
diff --git a/internal/notify/sms.go b/internal/notify/sms.go
new file mode 100644
index 0000000..032b31b
--- /dev/null
+++ b/internal/notify/sms.go
@@ -0,0 +1,413 @@
+package notify
+
+import (
+ "context"
+ "crypto/hmac"
+ "crypto/sha1" //nolint:gosec // Alibaba Cloud's API signature is HMAC-SHA1
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+ "sort"
+ "strings"
+ "time"
+
+ "github.com/google/uuid"
+)
+
+// SMS gateways and phone calls. Messages are cut to what several SMS
+// parts hold.
+
+func (m Message) sms() string { return truncate(m.text(), 600) }
+
+// ascii drops characters GSM gateways without Unicode support reject.
+func ascii(s string) string {
+ return strings.Map(func(r rune) rune {
+ if r > 127 {
+ return -1
+ }
+ return r
+ }, s)
+}
+
+func senderField(required bool) Field { return text("sender", required) }
+
+var smsProviders = []Provider{
+ {Type: "elks46", Group: "sms", Fields: []Field{text("username", true), secret("auth_token", true), senderField(true), text("phone_number", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ _, err := c.form(ctx, "https://api.46elks.com/a1/sms", basic(cfg["username"], cfg["auth_token"]),
+ url.Values{"from": {cfg["sender"]}, "to": {cfg["phone_number"]}, "message": {m.sms()}})
+ return err
+ }},
+ {Type: "aliyunsms", Group: "sms", Fields: []Field{
+ text("access_key_id", true), secret("access_key_secret", true), text("sign_name", true), text("template_code", true), text("phone_number", true),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // The template receives name, time, status and msg.
+ param, _ := json.Marshal(map[string]string{
+ "name": m.Monitor, "time": time.Now().UTC().Format(time.DateTime), "status": strings.ToUpper(m.status()), "msg": truncate(m.Body, 100),
+ })
+ v := url.Values{
+ "PhoneNumbers": {cfg["phone_number"]}, "TemplateCode": {cfg["template_code"]}, "SignName": {cfg["sign_name"]},
+ "TemplateParam": {string(param)}, "AccessKeyId": {cfg["access_key_id"]}, "Format": {"JSON"},
+ "SignatureMethod": {"HMAC-SHA1"}, "SignatureVersion": {"1.0"}, "SignatureNonce": {uuid.NewString()},
+ "Timestamp": {time.Now().UTC().Format("2006-01-02T15:04:05Z")}, "Action": {"SendSms"}, "Version": {"2017-05-25"},
+ }
+ v.Set("Signature", aliyunSign(v, cfg["access_key_secret"]))
+ reply, err := c.form(ctx, "https://dysmsapi.aliyuncs.com/", nil, v)
+ return replyCheck(reply, err, func(r map[string]any) string {
+ if str(r["Code"]) != "OK" {
+ return "Alibaba Cloud SMS: " + str(r["Message"])
+ }
+ return ""
+ })
+ }},
+ {Type: "amootsms", Group: "sms", Fields: []Field{secret("api_token", true), text("line_number", true), text("phone_numbers", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ reply, err := c.form(ctx, "https://portal.amootsms.com/rest/SendSimple", http.Header{"Authorization": {cfg["api_token"]}}, url.Values{
+ "SendDateTime": {time.Now().In(tehran()).Format(time.DateTime)}, "SMSMessageText": {m.sms()},
+ "LineNumber": {cfg["line_number"]}, "Mobiles": {strings.Join(list(cfg["phone_numbers"]), ",")},
+ })
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if s := str(v["Status"]); s != "" && s != "Success" {
+ return "Amoot SMS: " + s + " " + str(v["ErrorMessage"])
+ }
+ return ""
+ })
+ }},
+ {Type: "bearsms", Group: "sms", Fields: []Field{text("username", true), secret("hash_key", true), text("phone_number", true), senderField(false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ msg := m.sms()
+ q := url.Values{"app": {"ws"}, "u": {cfg["username"]}, "h": {cfg["hash_key"]}, "op": {"pv"}, "to": {cfg["phone_number"]}, "msg": {msg}}
+ if cfg["sender"] != "" {
+ q.Set("from", cfg["sender"])
+ }
+ if ascii(msg) != msg {
+ q.Set("unicode", "1")
+ }
+ reply, err := c.get(ctx, "https://app.bearsms.com/index.php", nil, q)
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if str(v["status"]) == "ERR" || str(v["error_string"]) != "" {
+ return "BearSMS: " + or(str(v["error_string"]), "failed")
+ }
+ return ""
+ })
+ }},
+ {Type: "cellsynt", Group: "sms", Fields: []Field{
+ text("username", true), secret("password", true), text("phone_number", true),
+ {Name: "originator_type", Kind: "select", Options: []string{"alpha", "numeric"}, Default: "alpha"}, senderField(true),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ q := url.Values{
+ "username": {cfg["username"]}, "password": {cfg["password"]}, "destination": {cfg["phone_number"]},
+ "text": {ascii(m.sms())}, "originatortype": {or(cfg["originator_type"], "alpha")}, "originator": {cfg["sender"]}, "allowconcat": {"6"},
+ }
+ reply, err := c.call(ctx, http.MethodPost, "https://se-1.cellsynt.net/sms.php?"+q.Encode(), nil, nil)
+ if err == nil && strings.Contains(string(reply), "Error:") {
+ return errors.New("Cellsynt: " + strings.TrimSpace(strings.ReplaceAll(string(reply), "Error:", "")))
+ }
+ return err
+ }},
+ {Type: "clicksend", Group: "sms", Fields: []Field{text("username", true), secret("api_key", true), text("phone_number", true), senderField(false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ reply, err := c.callJSON(ctx, http.MethodPost, "https://rest.clicksend.com/v3/sms/send", basic(cfg["username"], cfg["api_key"]), map[string]any{
+ "messages": []map[string]any{{"body": ascii(m.sms()), "to": cfg["phone_number"], "source": "uptimesebi", "from": cfg["sender"]}},
+ })
+ return replyCheck(reply, err, func(v map[string]any) string {
+ data, _ := v["data"].(map[string]any)
+ msgs, _ := data["messages"].([]any)
+ if len(msgs) > 0 {
+ if st := str(msgs[0].(map[string]any)["status"]); st != "SUCCESS" {
+ return "ClickSend: " + st
+ }
+ }
+ return ""
+ })
+ }},
+ {Type: "egosms", Group: "sms", Fields: []Field{text("username", true), secret("password", true), text("phone_number", true), senderField(false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ _, err := c.get(ctx, "https://www.egosms.co/api/v1/plain/", nil, url.Values{
+ "number": {cfg["phone_number"]}, "message": {m.sms()}, "username": {cfg["username"]},
+ "password": {cfg["password"]}, "sender": {or(cfg["sender"], "EGOSMS")}, "priority": {"0"},
+ })
+ return err
+ }},
+ {Type: "freemobile", Group: "sms", Fields: []Field{text("username", true), secret("password", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // Free Mobile texts the account's own number.
+ return c.json(ctx, http.MethodPost, "https://smsapi.free-mobile.fr/sendmsg?msg="+url.QueryEscape(m.sms()), nil,
+ map[string]any{"user": cfg["username"], "pass": cfg["password"]})
+ }},
+ {Type: "gtxmessaging", Group: "sms", Fields: []Field{secret("api_key", true), senderField(true), text("phone_number", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ _, err := c.form(ctx, "https://rest.gtx-messaging.net/smsc/sendsms/"+url.PathEscape(cfg["api_key"])+"/json", nil,
+ url.Values{"from": {cfg["sender"]}, "to": {cfg["phone_number"]}, "text": {m.sms()}})
+ return err
+ }},
+ {Type: "octopush", Group: "sms", Fields: []Field{
+ text("username", true), secret("api_key", true), text("phone_number", true),
+ {Name: "sms_type", Kind: "select", Options: []string{"sms_premium", "sms_low_cost"}, Default: "sms_premium"}, senderField(false),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ h := http.Header{"api-key": {cfg["api_key"]}, "api-login": {cfg["username"]}}
+ return c.json(ctx, http.MethodPost, "https://api.octopush.com/v1/public/sms-campaign/send", h, map[string]any{
+ "recipients": []map[string]any{{"phone_number": cfg["phone_number"]}}, "text": ascii(m.sms()),
+ "type": or(cfg["sms_type"], "sms_premium"), "purpose": "alert", "sender": cfg["sender"],
+ })
+ }},
+ {Type: "ooredoo", Group: "sms", Fields: []Field{
+ text("username", true), secret("access_key", true), secret("api_token", true), text("phone_numbers", true),
+ urlField("api_url", false, "https://o-papi1-lb01.ooredoo.mv/bulk_sms/v2"),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ numbers := list(strings.ReplaceAll(cfg["phone_numbers"], " ", ","))
+ for i := 0; i < len(numbers); i += 20 {
+ reply, err := c.form(ctx, or(cfg["api_url"], "https://o-papi1-lb01.ooredoo.mv/bulk_sms/v2"), bearer(cfg["api_token"]), url.Values{
+ "username": {cfg["username"]}, "access_key": {base64.StdEncoding.EncodeToString([]byte(cfg["access_key"]))},
+ "message": {m.sms()}, "batch": {strings.Join(numbers[i:min(i+20, len(numbers))], " ")},
+ })
+ if err := replyCheck(reply, err, func(v map[string]any) string {
+ if str(v["response_code"]) != "0" {
+ return "Ooredoo: " + or(str(v["response_message"]), "rejected")
+ }
+ return ""
+ }); err != nil {
+ return err
+ }
+ }
+ return nil
+ }},
+ {Type: "plivo", Group: "sms", Fields: []Field{
+ text("auth_id", true), secret("auth_token", true), senderField(true), text("phone_number", true),
+ {Name: "message_type", Kind: "select", Options: []string{"sms", "call"}, Default: "sms"}, urlField("answer_url", false, ""),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ base := "https://api.plivo.com/v1/Account/" + url.PathEscape(cfg["auth_id"])
+ h := basic(cfg["auth_id"], cfg["auth_token"])
+ if cfg["message_type"] == "call" {
+ // The answer URL returns Plivo XML that reads the message out.
+ answer, err := url.Parse(cfg["answer_url"])
+ if err != nil || cfg["answer_url"] == "" {
+ return errors.New("calls need an answer URL")
+ }
+ q := answer.Query()
+ q.Set("message", m.Title)
+ answer.RawQuery = q.Encode()
+ return c.json(ctx, http.MethodPost, base+"/Call/", h, map[string]any{
+ "from": cfg["sender"], "to": cfg["phone_number"], "answer_url": answer.String(), "answer_method": "GET",
+ })
+ }
+ return c.json(ctx, http.MethodPost, base+"/Message/", h, map[string]any{"src": cfg["sender"], "dst": cfg["phone_number"], "text": m.sms()})
+ }},
+ {Type: "promosms", Group: "sms", Fields: []Field{
+ text("username", true), secret("password", true), text("phone_number", true),
+ {Name: "sms_type", Kind: "select", Options: []string{"1", "3", "4", "0"}, Default: "1"}, senderField(false),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ typ := 1
+ _, _ = fmt.Sscan(cfg["sms_type"], &typ)
+ reply, err := c.callJSON(ctx, http.MethodPost, "https://promosms.com/api/rest/v3_2/sms", basic(cfg["username"], cfg["password"]), map[string]any{
+ "recipients": []string{cfg["phone_number"]}, "text": truncate(ascii(m.sms()), 639), "long-sms": true, "type": typ, "sender": cfg["sender"],
+ })
+ return replyCheck(reply, err, func(v map[string]any) string {
+ resp, _ := v["response"].(map[string]any)
+ if st := str(resp["status"]); st != "0" {
+ return "PromoSMS: status " + st
+ }
+ return ""
+ })
+ }},
+ {Type: "serwersms", Group: "sms", Fields: []Field{text("username", true), secret("password", true), text("phone_number", true), senderField(false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ reply, err := c.callJSON(ctx, http.MethodPost, "https://api2.serwersms.pl/messages/send_sms", nil, map[string]any{
+ "username": cfg["username"], "password": cfg["password"], "text": ascii(m.sms()), "sender": cfg["sender"], "phone": cfg["phone_number"],
+ })
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if v["success"] != true {
+ e, _ := v["error"].(map[string]any)
+ return "SerwerSMS: " + or(str(e["message"]), "failed")
+ }
+ return ""
+ })
+ }},
+ {Type: "sevenio", Group: "sms", Fields: []Field{secret("api_key", true), text("phone_number", true), senderField(false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ return c.json(ctx, http.MethodPost, "https://gateway.seven.io/api/sms", http.Header{"X-API-Key": {cfg["api_key"]}},
+ map[string]any{"to": cfg["phone_number"], "from": or(cfg["sender"], "UptimeSebi"), "text": m.sms()})
+ }},
+ {Type: "smsgateway", Group: "sms", Fields: []Field{urlField("api_url", true, ""), secret("api_key", true), text("phone_numbers", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // SMS Gateway for Android.
+ for _, to := range list(cfg["phone_numbers"]) {
+ reply, err := c.callJSON(ctx, http.MethodPost, trimURL(cfg["api_url"])+"/api/v1/sms/send", http.Header{"X-API-Key": {cfg["api_key"]}},
+ map[string]any{"to": to, "body": m.sms()})
+ if err := replyCheck(reply, err, func(v map[string]any) string {
+ if str(v["status"]) == "failed" {
+ return to + ": " + or(str(v["message"]), "failed")
+ }
+ return ""
+ }); err != nil {
+ return err
+ }
+ }
+ return nil
+ }},
+ {Type: "smsplanet", Group: "sms", Fields: []Field{secret("api_token", true), senderField(true), text("phone_numbers", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ reply, err := c.form(ctx, "https://api2.smsplanet.pl/sms", bearer(cfg["api_token"]),
+ url.Values{"from": {cfg["sender"]}, "to": {cfg["phone_numbers"]}, "msg": {m.sms()}})
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if str(v["messageId"]) == "" {
+ return "SMSPlanet: " + or(str(v["errorMsg"]), "no message ID")
+ }
+ return ""
+ })
+ }},
+ {Type: "smsc", Group: "sms", Fields: []Field{text("username", true), secret("password", true), text("phone_number", true), senderField(false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ q := url.Values{"fmt": {"3"}, "translit": {"0"}, "login": {cfg["username"]}, "psw": {cfg["password"]},
+ "phones": {cfg["phone_number"]}, "mes": {ascii(m.sms())}}
+ if cfg["sender"] != "" {
+ q.Set("sender", cfg["sender"])
+ }
+ reply, err := c.get(ctx, "https://smsc.kz/sys/send.php", nil, q)
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if v["id"] == nil {
+ return fmt.Sprintf("SMSC: %s (%s)", str(v["error"]), str(v["error_code"]))
+ }
+ return ""
+ })
+ }},
+ {Type: "smseagle", Group: "sms", Fields: []Field{
+ urlField("api_url", true, ""), secret("access_token", true), text("phone_numbers", true),
+ {Name: "api_version", Kind: "select", Options: []string{"2", "1"}, Default: "2"},
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ base := trimURL(cfg["api_url"])
+ if cfg["api_version"] == "1" {
+ reply, err := c.get(ctx, base+"/http_api/send_sms", nil, url.Values{
+ "access_token": {cfg["access_token"]}, "to": {strings.Join(list(cfg["phone_numbers"]), ",")}, "message": {m.sms()}, "unicode": {"1"},
+ })
+ if err == nil && !strings.Contains(string(reply), "OK") {
+ return errors.New("SMSEagle: " + truncate(string(reply), 200))
+ }
+ return err
+ }
+ return c.json(ctx, http.MethodPost, base+"/api/v2/messages/sms", http.Header{"access-token": {cfg["access_token"]}},
+ map[string]any{"to": list(cfg["phone_numbers"]), "text": m.sms(), "encoding": "unicode"})
+ }},
+ {Type: "smsir", Group: "sms", Fields: []Field{secret("api_key", true), text("template_id", true), text("phone_numbers", true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // sms.ir verify templates take one parameter, uptkumaalert, of
+ // at most 20 characters.
+ var template int
+ _, _ = fmt.Sscan(cfg["template_id"], &template)
+ msg := truncate(strings.ReplaceAll(m.Monitor+" "+m.status(), " ", ""), 20)
+ for _, mobile := range list(cfg["phone_numbers"]) {
+ if len(mobile) == 11 && strings.HasPrefix(mobile, "09") {
+ mobile = mobile[1:]
+ }
+ if err := c.json(ctx, http.MethodPost, "https://api.sms.ir/v1/send/verify", http.Header{"X-API-Key": {cfg["api_key"]}}, map[string]any{
+ "mobile": mobile, "templateId": template, "parameters": []map[string]any{{"name": "uptkumaalert", "value": msg}},
+ }); err != nil {
+ return err
+ }
+ }
+ return nil
+ }},
+ {Type: "smsmanager", Group: "sms", Fields: []Field{
+ secret("api_key", true), text("phone_numbers", true),
+ {Name: "gateway", Kind: "select", Options: []string{"high", "economy"}, Default: "high"},
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ _, err := c.get(ctx, "https://http-api.smsmanager.cz/Send", nil, url.Values{
+ "apikey": {cfg["api_key"]}, "message": {ascii(m.sms())}, "number": {cfg["phone_numbers"]}, "gateway": {or(cfg["gateway"], "high")},
+ })
+ return err
+ }},
+ {Type: "smspartner", Group: "sms", Fields: []Field{secret("api_key", true), text("phone_numbers", true), senderField(true)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ reply, err := c.callJSON(ctx, http.MethodPost, "https://api.smspartner.fr/v1/send", nil, map[string]any{
+ "apiKey": cfg["api_key"], "sender": truncate(cfg["sender"], 11), "phoneNumbers": cfg["phone_numbers"], "message": truncate(ascii(m.sms()), 639),
+ })
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if v["success"] != true {
+ return "SMSPartner: " + str(v["message"])
+ }
+ return ""
+ })
+ }},
+ {Type: "telnyx", Group: "sms", Fields: []Field{secret("api_key", true), senderField(true), text("phone_number", true), text("messaging_profile_id", false)},
+ send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ body := map[string]any{"from": cfg["sender"], "to": cfg["phone_number"], "text": m.sms()}
+ if cfg["messaging_profile_id"] != "" {
+ body["messaging_profile_id"] = cfg["messaging_profile_id"]
+ }
+ return c.json(ctx, http.MethodPost, "https://api.telnyx.com/v2/messages", bearer(cfg["api_key"]), body)
+ }},
+ {Type: "teltonika", Group: "sms", Fields: []Field{
+ urlField("server_url", true, ""), text("username", true), secret("password", true), text("modem", true), text("phone_number", true),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // Teltonika routers (RutOS): sign in, then send through a modem.
+ u, err := url.Parse(cfg["server_url"])
+ if err != nil {
+ return err
+ }
+ base := u.Scheme + "://" + u.Host
+ reply, err := c.callJSON(ctx, http.MethodPost, base+"/api/login", nil, map[string]any{"username": cfg["username"], "password": cfg["password"]})
+ var login struct {
+ Success bool `json:"success"`
+ Data struct {
+ Token string `json:"token"`
+ } `json:"data"`
+ }
+ if err != nil || json.Unmarshal(reply, &login) != nil || !login.Success {
+ return errors.Join(errors.New("Teltonika: sign-in failed"), err)
+ }
+ reply, err = c.callJSON(ctx, http.MethodPost, base+"/api/messages/actions/send", bearer(login.Data.Token), map[string]any{
+ "data": map[string]any{"modem": cfg["modem"], "number": cfg["phone_number"], "message": truncate(m.sms(), 159)},
+ })
+ return replyCheck(reply, err, func(v map[string]any) string {
+ if v["success"] != true {
+ return "Teltonika: " + str(v["errors"])
+ }
+ return ""
+ })
+ }},
+ {Type: "twilio", Group: "sms", Fields: []Field{
+ text("account_sid", true), secret("auth_token", true), text("api_key", false), senderField(false), text("phone_number", true),
+ text("messaging_service_sid", false),
+ }, send: func(ctx context.Context, c *client, cfg map[string]string, m Message) error {
+ // With an API key, the token is that key's secret.
+ v := url.Values{"To": {cfg["phone_number"]}, "Body": {m.sms()}}
+ if cfg["sender"] != "" {
+ v.Set("From", cfg["sender"])
+ }
+ if cfg["messaging_service_sid"] != "" {
+ v.Set("MessagingServiceSid", cfg["messaging_service_sid"])
+ }
+ _, err := c.form(ctx, "https://api.twilio.com/2010-04-01/Accounts/"+url.PathEscape(cfg["account_sid"])+"/Messages.json",
+ basic(or(cfg["api_key"], cfg["account_sid"]), cfg["auth_token"]), v)
+ return err
+ }},
+}
+
+// aliyunSign signs Alibaba Cloud RPC parameters (signature version 1.0).
+func aliyunSign(v url.Values, secret string) string {
+ keys := make([]string, 0, len(v))
+ for k := range v {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+ enc := func(s string) string {
+ return strings.NewReplacer("+", "%20", "*", "%2A", "%7E", "~").Replace(url.QueryEscape(s))
+ }
+ pairs := make([]string, len(keys))
+ for i, k := range keys {
+ pairs[i] = enc(k) + "=" + enc(v.Get(k))
+ }
+ mac := hmac.New(sha1.New, []byte(secret+"&"))
+ mac.Write([]byte("POST&" + enc("/") + "&" + enc(strings.Join(pairs, "&"))))
+ return base64.StdEncoding.EncodeToString(mac.Sum(nil))
+}
+
+func tehran() *time.Location {
+ if l, err := time.LoadLocation("Asia/Tehran"); err == nil {
+ return l
+ }
+ return time.FixedZone("IRST", 3*3600+1800)
+}
diff --git a/internal/web/monitors.templ b/internal/web/monitors.templ
index 8ae069b..dbb5c37 100644
--- a/internal/web/monitors.templ
+++ b/internal/web/monitors.templ
@@ -1,6 +1,7 @@
package web
import (
+ "slices"
"context"
"strconv"
"strings"
@@ -956,8 +957,14 @@ templ ChannelsPage(p Page, me Me, v ChannelsView) {
{ i18n.T(ctx, "channels.service") }
- for _, pr := range v.Providers {
- { i18n.T(ctx, "channels.type_"+pr.Type) }
+ for _, g := range providerGroups(v.Providers) {
+
+ for _, pr := range v.Providers {
+ if pr.Group == g {
+ { i18n.T(ctx, "channels.type_"+pr.Type) }
+ }
+ }
+
}
@@ -994,6 +1001,7 @@ templ ChannelsPage(p Page, me Me, v ChannelsView) {
// ProviderOption is a notification service the form offers.
type ProviderOption struct {
Type string
+ Group string
Help string
Fields []ProviderField
}
@@ -1232,3 +1240,14 @@ func condKey(c string) string {
}
return c
}
+
+// providerGroups lists the groups of providers in the order they come.
+func providerGroups(ps []ProviderOption) []string {
+ var out []string
+ for _, p := range ps {
+ if !slices.Contains(out, p.Group) {
+ out = append(out, p.Group)
+ }
+ }
+ return out
+}
diff --git a/internal/web/monitors_templ.go b/internal/web/monitors_templ.go
index 30dabc2..e131139 100644
--- a/internal/web/monitors_templ.go
+++ b/internal/web/monitors_templ.go
@@ -11,6 +11,7 @@ import templruntime "github.com/a-h/templ/runtime"
import (
"context"
+ "slices"
"strconv"
"strings"
@@ -115,7 +116,7 @@ func rangeSwitch(opts []RangeOption) templ.Component {
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.range")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 86, Col: 98}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 87, Col: 98}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2)
if templ_7745c5c3_Err != nil {
@@ -134,7 +135,7 @@ func rangeSwitch(opts []RangeOption) templ.Component {
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(o.Key)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 89, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 90, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@@ -152,7 +153,7 @@ func rangeSwitch(opts []RangeOption) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.range_not_enough")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 91, Col: 105}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 92, Col: 105}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4)
if templ_7745c5c3_Err != nil {
@@ -165,7 +166,7 @@ func rangeSwitch(opts []RangeOption) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(o.Key)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 91, Col: 136}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 92, Col: 136}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -183,7 +184,7 @@ func rangeSwitch(opts []RangeOption) templ.Component {
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(o.URL)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 93, Col: 34}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 94, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6)
if templ_7745c5c3_Err != nil {
@@ -196,7 +197,7 @@ func rangeSwitch(opts []RangeOption) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(o.Key)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 93, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 94, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -268,7 +269,7 @@ func statusDot(s Status) templ.Component {
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "status."+string(s))).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 108, Col: 42}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 109, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
if templ_7745c5c3_Err != nil {
@@ -320,7 +321,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templruntime.NewAttributeExpression("0 0 " + strconv.Itoa(len(bs)*4) + " " + strconv.Itoa(height)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 114, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 115, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
if templ_7745c5c3_Err != nil {
@@ -333,7 +334,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues("height:" + strconv.Itoa(height) + "px")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 117, Col: 49}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 118, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -346,7 +347,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.uptime_chart")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 119, Col: 51}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 120, Col: 51}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15)
if templ_7745c5c3_Err != nil {
@@ -368,7 +369,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(i * 4)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 123, Col: 25}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 124, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
if templ_7745c5c3_Err != nil {
@@ -381,7 +382,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(height)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 126, Col: 33}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 127, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
if templ_7745c5c3_Err != nil {
@@ -429,7 +430,7 @@ func bars(bs []Bar, height int) templ.Component {
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(b.Title)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 132, Col: 20}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 133, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
@@ -484,7 +485,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 141, Col: 76}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 142, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
@@ -515,7 +516,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.Counts[s]))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 148, Col: 40}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 149, Col: 40}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil {
@@ -535,7 +536,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.new"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 153, Col: 131}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 154, Col: 131}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
@@ -558,7 +559,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.empty"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 158, Col: 111}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 159, Col: 111}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
@@ -590,7 +591,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.range_note", "Range", v.Range))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 166, Col: 103}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 167, Col: 103}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
@@ -608,7 +609,7 @@ func Dashboard(p Page, me Me, v DashboardView) templ.Component {
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.manage"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 168, Col: 108}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 169, Col: 108}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
@@ -658,7 +659,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/monitors/" + m.ID)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 177, Col: 49}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 178, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30)
if templ_7745c5c3_Err != nil {
@@ -679,7 +680,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(m.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 181, Col: 45}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 182, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
@@ -692,7 +693,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(m.Type)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 182, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 183, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
@@ -705,7 +706,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(m.Target)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 182, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 183, Col: 90}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
if templ_7745c5c3_Err != nil {
@@ -726,7 +727,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(m.Latency)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 186, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 187, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
if templ_7745c5c3_Err != nil {
@@ -739,7 +740,7 @@ func monitorList(ms []MonitorRow) templ.Component {
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(m.Uptime)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 187, Col: 83}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 188, Col: 83}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
if templ_7745c5c3_Err != nil {
@@ -793,7 +794,7 @@ func groupBlock(g GroupNode) templ.Component {
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(g.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 201, Col: 17}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 202, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil {
@@ -806,7 +807,7 @@ func groupBlock(g GroupNode) templ.Component {
var templ_7745c5c3_Var38 string
templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(g.Total))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 202, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 203, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
if templ_7745c5c3_Err != nil {
@@ -924,7 +925,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var41 string
templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 269, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 270, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
if templ_7745c5c3_Err != nil {
@@ -945,7 +946,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var42 string
templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(v.Row.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 274, Col: 23}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 275, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
if templ_7745c5c3_Err != nil {
@@ -958,7 +959,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var43 string
templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.type_"+v.Row.Type))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 277, Col: 47}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 278, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
if templ_7745c5c3_Err != nil {
@@ -972,7 +973,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var44 string
templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + v.Row.Target)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 279, Col: 29}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 280, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
if templ_7745c5c3_Err != nil {
@@ -986,7 +987,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var45 string
templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + v.Interval)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 281, Col: 26}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 282, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
if templ_7745c5c3_Err != nil {
@@ -1004,7 +1005,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var46 string
templ_7745c5c3_Var46, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/monitors/" + v.Row.ID + "/edit")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 285, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 286, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46)
if templ_7745c5c3_Err != nil {
@@ -1017,7 +1018,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var47 string
templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "sso.action.edit"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 285, Col: 173}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 286, Col: 173}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47))
if templ_7745c5c3_Err != nil {
@@ -1035,7 +1036,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var48 string
templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.history", "Range", v.Range))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 290, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 291, Col: 123}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
if templ_7745c5c3_Err != nil {
@@ -1056,7 +1057,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var49 string
templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.sla"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 294, Col: 39}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 295, Col: 39}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
if templ_7745c5c3_Err != nil {
@@ -1069,7 +1070,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var50 string
templ_7745c5c3_Var50, templ_7745c5c3_Err = templ.JoinStringErrs(v.Row.Uptime)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 295, Col: 49}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 296, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var50))
if templ_7745c5c3_Err != nil {
@@ -1091,7 +1092,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var51 string
templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.latency"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 300, Col: 44}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 301, Col: 44}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51))
if templ_7745c5c3_Err != nil {
@@ -1104,7 +1105,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var52 string
templ_7745c5c3_Var52, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.Latency.MaxMS))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 301, Col: 46}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 302, Col: 46}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var52))
if templ_7745c5c3_Err != nil {
@@ -1117,7 +1118,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var53 string
templ_7745c5c3_Var53, templ_7745c5c3_Err = templruntime.NewAttributeExpression("0 0 " + strconv.Itoa(v.Latency.Width) + " " + strconv.Itoa(v.Latency.Height)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 303, Col: 96}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 304, Col: 96}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53)
if templ_7745c5c3_Err != nil {
@@ -1130,7 +1131,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var54 string
templ_7745c5c3_Var54, templ_7745c5c3_Err = templruntime.NewAttributeExpression(v.Latency.Points).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 304, Col: 40}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 305, Col: 40}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var54)
if templ_7745c5c3_Err != nil {
@@ -1166,7 +1167,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var55 string
templ_7745c5c3_Var55, templ_7745c5c3_Err = templ.JoinStringErrs(r.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 314, Col: 38}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 315, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var55))
if templ_7745c5c3_Err != nil {
@@ -1209,7 +1210,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var58 string
templ_7745c5c3_Var58, templ_7745c5c3_Err = templruntime.NewAttributeExpression(partialTitle(ctx, !r.Enough)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 316, Col: 127}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 317, Col: 127}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var58)
if templ_7745c5c3_Err != nil {
@@ -1236,7 +1237,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var59 string
templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.JoinStringErrs(r.Uptime)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 316, Col: 140}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 317, Col: 140}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59))
if templ_7745c5c3_Err != nil {
@@ -1254,7 +1255,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var60 string
templ_7745c5c3_Var60, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.by_region_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 320, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 321, Col: 79}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var60))
if templ_7745c5c3_Err != nil {
@@ -1339,7 +1340,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var63 string
templ_7745c5c3_Var63, templ_7745c5c3_Err = templruntime.NewAttributeExpression(partialTitle(ctx, e.Partial)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 336, Col: 114}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 337, Col: 114}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var63)
if templ_7745c5c3_Err != nil {
@@ -1366,7 +1367,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var64 string
templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(e.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 337, Col: 56}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 338, Col: 56}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
if templ_7745c5c3_Err != nil {
@@ -1379,7 +1380,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var65 string
templ_7745c5c3_Var65, templ_7745c5c3_Err = templ.JoinStringErrs(e.Value)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 338, Col: 45}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 339, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var65))
if templ_7745c5c3_Err != nil {
@@ -1405,7 +1406,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var66 string
templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(v.Uptime90)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 346, Col: 48}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 347, Col: 48}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
if templ_7745c5c3_Err != nil {
@@ -1447,7 +1448,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var67 string
templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(r.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 357, Col: 21}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 358, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
if templ_7745c5c3_Err != nil {
@@ -1460,7 +1461,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var68 string
templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(r.Detail)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 358, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 359, Col: 77}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
if templ_7745c5c3_Err != nil {
@@ -1523,7 +1524,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var69 string
templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.JoinStringErrs(r.Time)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 379, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 380, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
if templ_7745c5c3_Err != nil {
@@ -1536,7 +1537,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var70 string
templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinStringErrs(r.Region)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 380, Col: 41}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 381, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
if templ_7745c5c3_Err != nil {
@@ -1572,7 +1573,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var71 string
templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.JoinStringErrs(r.Latency)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 391, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 392, Col: 60}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var71))
if templ_7745c5c3_Err != nil {
@@ -1585,7 +1586,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var72 string
templ_7745c5c3_Var72, templ_7745c5c3_Err = templ.JoinStringErrs(r.Detail)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 393, Col: 18}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 394, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var72))
if templ_7745c5c3_Err != nil {
@@ -1603,7 +1604,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var73 string
templ_7745c5c3_Var73, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(r.EvidenceURL)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 395, Col: 47}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 396, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var73)
if templ_7745c5c3_Err != nil {
@@ -1616,7 +1617,7 @@ func MonitorDetail(p Page, me Me, v MonitorDetailView) templ.Component {
var templ_7745c5c3_Var74 string
templ_7745c5c3_Var74, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "evidence.show"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 395, Col: 137}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 396, Col: 137}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var74))
if templ_7745c5c3_Err != nil {
@@ -1680,7 +1681,7 @@ func incidentList(rows []IncidentRow, showMonitor bool) templ.Component {
var templ_7745c5c3_Var76 string
templ_7745c5c3_Var76, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.ongoing"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 412, Col: 76}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 413, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var76))
if templ_7745c5c3_Err != nil {
@@ -1698,7 +1699,7 @@ func incidentList(rows []IncidentRow, showMonitor bool) templ.Component {
var templ_7745c5c3_Var77 string
templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.resolved"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 414, Col: 63}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 415, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var77))
if templ_7745c5c3_Err != nil {
@@ -1717,7 +1718,7 @@ func incidentList(rows []IncidentRow, showMonitor bool) templ.Component {
var templ_7745c5c3_Var78 string
templ_7745c5c3_Var78, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/monitors/" + r.MonitorID)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 417, Col: 57}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 418, Col: 57}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var78)
if templ_7745c5c3_Err != nil {
@@ -1730,7 +1731,7 @@ func incidentList(rows []IncidentRow, showMonitor bool) templ.Component {
var templ_7745c5c3_Var79 string
templ_7745c5c3_Var79, templ_7745c5c3_Err = templ.JoinStringErrs(r.Monitor)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 417, Col: 95}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 418, Col: 95}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var79))
if templ_7745c5c3_Err != nil {
@@ -1748,7 +1749,7 @@ func incidentList(rows []IncidentRow, showMonitor bool) templ.Component {
var templ_7745c5c3_Var80 string
templ_7745c5c3_Var80, templ_7745c5c3_Err = templ.JoinStringErrs(r.Started)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 419, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 420, Col: 59}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var80))
if templ_7745c5c3_Err != nil {
@@ -1761,7 +1762,7 @@ func incidentList(rows []IncidentRow, showMonitor bool) templ.Component {
var templ_7745c5c3_Var81 string
templ_7745c5c3_Var81, templ_7745c5c3_Err = templ.JoinStringErrs(r.Duration)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 420, Col: 57}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 421, Col: 57}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var81))
if templ_7745c5c3_Err != nil {
@@ -1779,7 +1780,7 @@ func incidentList(rows []IncidentRow, showMonitor bool) templ.Component {
var templ_7745c5c3_Var82 string
templ_7745c5c3_Var82, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(r.Cause, " · "))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 423, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 424, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var82))
if templ_7745c5c3_Err != nil {
@@ -1844,7 +1845,7 @@ func IncidentsPage(p Page, me Me, rows []IncidentRow) templ.Component {
var templ_7745c5c3_Var85 string
templ_7745c5c3_Var85, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.none"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 434, Col: 103}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 435, Col: 103}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var85))
if templ_7745c5c3_Err != nil {
@@ -2010,7 +2011,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: 559, Col: 116}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 560, Col: 116}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var87))
if templ_7745c5c3_Err != nil {
@@ -2023,7 +2024,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: 560, Col: 214}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 561, Col: 214}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var88))
if templ_7745c5c3_Err != nil {
@@ -2036,7 +2037,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: 561, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 562, Col: 84}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var89))
if templ_7745c5c3_Err != nil {
@@ -2075,7 +2076,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: 566, Col: 26}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 567, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var91)
if templ_7745c5c3_Err != nil {
@@ -2137,7 +2138,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: 573, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 574, Col: 90}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93))
if templ_7745c5c3_Err != nil {
@@ -2150,7 +2151,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: 576, Col: 14}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 577, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var94)
if templ_7745c5c3_Err != nil {
@@ -2163,7 +2164,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: 578, Col: 30}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 579, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var95)
if templ_7745c5c3_Err != nil {
@@ -2176,7 +2177,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: 579, Col: 26}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 580, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var96)
if templ_7745c5c3_Err != nil {
@@ -2189,7 +2190,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: 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_Var97)
if templ_7745c5c3_Err != nil {
@@ -2207,7 +2208,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: 584, Col: 53}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 585, Col: 53}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
if templ_7745c5c3_Err != nil {
@@ -2267,7 +2268,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: 593, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 594, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
if templ_7745c5c3_Err != nil {
@@ -2285,7 +2286,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: 595, Col: 48}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 596, Col: 48}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var102)
if templ_7745c5c3_Err != nil {
@@ -2298,7 +2299,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: 595, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 596, Col: 97}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
if templ_7745c5c3_Err != nil {
@@ -2316,7 +2317,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: 598, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 599, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
if templ_7745c5c3_Err != nil {
@@ -2339,7 +2340,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: 604, Col: 38}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 605, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var105)
if templ_7745c5c3_Err != nil {
@@ -2352,7 +2353,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: 606, Col: 35}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 607, Col: 35}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var106)
if templ_7745c5c3_Err != nil {
@@ -2382,7 +2383,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var107 string
templ_7745c5c3_Var107, 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: 614, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 615, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var107))
if templ_7745c5c3_Err != nil {
@@ -2403,7 +2404,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var108 string
templ_7745c5c3_Var108, 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: 618, Col: 116}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 619, Col: 116}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var108))
if templ_7745c5c3_Err != nil {
@@ -2421,7 +2422,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var109 string
templ_7745c5c3_Var109, templ_7745c5c3_Err = templruntime.NewAttributeExpression(t).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 621, Col: 24}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 622, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var109)
if templ_7745c5c3_Err != nil {
@@ -2444,7 +2445,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var110 string
templ_7745c5c3_Var110, 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: 621, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 622, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110))
if templ_7745c5c3_Err != nil {
@@ -2480,7 +2481,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var111 string
templ_7745c5c3_Var111, 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: 627, Col: 83}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 628, Col: 83}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var111))
if templ_7745c5c3_Err != nil {
@@ -2557,7 +2558,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 640, Col: 75}
+ 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 {
@@ -2600,7 +2601,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var117 string
templ_7745c5c3_Var117, 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: 645, Col: 75}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 646, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var117))
if templ_7745c5c3_Err != nil {
@@ -2643,7 +2644,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var119 string
templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.radius_hint"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 650, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 651, Col: 77}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var119))
if templ_7745c5c3_Err != nil {
@@ -2694,7 +2695,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var121 string
templ_7745c5c3_Var121, 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: 657, Col: 75}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 658, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
if templ_7745c5c3_Err != nil {
@@ -2707,7 +2708,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var122 string
templ_7745c5c3_Var122, 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: 659, Col: 125}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 660, Col: 125}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var122))
if templ_7745c5c3_Err != nil {
@@ -2725,7 +2726,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var123 string
templ_7745c5c3_Var123, templ_7745c5c3_Err = templruntime.NewAttributeExpression(v).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 662, Col: 25}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 663, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var123)
if templ_7745c5c3_Err != nil {
@@ -2748,7 +2749,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var124 string
templ_7745c5c3_Var124, 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: 662, Col: 72}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 663, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var124))
if templ_7745c5c3_Err != nil {
@@ -2778,7 +2779,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var125 string
templ_7745c5c3_Var125, 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: 670, Col: 128}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 671, Col: 128}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var125))
if templ_7745c5c3_Err != nil {
@@ -2796,7 +2797,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var126 string
templ_7745c5c3_Var126, templ_7745c5c3_Err = templruntime.NewAttributeExpression(c).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 673, Col: 26}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 674, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var126)
if templ_7745c5c3_Err != nil {
@@ -2819,7 +2820,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var127 string
templ_7745c5c3_Var127, 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: 673, Col: 113}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 674, Col: 113}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var127))
if templ_7745c5c3_Err != nil {
@@ -2867,7 +2868,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 681, Col: 76}
+ 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 {
@@ -2906,7 +2907,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var131 string
templ_7745c5c3_Var131, 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: 685, Col: 80}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 686, Col: 80}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var131))
if templ_7745c5c3_Err != nil {
@@ -2919,7 +2920,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 687, Col: 130}
+ 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 {
@@ -2937,7 +2938,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var133 string
templ_7745c5c3_Var133, templ_7745c5c3_Err = templruntime.NewAttributeExpression(e).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 690, Col: 25}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 691, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var133)
if templ_7745c5c3_Err != nil {
@@ -2960,7 +2961,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 690, Col: 100}
+ 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 {
@@ -3004,7 +3005,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var136 string
templ_7745c5c3_Var136, 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: 697, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 698, Col: 77}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var136))
if templ_7745c5c3_Err != nil {
@@ -3043,7 +3044,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var138 string
templ_7745c5c3_Var138, 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: 702, Col: 49}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 703, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var138))
if templ_7745c5c3_Err != nil {
@@ -3056,7 +3057,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 703, Col: 111}
+ 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 {
@@ -3069,7 +3070,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 706, Col: 123}
+ 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 {
@@ -3087,7 +3088,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var141 string
templ_7745c5c3_Var141, templ_7745c5c3_Err = templruntime.NewAttributeExpression("config.matchers." + strconv.Itoa(i) + ".label").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 709, Col: 69}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 710, Col: 69}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var141)
if templ_7745c5c3_Err != nil {
@@ -3100,7 +3101,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var142 string
templ_7745c5c3_Var142, templ_7745c5c3_Err = templruntime.NewAttributeExpression(m.Label).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 709, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 710, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var142)
if templ_7745c5c3_Err != nil {
@@ -3113,7 +3114,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var143 string
templ_7745c5c3_Var143, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.matcher_label")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 709, Col: 164}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 710, Col: 164}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var143)
if templ_7745c5c3_Err != nil {
@@ -3126,7 +3127,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var144 string
templ_7745c5c3_Var144, templ_7745c5c3_Err = templruntime.NewAttributeExpression("config.matchers." + strconv.Itoa(i) + ".op").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 710, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 711, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var144)
if templ_7745c5c3_Err != nil {
@@ -3139,7 +3140,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var145 string
templ_7745c5c3_Var145, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.assertion_op")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 710, Col: 119}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 711, Col: 119}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var145)
if templ_7745c5c3_Err != nil {
@@ -3157,7 +3158,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var146 string
templ_7745c5c3_Var146, templ_7745c5c3_Err = templruntime.NewAttributeExpression(op).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 712, Col: 28}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 713, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var146)
if templ_7745c5c3_Err != nil {
@@ -3180,7 +3181,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 712, Col: 60}
+ 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 {
@@ -3198,7 +3199,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var148 string
templ_7745c5c3_Var148, templ_7745c5c3_Err = templruntime.NewAttributeExpression("config.matchers." + strconv.Itoa(i) + ".value").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 715, Col: 69}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 716, Col: 69}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var148)
if templ_7745c5c3_Err != nil {
@@ -3211,7 +3212,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var149 string
templ_7745c5c3_Var149, templ_7745c5c3_Err = templruntime.NewAttributeExpression(m.Value).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 715, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 716, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var149)
if templ_7745c5c3_Err != nil {
@@ -3224,7 +3225,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var150 string
templ_7745c5c3_Var150, 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: 715, Col: 170}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 716, Col: 170}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var150)
if templ_7745c5c3_Err != nil {
@@ -3242,7 +3243,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 718, Col: 80}
+ 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 {
@@ -3281,7 +3282,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var153 string
templ_7745c5c3_Var153, 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: 723, Col: 80}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 724, Col: 80}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var153))
if templ_7745c5c3_Err != nil {
@@ -3320,7 +3321,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var155 string
templ_7745c5c3_Var155, 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: 728, Col: 119}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 729, Col: 119}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var155))
if templ_7745c5c3_Err != nil {
@@ -3353,7 +3354,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 735, Col: 126}
+ 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 {
@@ -3366,7 +3367,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var157 string
templ_7745c5c3_Var157, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.ExpectStatus).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 736, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 737, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var157)
if templ_7745c5c3_Err != nil {
@@ -3421,7 +3422,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 745, Col: 75}
+ 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 {
@@ -3434,7 +3435,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 747, Col: 123}
+ 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 {
@@ -3447,7 +3448,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var161 string
templ_7745c5c3_Var161, templ_7745c5c3_Err = templruntime.NewAttributeExpression(`up{job="api"}`).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 748, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 749, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var161)
if templ_7745c5c3_Err != nil {
@@ -3460,7 +3461,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var162 string
templ_7745c5c3_Var162, templ_7745c5c3_Err = templ.JoinStringErrs(f.PromQuery)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 748, Col: 201}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 749, Col: 201}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var162))
if templ_7745c5c3_Err != nil {
@@ -3473,7 +3474,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var163 string
templ_7745c5c3_Var163, 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: 752, Col: 126}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 753, Col: 126}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var163))
if templ_7745c5c3_Err != nil {
@@ -3491,7 +3492,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var164 string
templ_7745c5c3_Var164, templ_7745c5c3_Err = templruntime.NewAttributeExpression(op).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 755, Col: 27}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 756, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var164)
if templ_7745c5c3_Err != nil {
@@ -3514,7 +3515,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var165 string
templ_7745c5c3_Var165, 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: 755, Col: 98}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 756, Col: 98}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var165))
if templ_7745c5c3_Err != nil {
@@ -3532,7 +3533,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 760, Col: 128}
+ 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 {
@@ -3545,7 +3546,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var167 string
templ_7745c5c3_Var167, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.PromThreshold).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 761, 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_7745c5c3_Var167)
if templ_7745c5c3_Err != nil {
@@ -3558,7 +3559,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var168 string
templ_7745c5c3_Var168, 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: 765, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 766, Col: 122}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var168))
if templ_7745c5c3_Err != nil {
@@ -3581,7 +3582,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var169 string
templ_7745c5c3_Var169, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.prom_mode_all"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 767, Col: 100}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 768, Col: 100}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var169))
if templ_7745c5c3_Err != nil {
@@ -3604,7 +3605,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var170 string
templ_7745c5c3_Var170, 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: 768, Col: 100}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 769, Col: 100}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var170))
if templ_7745c5c3_Err != nil {
@@ -3651,7 +3652,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 777, Col: 119}
+ 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 {
@@ -3684,7 +3685,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
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: 784, Col: 122}
+ 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 {
@@ -3697,7 +3698,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var174 string
templ_7745c5c3_Var174, templ_7745c5c3_Err = templ.JoinStringErrs(f.JSONBody)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 785, Col: 184}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 786, Col: 184}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var174))
if templ_7745c5c3_Err != nil {
@@ -3710,7 +3711,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var175 string
templ_7745c5c3_Var175, 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: 788, Col: 126}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 789, Col: 126}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var175))
if templ_7745c5c3_Err != nil {
@@ -3723,7 +3724,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var176 string
templ_7745c5c3_Var176, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.JSONExpect).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 789, Col: 71}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 790, Col: 71}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var176)
if templ_7745c5c3_Err != nil {
@@ -3748,7 +3749,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var177 string
templ_7745c5c3_Var177, 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: 794, Col: 125}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 795, Col: 125}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var177))
if templ_7745c5c3_Err != nil {
@@ -3761,7 +3762,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var178 string
templ_7745c5c3_Var178, 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: 795, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 796, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var178))
if templ_7745c5c3_Err != nil {
@@ -3779,7 +3780,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var179 string
templ_7745c5c3_Var179, templ_7745c5c3_Err = templruntime.NewAttributeExpression("config.assertions." + strconv.Itoa(i) + ".path").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 798, Col: 70}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 799, Col: 70}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var179)
if templ_7745c5c3_Err != nil {
@@ -3792,7 +3793,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var180 string
templ_7745c5c3_Var180, templ_7745c5c3_Err = templruntime.NewAttributeExpression(a.Path).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 798, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 799, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var180)
if templ_7745c5c3_Err != nil {
@@ -3805,7 +3806,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var181 string
templ_7745c5c3_Var181, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.assertion_path")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 798, Col: 171}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 799, Col: 171}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var181)
if templ_7745c5c3_Err != nil {
@@ -3818,7 +3819,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var182 string
templ_7745c5c3_Var182, templ_7745c5c3_Err = templruntime.NewAttributeExpression("config.assertions." + strconv.Itoa(i) + ".op").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 799, Col: 69}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 800, Col: 69}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var182)
if templ_7745c5c3_Err != nil {
@@ -3831,7 +3832,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var183 string
templ_7745c5c3_Var183, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "monitors.assertion_op")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 799, Col: 121}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 800, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var183)
if templ_7745c5c3_Err != nil {
@@ -3849,7 +3850,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var184 string
templ_7745c5c3_Var184, templ_7745c5c3_Err = templruntime.NewAttributeExpression(op).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 801, Col: 28}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 802, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var184)
if templ_7745c5c3_Err != nil {
@@ -3872,7 +3873,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var185 string
templ_7745c5c3_Var185, 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: 801, Col: 95}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 802, Col: 95}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var185))
if templ_7745c5c3_Err != nil {
@@ -3890,7 +3891,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var186 string
templ_7745c5c3_Var186, templ_7745c5c3_Err = templruntime.NewAttributeExpression("config.assertions." + strconv.Itoa(i) + ".value").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 804, Col: 71}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 805, Col: 71}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var186)
if templ_7745c5c3_Err != nil {
@@ -3903,7 +3904,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var187 string
templ_7745c5c3_Var187, 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: 804, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 805, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var187)
if templ_7745c5c3_Err != nil {
@@ -3916,7 +3917,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var188 string
templ_7745c5c3_Var188, 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: 804, Col: 161}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 805, Col: 161}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var188)
if templ_7745c5c3_Err != nil {
@@ -3956,7 +3957,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var190 string
templ_7745c5c3_Var190, 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: 811, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 812, Col: 123}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var190))
if templ_7745c5c3_Err != nil {
@@ -3974,7 +3975,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var191 string
templ_7745c5c3_Var191, templ_7745c5c3_Err = templruntime.NewAttributeExpression(r).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 814, Col: 25}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 815, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var191)
if templ_7745c5c3_Err != nil {
@@ -3997,7 +3998,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var192 string
templ_7745c5c3_Var192, templ_7745c5c3_Err = templ.JoinStringErrs(r)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 814, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 815, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var192))
if templ_7745c5c3_Err != nil {
@@ -4109,7 +4110,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var194 string
templ_7745c5c3_Var194, 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: 833, Col: 121}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 834, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var194))
if templ_7745c5c3_Err != nil {
@@ -4122,7 +4123,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var195 string
templ_7745c5c3_Var195, 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: 834, Col: 78}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 835, Col: 78}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var195))
if templ_7745c5c3_Err != nil {
@@ -4140,7 +4141,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var196 string
templ_7745c5c3_Var196, templ_7745c5c3_Err = templruntime.NewAttributeExpression(r.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 837, Col: 57}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 838, Col: 57}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var196)
if templ_7745c5c3_Err != nil {
@@ -4163,7 +4164,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var197 string
templ_7745c5c3_Var197, 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: 838, Col: 15}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 839, Col: 15}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var197))
if templ_7745c5c3_Err != nil {
@@ -4177,7 +4178,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var198 string
templ_7745c5c3_Var198, 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: 841, Col: 37}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 842, Col: 37}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var198))
if templ_7745c5c3_Err != nil {
@@ -4191,7 +4192,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var199 string
templ_7745c5c3_Var199, 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: 843, Col: 42}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 844, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var199))
if templ_7745c5c3_Err != nil {
@@ -4209,7 +4210,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var200 string
templ_7745c5c3_Var200, 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: 845, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 846, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var200))
if templ_7745c5c3_Err != nil {
@@ -4240,7 +4241,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var201 string
templ_7745c5c3_Var201, 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: 855, Col: 43}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 856, Col: 43}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var201)
if templ_7745c5c3_Err != nil {
@@ -4253,7 +4254,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var202 string
templ_7745c5c3_Var202, 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: 856, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 857, Col: 59}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var202)
if templ_7745c5c3_Err != nil {
@@ -4266,7 +4267,7 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component {
var templ_7745c5c3_Var203 string
templ_7745c5c3_Var203, 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: 859, Col: 38}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 860, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var203))
if templ_7745c5c3_Err != nil {
@@ -4370,7 +4371,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
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: 896, Col: 21}
+ 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 {
@@ -4383,7 +4384,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
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: 897, Col: 70}
+ 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 {
@@ -4396,7 +4397,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var208 string
templ_7745c5c3_Var208, 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: 898, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 899, Col: 77}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var208))
if templ_7745c5c3_Err != nil {
@@ -4414,7 +4415,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var209 string
templ_7745c5c3_Var209, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/channels/" + ch.ID + "/test").Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 901, Col: 76}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 902, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var209)
if templ_7745c5c3_Err != nil {
@@ -4427,7 +4428,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var210 string
templ_7745c5c3_Var210, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "channels.test_ok")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 901, Col: 120}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 902, Col: 120}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var210)
if templ_7745c5c3_Err != nil {
@@ -4440,7 +4441,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var211 string
templ_7745c5c3_Var211, 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: 901, Col: 187}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 902, Col: 187}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var211))
if templ_7745c5c3_Err != nil {
@@ -4453,7 +4454,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var212 string
templ_7745c5c3_Var212, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/org/channels/" + ch.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 902, Col: 68}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 903, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var212)
if templ_7745c5c3_Err != nil {
@@ -4466,7 +4467,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var213 string
templ_7745c5c3_Var213, 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: 902, Col: 124}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 903, Col: 124}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var213)
if templ_7745c5c3_Err != nil {
@@ -4479,7 +4480,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var214 string
templ_7745c5c3_Var214, 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: 902, Col: 193}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 903, Col: 193}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var214))
if templ_7745c5c3_Err != nil {
@@ -4544,7 +4545,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var215 string
templ_7745c5c3_Var215, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.secret_now"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 920, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 921, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var215))
if templ_7745c5c3_Err != nil {
@@ -4582,7 +4583,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var216 string
templ_7745c5c3_Var216, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.to"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 933, Col: 117}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 934, Col: 117}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var216))
if templ_7745c5c3_Err != nil {
@@ -4595,7 +4596,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var217 string
templ_7745c5c3_Var217, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.language"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 937, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 938, Col: 123}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var217))
if templ_7745c5c3_Err != nil {
@@ -4613,7 +4614,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var218 string
templ_7745c5c3_Var218, templ_7745c5c3_Err = templruntime.NewAttributeExpression(l).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 940, Col: 27}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 941, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var218)
if templ_7745c5c3_Err != nil {
@@ -4636,7 +4637,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var219 string
templ_7745c5c3_Var219, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "lang."+l))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 940, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 941, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var219))
if templ_7745c5c3_Err != nil {
@@ -4667,7 +4668,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var220 string
templ_7745c5c3_Var220, 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: 947, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 948, Col: 79}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var220))
if templ_7745c5c3_Err != nil {
@@ -4693,7 +4694,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var221 string
templ_7745c5c3_Var221, 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: 952, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 953, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var221))
if templ_7745c5c3_Err != nil {
@@ -4714,7 +4715,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
var templ_7745c5c3_Var222 string
templ_7745c5c3_Var222, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.service"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 957, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 958, Col: 122}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var222))
if templ_7745c5c3_Err != nil {
@@ -4724,15 +4725,15 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- for _, pr := range v.Providers {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 387, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var225 string
+ templ_7745c5c3_Var225, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.type_"+pr.Type))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 964, Col: 78}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var225))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 391, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var224))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 389, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 392, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 390, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 393, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4764,118 +4790,118 @@ 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, 391, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 394, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var225 string
- templ_7745c5c3_Var225, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.language"))
+ var templ_7745c5c3_Var226 string
+ templ_7745c5c3_Var226, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.language"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 966, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 973, Col: 123}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var225))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var226))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 392, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 395, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, l := range v.Languages {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 393, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 396, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 397, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 398, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- for i, pr := range v.Providers {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 399, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var228 string
- templ_7745c5c3_Var228, templ_7745c5c3_Err = templruntime.NewAttributeExpression(pr.Type).Resolve(ctx)
+ templ_7745c5c3_Var228, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "lang."+l))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 976, Col: 37}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 976, Col: 88}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var228)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var228))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 400, "\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 400, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 401, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for i, pr := range v.Providers {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 402, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 406, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if pr.Help != "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 404, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 407, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var229 string
- templ_7745c5c3_Var229, templ_7745c5c3_Err = templ.JoinStringErrs(pr.Help)
+ var templ_7745c5c3_Var230 string
+ templ_7745c5c3_Var230, templ_7745c5c3_Err = templ.JoinStringErrs(pr.Help)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 978, Col: 54}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 985, Col: 54}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var229))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var230))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 405, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 408, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4886,7 +4912,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 406, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 409, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4895,7 +4921,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, 407, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 410, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4913,6 +4939,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
// ProviderOption is a notification service the form offers.
type ProviderOption struct {
Type string
+ Group string
Help string
Fields []ProviderField
}
@@ -4945,208 +4972,208 @@ func providerField(f ProviderField) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 408, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 411, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var231 string
- templ_7745c5c3_Var231, templ_7745c5c3_Err = templ.JoinStringErrs(f.Label)
+ var templ_7745c5c3_Var232 string
+ templ_7745c5c3_Var232, 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: 1015, Col: 12}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1023, Col: 12}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var231))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var232))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 409, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 412, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !f.Required {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 410, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 413, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var232 string
- templ_7745c5c3_Var232, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + i18n.T(ctx, "channels.optional"))
+ var templ_7745c5c3_Var233 string
+ templ_7745c5c3_Var233, 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: 1017, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1025, Col: 89}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var232))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var233))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- 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
}
}
- 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
}
switch {
case f.Kind == "select":
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 413, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 417, "\" 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, 415, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 418, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 419, "\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if o == f.Default {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 420, " selected")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 421, ">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var236 string
+ templ_7745c5c3_Var236, 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}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var236))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 422, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 420, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 423, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
case f.Secret:
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 421, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- default:
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 425, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ default:
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 428, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 431, "\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if f.Required {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 432, " required")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 433, " placeholder=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var241 string
+ templ_7745c5c3_Var241, 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: 1043, Col: 80}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var241)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 434, "\" 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, 432, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 435, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5171,85 +5198,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, 433, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 437, "\" 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, 435, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 438, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var243 string
- templ_7745c5c3_Var243, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.none"))
+ 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: 1045, Col: 48}
+ 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_Var243))
+ _, 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, 436, " ")
+ 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, 437, "")
+ 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
+ }
+ if g.ID == selected {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 442, " selected")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 443, ">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var246 string
+ templ_7745c5c3_Var246, 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: 1056, Col: 66}
+ }
+ _, 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, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 442, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 445, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5292,7 +5319,7 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var247 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var248 := 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 {
@@ -5304,20 +5331,20 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 443, "← ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 446, "← ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var248 string
- templ_7745c5c3_Var248, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
+ var templ_7745c5c3_Var249 string
+ templ_7745c5c3_Var249, 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: 1073, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1081, Col: 115}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var248))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var249))
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, 447, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5326,69 +5353,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, 445, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 448, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, g := range v.Groups {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 446, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 449, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 450, "\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var251 string
+ templ_7745c5c3_Var251, 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}
+ }
+ _, 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, 451, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if g.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 449, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var251 string
- templ_7745c5c3_Var251, 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: 1083, Col: 99}
- }
- _, 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, 450, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 459, "\" data-confirm=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var256 string
- templ_7745c5c3_Var256, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.delete"))
+ templ_7745c5c3_Var256, 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: 1093, Col: 200}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1101, Col: 120}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var256))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var256)
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, 460, "\" class=\"mt-4 text-sm text-down hover:underline\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var257 string
+ templ_7745c5c3_Var257, 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: 1101, Col: 200}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var257))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 461, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 459, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 462, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 460, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 463, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 461, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 464, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if v.CanWrite {
- 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
}
@@ -5496,7 +5523,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, 463, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 470, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
return nil
})
- templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var247), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var248), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5576,7 +5603,7 @@ func pingSection(url string) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- 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
}
@@ -5584,55 +5611,55 @@ func pingSection(url string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 469, "")
- 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, "monitors.ping_intro"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1128, Col: 83}
- }
- _, 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, 470, "
")
+ 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("curl -fsS -m 10 --retry 3 " + url + "\n")
+ 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: 1129, Col: 137}
+ 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
}
- var templ_7745c5c3_Var261 string
- templ_7745c5c3_Var261, templ_7745c5c3_Err = templ.JoinStringErrs("curl -fsS -m 10 --retry 3 --data-raw \"$output\" " + url + "/fail")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 473, "
")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1129, Col: 208}
+ 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))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 471, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
var templ_7745c5c3_Var262 string
- templ_7745c5c3_Var262, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.ping_secret"))
+ templ_7745c5c3_Var262, 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: 1130, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1137, Col: 208}
}
_, 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, 472, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 474, "")
+ 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"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1138, Col: 84}
+ }
+ _, 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, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5678,20 +5705,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, 473, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 476, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var264 string
- templ_7745c5c3_Var264, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_hint"))
+ var templ_7745c5c3_Var265 string
+ templ_7745c5c3_Var265, 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: 1156, Col: 69}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1164, Col: 69}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var264))
+ _, 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, 474, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 477, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5719,33 +5746,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, 475, "")
- 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_query"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1167, Col: 118}
- }
- _, 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, 476, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 479, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5777,56 +5804,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, 478, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var268 string
- templ_7745c5c3_Var268, templ_7745c5c3_Err = templ.JoinStringErrs(label)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1178, Col: 90}
- }
- _, 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, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var269 string
- templ_7745c5c3_Var269, templ_7745c5c3_Err = templruntime.NewAttributeExpression(name).Resolve(ctx)
+ templ_7745c5c3_Var269, templ_7745c5c3_Err = templ.JoinStringErrs(label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1181, Col: 14}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1186, Col: 90}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var269)
+ _, 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, "\" autocomplete=\"new-password\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 482, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 486, " 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
}
@@ -5852,66 +5879,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, 484, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 487, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var272 string
- templ_7745c5c3_Var272, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_tls"))
+ var templ_7745c5c3_Var273 string
+ templ_7745c5c3_Var273, 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: 1194, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1202, Col: 115}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var272))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var273))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 485, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 488, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, m := range modes {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 486, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 489, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 490, "\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if m == value {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 491, " selected")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 492, ">")
+ 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))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1205, Col: 84}
+ }
+ _, 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, 493, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 491, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 494, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5936,20 +5963,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, 492, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 495, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var276 string
- templ_7745c5c3_Var276, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.broker_hint_"+typ))
+ var templ_7745c5c3_Var277 string
+ templ_7745c5c3_Var277, 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: 1204, Col: 78}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1212, Col: 78}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var276))
+ _, 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
}
@@ -5976,66 +6003,66 @@ func brokerFields(typ string, b BrokerForm) templ.Component {
return templ_7745c5c3_Err
}
case "kafka":
- 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
}
- var templ_7745c5c3_Var277 string
- templ_7745c5c3_Var277, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.broker_sasl"))
+ var templ_7745c5c3_Var278 string
+ templ_7745c5c3_Var278, 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: 1214, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1222, Col: 122}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var277))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var278))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- 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
}
for _, m := range []string{"plain", "scram-sha-256", "scram-sha-512"} {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 496, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 499, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 500, "\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if m == b.SASL {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 501, " selected")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 502, ">")
+ 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))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1225, Col: 72}
+ }
+ _, 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, 503, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 501, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 504, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -6068,4 +6095,15 @@ func condKey(c string) string {
return c
}
+// providerGroups lists the groups of providers in the order they come.
+func providerGroups(ps []ProviderOption) []string {
+ var out []string
+ for _, p := range ps {
+ if !slices.Contains(out, p.Group) {
+ out = append(out, p.Group)
+ }
+ }
+ return out
+}
+
var _ = templruntime.GeneratedTemplate
--
2.54.1
From 8544e5a58533c6286d22142eaad610cda47f5a6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?=
Date: Sun, 22 Nov 2026 18:25:36 +0100
Subject: [PATCH 2/3] feat(alerting): add monitor alert groups with default
routing
---
README.md | 12 +
internal/api/alert_groups.go | 170 +
internal/api/alert_groups_test.go | 154 +
internal/api/alerting.go | 5 +-
internal/api/apidocs.go | 15 +-
internal/api/audit.go | 3 +
internal/api/console.go | 35 +
internal/api/gdpr.go | 21 +-
internal/api/gdpr_test.go | 14 +
internal/api/monitors.go | 46 +-
internal/api/server.go | 4 +
internal/i18n/locales/de.json | 17 +-
internal/i18n/locales/en.json | 17 +-
internal/migrations/alert_groups_test.go | 72 +
.../migrations/sql/00039_alert_groups.sql | 78 +
internal/store/alert_groups.sql.go | 240 ++
internal/store/incidents.sql.go | 24 -
internal/store/models.go | 19 +
internal/store/querier.go | 12 +-
internal/store/queries/alert_groups.sql | 42 +
internal/store/queries/incidents.sql | 3 -
internal/web/alert_groups.templ | 77 +
internal/web/alert_groups_templ.go | 400 +++
internal/web/monitors.templ | 8 +
internal/web/monitors_templ.go | 2910 +++++++++--------
internal/web/testdata/forms.html | 13 +
26 files changed, 2938 insertions(+), 1473 deletions(-)
create mode 100644 internal/api/alert_groups.go
create mode 100644 internal/api/alert_groups_test.go
create mode 100644 internal/migrations/alert_groups_test.go
create mode 100644 internal/migrations/sql/00039_alert_groups.sql
create mode 100644 internal/store/alert_groups.sql.go
create mode 100644 internal/store/queries/alert_groups.sql
create mode 100644 internal/web/alert_groups.templ
create mode 100644 internal/web/alert_groups_templ.go
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";
--
2.54.1
From ef7e12a52d19170e300ccce538502cc24d9d8c55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?=
Date: Sun, 22 Nov 2026 18:30:46 +0100
Subject: [PATCH 3/3] fix(alerting): refresh channel groups after webhook
creation
---
internal/i18n/locales/de.json | 2 +
internal/i18n/locales/en.json | 2 +
internal/web/alert_groups.templ | 2 +-
internal/web/alert_groups_templ.go | 2 +-
internal/web/assets/app.js | 16 +-
internal/web/monitors.templ | 52 +-
internal/web/monitors_templ.go | 1038 ++++++++++++++--------------
internal/web/testdata/webhook.html | 43 ++
8 files changed, 626 insertions(+), 531 deletions(-)
create mode 100644 internal/web/testdata/webhook.html
diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json
index fc30198..5c8ae9d 100644
--- a/internal/i18n/locales/de.json
+++ b/internal/i18n/locales/de.json
@@ -135,6 +135,7 @@
"auth.sso.org_placeholder": "Kurzname der Organisation",
"auth.sso.submit": "Weiter",
"channels.create": "Kanal anlegen",
+ "channels.created": "Webhook erstellt. Er ist bereits in der Standardgruppe. Kopiere den Signaturschlüssel, bevor du fortfährst.",
"channels.delete_confirm": "Diesen Kanal löschen?",
"channels.field_access_key": "Zugriffsschlüssel",
"channels.field_access_key_id": "AccessKey-ID",
@@ -273,6 +274,7 @@
"channels.help_telegram": "Lege mit @BotFather einen Bot an; die Chat-ID einer Gruppe beginnt mit -100.",
"channels.intro": "Aktivierte Kanäle erhalten Ausfall- und Entwarnungsmeldungen von Monitoren, die ihren Alertgruppen zugeordnet sind.",
"channels.language": "Sprache",
+ "channels.manage_groups": "Schlüssel kopiert — Alertgruppen verwalten",
"channels.new_email": "Neuer E-Mail-Kanal",
"channels.new_service": "Weitere Dienste",
"channels.new_webhook": "Neuer Webhook",
diff --git a/internal/i18n/locales/en.json b/internal/i18n/locales/en.json
index 26f66b0..0c30e30 100644
--- a/internal/i18n/locales/en.json
+++ b/internal/i18n/locales/en.json
@@ -135,6 +135,7 @@
"auth.sso.org_placeholder": "Organization short name",
"auth.sso.submit": "Continue",
"channels.create": "Create channel",
+ "channels.created": "Webhook created. It is already in the default alert group. Copy the signing secret before continuing.",
"channels.delete_confirm": "Delete this channel?",
"channels.field_access_key": "Access key",
"channels.field_access_key_id": "AccessKey ID",
@@ -273,6 +274,7 @@
"channels.help_telegram": "Create a bot with @BotFather; the chat ID of a group starts with -100.",
"channels.intro": "Enabled channels receive outage and recovery alerts from monitors assigned to their alert groups.",
"channels.language": "Language",
+ "channels.manage_groups": "Secret copied — manage alert groups",
"channels.new_email": "New email channel",
"channels.new_service": "Other services",
"channels.new_webhook": "New webhook",
diff --git a/internal/web/alert_groups.templ b/internal/web/alert_groups.templ
index a19acc5..73bf0d5 100644
--- a/internal/web/alert_groups.templ
+++ b/internal/web/alert_groups.templ
@@ -32,7 +32,7 @@ templ alertGroupOptions(name string, options []AlertGroupOption) {
}
templ alertGroupsSettings(v ChannelsView) {
-
+
@sectionHeading("alert_groups.title")
{ i18n.T(ctx, "alert_groups.intro") }
diff --git a/internal/web/alert_groups_templ.go b/internal/web/alert_groups_templ.go
index c35bb6a..c63cec1 100644
--- a/internal/web/alert_groups_templ.go
+++ b/internal/web/alert_groups_templ.go
@@ -160,7 +160,7 @@ func alertGroupsSettings(v ChannelsView) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/web/assets/app.js b/internal/web/assets/app.js
index 10b6719..7e23821 100644
--- a/internal/web/assets/app.js
+++ b/internal/web/assets/app.js
@@ -85,6 +85,7 @@
const form = ev.target.closest("form[data-api]");
if (!form) return;
ev.preventDefault();
+ if (form.dataset.created !== undefined) return;
if (form.dataset.confirm && !confirm(form.dataset.confirm)) return;
const button = form.querySelector("button[type=submit]");
const body = serialize(form);
@@ -112,6 +113,19 @@
input.value = shown;
out.hidden = false;
input.select();
+ if (form.dataset.refreshTarget) {
+ // Keep the one-time secret visible while refreshing the channel list
+ // and group choices. A successful create must not be submitted twice.
+ form.dataset.created = "true";
+ const response = await fetch(location.href, { credentials: "same-origin" });
+ if (!response.ok) throw new Error("refresh failed");
+ const page = new DOMParser().parseFromString(await response.text(), "text/html");
+ const selector = form.dataset.refreshTarget;
+ const updated = page.querySelector(selector);
+ const current = document.querySelector(selector);
+ if (!updated || !current) throw new Error("refresh target missing");
+ current.replaceWith(updated);
+ }
return;
}
if (res.data?.status === "totp_required" && totpStep) {
@@ -126,7 +140,7 @@
} catch (err) {
showError(form, message(err));
} finally {
- button && (button.disabled = false);
+ button && (button.disabled = form.dataset.created !== undefined);
}
});
diff --git a/internal/web/monitors.templ b/internal/web/monitors.templ
index 6909486..f7fd3ff 100644
--- a/internal/web/monitors.templ
+++ b/internal/web/monitors.templ
@@ -892,34 +892,36 @@ 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 {
-
- if ch.Enabled {
- @statusDot(StatusUp)
- } else {
- @statusDot(StatusPaused)
- }
- { ch.Name }
- { i18n.T(ctx, "channels.type_"+ch.Type) }
- { ch.Target }
- if v.CanWrite {
-
- { i18n.T(ctx, "channels.test") }
- { i18n.T(ctx, "regions.delete") }
-
- }
-
- }
-
- }
+
+ @alertGroupsSettings(v)
+ if len(v.Channels) > 0 {
+
+ for _, ch := range v.Channels {
+
+ if ch.Enabled {
+ @statusDot(StatusUp)
+ } else {
+ @statusDot(StatusPaused)
+ }
+ { ch.Name }
+ { i18n.T(ctx, "channels.type_"+ch.Type) }
+ { ch.Target }
+ if v.CanWrite {
+
+ { i18n.T(ctx, "channels.test") }
+ { i18n.T(ctx, "regions.delete") }
+
+ }
+
+ }
+
+ }
+
if v.CanWrite {
@sectionHeading("channels.new_webhook")
-
+
@formError()
@valueField(i18n.T(ctx, "sso.field.name"), "name", "", "Ops", true)
@@ -927,7 +929,9 @@ templ ChannelsPage(p Page, me Me, v ChannelsView) {
@submit(i18n.T(ctx, "channels.create"))
diff --git a/internal/web/monitors_templ.go b/internal/web/monitors_templ.go
index c5a3c11..122a967 100644
--- a/internal/web/monitors_templ.go
+++ b/internal/web/monitors_templ.go
@@ -4379,17 +4379,21 @@ 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, 350, "
")
+ 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, 350, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 351, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, ch := range v.Channels {
- 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
}
@@ -4404,149 +4408,149 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
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_Var208 string
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: 905, Col: 21}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 906, Col: 22}
}
_, 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, 353, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 354, " ")
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}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 907, Col: 71}
}
_, 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, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 355, " ")
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}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 908, Col: 78}
}
_, 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, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 356, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if v.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 356, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 359, "\" class=\"text-muted hover:text-ink\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var213 string
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: 910, Col: 187}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 911, Col: 188}
}
_, 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, 359, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 362, "\" 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}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 912, Col: 194}
}
_, 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, " ")
+ 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, 363, " ")
+ 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, 364, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 365, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 365, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 366, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if v.CanWrite {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 366, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 367, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4554,7 +4558,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, 367, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 368, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4562,7 +4566,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, 368, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 369, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4578,20 +4582,46 @@ 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, 369, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 370, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var217 string
templ_7745c5c3_Var217, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.secret_now"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 929, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 931, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var217))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 370, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 371, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var218 string
+ templ_7745c5c3_Var218, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.created"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 932, Col: 64}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var218))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 372, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var219 string
+ templ_7745c5c3_Var219, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.manage_groups"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 934, Col: 132}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var219))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 373, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4600,7 +4630,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, 371, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 374, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4608,7 +4638,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, 372, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 375, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4616,79 +4646,79 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 373, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 376, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var218 string
- templ_7745c5c3_Var218, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.to"))
+ var templ_7745c5c3_Var220 string
+ templ_7745c5c3_Var220, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.to"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 942, Col: 117}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 946, Col: 117}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var218))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var220))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 374, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 377, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var219 string
- templ_7745c5c3_Var219, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.language"))
+ var templ_7745c5c3_Var221 string
+ templ_7745c5c3_Var221, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.language"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 946, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 950, Col: 123}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var219))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var221))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 375, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 378, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, l := range v.Languages {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 376, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 382, ">")
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, "lang."+l))
+ var templ_7745c5c3_Var223 string
+ templ_7745c5c3_Var223, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "lang."+l))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 949, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 953, Col: 88}
}
- _, 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, 380, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 383, "")
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
}
@@ -4696,30 +4726,30 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 382, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 385, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- 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_Var222 string
- templ_7745c5c3_Var222, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "error.email_not_configured"))
+ var templ_7745c5c3_Var224 string
+ templ_7745c5c3_Var224, 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: 956, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 960, Col: 79}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var222))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var224))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 384, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 387, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 385, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 388, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4727,20 +4757,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, 386, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 389, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var223 string
- templ_7745c5c3_Var223, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.service_intro"))
+ var templ_7745c5c3_Var225 string
+ templ_7745c5c3_Var225, 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: 961, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 965, Col: 89}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var223))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var225))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 387, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 390, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4748,81 +4778,81 @@ 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, 388, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 391, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var224 string
- templ_7745c5c3_Var224, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.service"))
+ var templ_7745c5c3_Var226 string
+ templ_7745c5c3_Var226, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.service"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 966, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 970, Col: 122}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var224))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var226))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 389, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 392, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, g := range providerGroups(v.Providers) {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 390, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 394, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, pr := range v.Providers {
if pr.Group == g {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 392, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 396, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var227 string
- templ_7745c5c3_Var227, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.type_"+pr.Type))
+ var templ_7745c5c3_Var229 string
+ templ_7745c5c3_Var229, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.type_"+pr.Type))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 972, Col: 78}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 976, Col: 78}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var227))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var229))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 394, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 397, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 395, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 398, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 396, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 399, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4830,118 +4860,118 @@ 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, 397, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 400, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var228 string
- templ_7745c5c3_Var228, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.language"))
+ var templ_7745c5c3_Var230 string
+ templ_7745c5c3_Var230, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "channels.language"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 981, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 985, Col: 123}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var228))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var230))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 398, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 401, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, l := range v.Languages {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 399, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var230 string
- templ_7745c5c3_Var230, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "lang."+l))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 984, Col: 88}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var230))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 403, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 404, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- for i, pr := range v.Providers {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 405, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var232 string
+ templ_7745c5c3_Var232, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "lang."+l))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 988, Col: 88}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var232))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 406, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 407, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for i, pr := range v.Providers {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 408, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 412, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if pr.Help != "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 410, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 413, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var232 string
- templ_7745c5c3_Var232, templ_7745c5c3_Err = templ.JoinStringErrs(pr.Help)
+ var templ_7745c5c3_Var234 string
+ templ_7745c5c3_Var234, templ_7745c5c3_Err = templ.JoinStringErrs(pr.Help)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 993, Col: 54}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 997, Col: 54}
}
- _, 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, 411, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 414, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -4952,7 +4982,7 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component {
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
}
@@ -4961,7 +4991,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, 413, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 416, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5012,208 +5042,208 @@ func providerField(f ProviderField) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- 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
}
- var templ_7745c5c3_Var234 string
- templ_7745c5c3_Var234, templ_7745c5c3_Err = templ.JoinStringErrs(f.Label)
+ var templ_7745c5c3_Var236 string
+ templ_7745c5c3_Var236, 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: 1031, Col: 12}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1035, Col: 12}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var234))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var236))
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
}
if !f.Required {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 416, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 419, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var235 string
- templ_7745c5c3_Var235, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + i18n.T(ctx, "channels.optional"))
+ var templ_7745c5c3_Var237 string
+ templ_7745c5c3_Var237, 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: 1033, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1037, Col: 89}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var235))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var237))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 417, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 420, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 418, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 421, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
switch {
case f.Kind == "select":
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 419, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 423, "\" 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, 421, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 427, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var238 string
- templ_7745c5c3_Var238, templ_7745c5c3_Err = templ.JoinStringErrs(o)
+ var templ_7745c5c3_Var240 string
+ templ_7745c5c3_Var240, templ_7745c5c3_Err = templ.JoinStringErrs(o)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1040, Col: 58}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1044, Col: 58}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var238))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var240))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 425, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 428, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 426, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 429, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
case f.Secret:
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 427, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- default:
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 431, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ default:
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 434, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 436, "\" value=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var244 string
+ templ_7745c5c3_Var244, 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: 1053, Col: 22}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var244)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 437, "\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ if f.Required {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 438, " required")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 439, " placeholder=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var245 string
+ templ_7745c5c3_Var245, 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: 1055, Col: 80}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var245)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 440, "\" 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, 438, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 441, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5238,85 +5268,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, 439, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 443, "\" 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, 441, "")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var246 string
- 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: 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, 442, " ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- for _, g := range groups {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 443, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 444, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var248 string
- templ_7745c5c3_Var248, templ_7745c5c3_Err = templ.JoinStringErrs(g.Label)
+ templ_7745c5c3_Var248, 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: 1064, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1065, Col: 48}
}
_, 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, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 445, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 448, " ")
+ for _, g := range groups {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 446, "
")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var250 string
+ templ_7745c5c3_Var250, 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: 1068, Col: 66}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var250))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 450, " ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 451, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5359,7 +5389,7 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var250 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Var252 := 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 {
@@ -5371,20 +5401,20 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 449, "
← ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 452, "← ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var251 string
- templ_7745c5c3_Var251, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
+ var templ_7745c5c3_Var253 string
+ templ_7745c5c3_Var253, 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: 1089, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1093, Col: 115}
}
- _, 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, 450, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 453, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5393,69 +5423,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, 451, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 454, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, g := range v.Groups {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 452, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 456, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var253 string
- templ_7745c5c3_Var253, templ_7745c5c3_Err = templ.JoinStringErrs(g.Name)
+ var templ_7745c5c3_Var255 string
+ templ_7745c5c3_Var255, 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: 1096, Col: 21}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1100, Col: 21}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var253))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var255))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 454, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 457, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if g.CanWrite {
- 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, "sso.action.edit"))
+ var templ_7745c5c3_Var256 string
+ templ_7745c5c3_Var256, 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: 1099, Col: 99}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1103, Col: 99}
}
- _, 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, 460, "\" data-method=\"put\" data-next=\"/groups\" class=\"mt-3 w-72\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5467,20 +5497,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, 458, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 461, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var256 string
- templ_7745c5c3_Var256, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "groups.parent"))
+ var templ_7745c5c3_Var258 string
+ templ_7745c5c3_Var258, 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: 1104, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1108, Col: 122}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var256))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var258))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 459, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 462, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5488,7 +5518,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, 460, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 463, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5496,66 +5526,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, 461, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 464, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 465, "\" data-confirm=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var260 string
+ templ_7745c5c3_Var260, 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: 1113, Col: 120}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var260)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 466, "\" class=\"mt-4 text-sm text-down hover:underline\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var261 string
+ templ_7745c5c3_Var261, 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: 1113, Col: 200}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var261))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 467, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- 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
}
}
- 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
}
}
- 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
}
if v.CanWrite {
- 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
}
@@ -5563,7 +5593,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
}
@@ -5575,20 +5605,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, 470, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 473, "")
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, "groups.parent"))
+ var templ_7745c5c3_Var262 string
+ templ_7745c5c3_Var262, 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: 1124, Col: 117}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1128, Col: 117}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var260))
+ _, 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, 471, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 474, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5596,7 +5626,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, 472, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 475, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5604,14 +5634,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, 473, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 476, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
return nil
})
- templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var250), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var252), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5643,7 +5673,7 @@ func pingSection(url string) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 474, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 477, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5651,55 +5681,55 @@ func pingSection(url string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- 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(i18n.T(ctx, "monitors.ping_intro"))
- if templ_7745c5c3_Err != nil {
- 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, 476, "
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var263 string
- 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: 1145, Col: 137}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var263))
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 478, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var264 string
- templ_7745c5c3_Var264, templ_7745c5c3_Err = templ.JoinStringErrs("curl -fsS -m 10 --retry 3 --data-raw \"$output\" " + url + "/fail")
+ templ_7745c5c3_Var264, 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: 1145, Col: 208}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1148, Col: 83}
}
_, 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, "
")
+ 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.ping_secret"))
+ templ_7745c5c3_Var265, 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: 1146, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1149, Col: 137}
}
_, 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, " ")
+ var templ_7745c5c3_Var266 string
+ templ_7745c5c3_Var266, 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: 1149, Col: 208}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var266))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 480, "")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var267 string
+ templ_7745c5c3_Var267, 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: 1150, Col: 84}
+ }
+ _, 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, 481, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5745,20 +5775,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, 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(i18n.T(ctx, "monitors.db_hint"))
+ var templ_7745c5c3_Var269 string
+ templ_7745c5c3_Var269, 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: 1172, Col: 69}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1176, Col: 69}
}
- _, 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
}
@@ -5786,33 +5816,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, 481, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 484, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var268 string
- templ_7745c5c3_Var268, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.db_query"))
+ var templ_7745c5c3_Var270 string
+ templ_7745c5c3_Var270, 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: 1183, Col: 118}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1187, Col: 118}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var268))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var270))
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, 485, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var269 string
- templ_7745c5c3_Var269, templ_7745c5c3_Err = templ.JoinStringErrs(d.Query)
+ var templ_7745c5c3_Var271 string
+ templ_7745c5c3_Var271, 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: 1184, Col: 185}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1188, Col: 185}
}
- _, 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, 483, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 486, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -5844,56 +5874,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, 484, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 487, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var271 string
- templ_7745c5c3_Var271, templ_7745c5c3_Err = templ.JoinStringErrs(label)
+ var templ_7745c5c3_Var273 string
+ templ_7745c5c3_Var273, templ_7745c5c3_Err = templ.JoinStringErrs(label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1194, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1198, Col: 90}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var271))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var273))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 485, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 492, " 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
}
@@ -5919,66 +5949,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, 490, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 493, "")
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"))
+ var templ_7745c5c3_Var277 string
+ templ_7745c5c3_Var277, 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: 1210, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1214, Col: 115}
}
- _, 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, 491, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 494, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, m := range modes {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 492, "")
+ 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.db_tls_"+m))
+ var templ_7745c5c3_Var279 string
+ templ_7745c5c3_Var279, 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: 1213, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1217, Col: 84}
}
- _, 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
}
}
- 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
}
@@ -6003,20 +6033,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, 498, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 501, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var279 string
- templ_7745c5c3_Var279, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.broker_hint_"+typ))
+ var templ_7745c5c3_Var281 string
+ templ_7745c5c3_Var281, 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: 1220, Col: 78}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1224, Col: 78}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var279))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var281))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 499, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 502, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -6043,66 +6073,66 @@ func brokerFields(typ string, b BrokerForm) templ.Component {
return templ_7745c5c3_Err
}
case "kafka":
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 500, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 503, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var280 string
- templ_7745c5c3_Var280, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.broker_sasl"))
+ var templ_7745c5c3_Var282 string
+ templ_7745c5c3_Var282, 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: 1230, Col: 122}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1234, Col: 122}
}
- _, 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, 501, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 504, " ")
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, 502, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 508, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var282 string
- templ_7745c5c3_Var282, templ_7745c5c3_Err = templ.JoinStringErrs(strings.ToUpper(m))
+ var templ_7745c5c3_Var284 string
+ templ_7745c5c3_Var284, 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: 1233, Col: 72}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 1237, Col: 72}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var282))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var284))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 506, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 509, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 507, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 510, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/web/testdata/webhook.html b/internal/web/testdata/webhook.html
new file mode 100644
index 0000000..ebacb7b
--- /dev/null
+++ b/internal/web/testdata/webhook.html
@@ -0,0 +1,43 @@
+
+
Old channels
+
+ Create
+
+
+
+
+
+
+
--
2.54.1