diff --git a/internal/api/console.go b/internal/api/console.go
index 9f57f17..01a2fba 100644
--- a/internal/api/console.go
+++ b/internal/api/console.go
@@ -475,6 +475,7 @@ func (s *Server) monitorEditor(c *gin.Context, p *principal, page web.Page, me w
f := web.MonitorForm{
Type: "http", IntervalSeconds: 60, TimeoutMS: 10000, Confirmations: 2, Enabled: true,
MinInterval: s.minInterval(), Method: "GET", ExpectStatus: "2xx, 3xx", GraceSeconds: check.DefaultHeartbeatGrace,
+ JSONExpect: "2xx", JSONVerify: true, Assertions: assertionRows(nil),
FollowRedirects: true, VerifyTLS: true, DNSRecord: "A", TLSMinDays: 14,
}
var (
@@ -540,12 +541,21 @@ func fillForm(f *web.MonitorForm, m store.Monitor) {
if m.GroupID != nil {
f.GroupID = m.GroupID.String()
}
+ // Defaults for the other types, in case the type is switched.
+ f.JSONExpect, f.JSONVerify, f.Assertions, f.GraceSeconds = "2xx", true, assertionRows(nil), check.DefaultHeartbeatGrace
switch check.Type(m.Type) {
case check.HTTP:
var c check.HTTPConfig
_ = json.Unmarshal(m.Config, &c)
f.Method, f.ExpectStatus, f.Keyword, f.KeywordAbsent = c.Method, strings.Join(c.ExpectStatus, ", "), c.Keyword, c.KeywordAbsent
f.FollowRedirects, f.VerifyTLS = c.FollowRedirects, c.VerifyTLS
+ f.Headers = headerLines(c.Headers)
+ case check.JSON:
+ var c check.JSONConfig
+ _ = json.Unmarshal(m.Config, &c)
+ f.JSONMethod, f.JSONBody, f.JSONExpect, f.JSONVerify = c.Method, c.Body, strings.Join(c.ExpectStatus, ", "), c.VerifyTLS
+ f.Headers = headerLines(c.Headers)
+ f.Assertions = assertionRows(c.Assertions)
case check.DNS:
var c check.DNSConfig
_ = json.Unmarshal(m.Config, &c)
@@ -887,3 +897,26 @@ func (s *Server) detailPingURL(p *principal, d monitorData, m store.Monitor) str
}
return s.pingURL(m.Target)
}
+
+// assertionRows pads the assertions of a JSON check to the rows the form
+// offers.
+func assertionRows(as []check.Assertion) []web.AssertionRow {
+ rows := make([]web.AssertionRow, max(len(as)+2, 5))
+ for i, a := range as {
+ rows[i] = web.AssertionRow{Path: a.Path, Op: a.Op, Value: a.Value}
+ }
+ return rows
+}
+
+func headerLines(h map[string]string) string {
+ keys := make([]string, 0, len(h))
+ for k := range h {
+ keys = append(keys, k)
+ }
+ slices.Sort(keys)
+ var b strings.Builder
+ for _, k := range keys {
+ b.WriteString(k + ": " + h[k] + "\n")
+ }
+ return b.String()
+}
diff --git a/internal/api/jsoncheck_test.go b/internal/api/jsoncheck_test.go
new file mode 100644
index 0000000..2681280
--- /dev/null
+++ b/internal/api/jsoncheck_test.go
@@ -0,0 +1,88 @@
+package api_test
+
+import (
+ "context"
+ "net/http"
+ "net/http/httptest"
+ "strconv"
+ "strings"
+ "sync/atomic"
+ "testing"
+ "time"
+)
+
+func TestJSONCheck(t *testing.T) {
+ e := newEnv(t)
+ ctx, cancel := context.WithCancel(context.Background())
+ t.Cleanup(cancel)
+ go e.api.RunScheduler(ctx)
+
+ var depth atomic.Int64
+ depth.Store(3)
+ api := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if r.Header.Get("X-Api-Key") != "s3cret-key" {
+ w.WriteHeader(http.StatusUnauthorized)
+ return
+ }
+ w.Header().Set("Content-Type", "application/json")
+ _, _ = w.Write([]byte(`{"status":"ok","queue":{"depth":` + itoa(depth.Load()) + `}}`))
+ }))
+ defer api.Close()
+ tok, region := e.platformChecker(t, uniq("eu-"))
+ e.startChecker(t, tok)
+
+ owner := e.browser(t)
+ owner.signup("o@"+uniq("jc")+".test", uniq("jc-"))
+ st, body := owner.do("POST", "/api/v1/org/monitors", map[string]any{
+ "name": "Queue", "type": "json", "target": api.URL, "interval_seconds": 10, "timeout_ms": 2000, "confirmations": 1,
+ "regions": []string{region},
+ "config": map[string]any{
+ "headers": map[string]string{"X-Api-Key": "s3cret-key"},
+ "assertions": []map[string]string{
+ {"path": "status", "op": "==", "value": "ok"},
+ {"path": "queue.depth", "op": "<", "value": "10"},
+ {"path": "", "op": "==", "value": ""},
+ },
+ },
+ })
+ if st != http.StatusCreated {
+ t.Fatalf("create json monitor = %d %v", st, body)
+ }
+ latest := func() map[string]any {
+ _, list := owner.do("GET", "/api/v1/org/monitors", nil)
+ for _, m := range list["monitors"].([]any) {
+ if l := m.(map[string]any)["latest"].([]any); len(l) > 0 {
+ return l[0].(map[string]any)
+ }
+ }
+ return nil
+ }
+ waitFor(t, 15*time.Second, "a successful JSON check", func() bool {
+ l := latest()
+ return l != nil && l["ok"] == true
+ })
+ depth.Store(42)
+ waitFor(t, 25*time.Second, "a failed assertion", func() bool {
+ l := latest()
+ return l != nil && l["ok"] == false && strings.Contains(asString(l["error"]), "queue.depth is 42, expected < 10")
+ })
+
+ // Readers see the condition, not the credential.
+ viewer := e.joinVia(t, owner.invite("v@"+uniq("jc")+".test", owner.roleID("viewer")))
+ _, vl := viewer.do("GET", "/api/v1/org/monitors", nil)
+ if raw := mustJSON(vl); strings.Contains(raw, "s3cret-key") || !strings.Contains(raw, "queue.depth") {
+ t.Errorf("viewer sees %s", raw)
+ }
+ if _, ol := owner.do("GET", "/api/v1/org/monitors", nil); !strings.Contains(mustJSON(ol), "s3cret-key") {
+ t.Error("the editor does not see the header to edit it")
+ }
+}
+
+func itoa(n int64) string {
+ return strconv.FormatInt(n, 10)
+}
+
+func asString(v any) string {
+ s, _ := v.(string)
+ return s
+}
diff --git a/internal/api/monitors.go b/internal/api/monitors.go
index ab2b92e..9f1698f 100644
--- a/internal/api/monitors.go
+++ b/internal/api/monitors.go
@@ -210,9 +210,8 @@ func (s *Server) listMonitors(c *gin.Context) {
continue
}
v := viewMonitor(m, byMonitor[m.ID])
- if check.Passive(check.Type(m.Type)) && !canInGroup(p, authz.MonitorsWrite, t, m.GroupID) {
- // Whoever knows the ping URL can report the job healthy.
- v.Target = ""
+ if !canInGroup(p, authz.MonitorsWrite, t, m.GroupID) {
+ v = redactMonitor(v)
}
v = s.withPingURL(v)
if l := latestBy[m.ID]; l != nil {
@@ -477,3 +476,23 @@ func (s *Server) reconcile(ctx context.Context) {
s.log.WarnContext(ctx, "schedule reconciliation failed", "error", err)
}
}
+
+// redactMonitor hides what only editors may see: the ping token of a
+// heartbeat, which can report the job healthy, and request header values,
+// which typically carry credentials.
+func redactMonitor(v monitorView) monitorView {
+ if check.Passive(check.Type(v.Type)) {
+ v.Target = ""
+ }
+ var cfg map[string]any
+ if json.Unmarshal(v.Config, &cfg) != nil {
+ return v
+ }
+ if h, ok := cfg["headers"].(map[string]any); ok {
+ for k := range h {
+ h[k] = "redacted"
+ }
+ v.Config, _ = json.Marshal(cfg)
+ }
+ return v
+}
diff --git a/internal/i18n/i18n_test.go b/internal/i18n/i18n_test.go
index 897f174..34b3378 100644
--- a/internal/i18n/i18n_test.go
+++ b/internal/i18n/i18n_test.go
@@ -151,13 +151,14 @@ func TestDynamicFamilies(t *testing.T) {
en := catalogKeys(t)["en"]
families := map[string][]string{
"status.": {"up", "degraded", "down", "unknown", "paused", "maintenance"},
- "monitors.type_": {"http", "tcp", "tls", "dns", "icmp", "heartbeat"},
+ "monitors.type_": {"http", "tcp", "tls", "dns", "icmp", "json", "heartbeat"},
"channels.type_": {"webhook", "email"},
"agents.kind_": {"checker", "statuspage"},
"page.status.": {"operational", "degraded", "outage", "unknown", "maintenance"},
"page.component.": {"operational", "degraded", "outage", "unknown", "maintenance"},
"storage.level_": {"raw", "1h", "1d"},
"legal.": {"imprint", "privacy"},
+ "monitors.op_": {"eq", "ne", "gt", "ge", "lt", "le", "contains", "exists", "absent"},
"weekday.": {"0", "1", "2", "3", "4", "5", "6"},
"md.": {"heading", "bold", "italic", "strike", "link", "ul", "ol", "quote", "code", "codeblock", "table", "hr"},
"maintenance.recurrence_": {"none", "daily", "weekly", "monthly"},
diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json
index 6ad351d..2d26f35 100644
--- a/internal/i18n/locales/de.json
+++ b/internal/i18n/locales/de.json
@@ -146,6 +146,10 @@
"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_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_code": "Code ungültig.",
"error.invalid_config": "Die Check-Einstellungen sind ungültig.",
"error.invalid_credentials": "E-Mail oder Passwort falsch.",
@@ -157,6 +161,7 @@
"error.invalid_header": "Ein Request-Header ist ungültig.",
"error.invalid_input": "Eingaben prüfen.",
"error.invalid_interval": "Das Intervall muss mindestens {{.Min}} Sekunden und höchstens einen Tag betragen.",
+ "error.invalid_json_body": "Der Request-Body ist kein gültiges JSON.",
"error.invalid_legal_url": "Der Link muss eine http- oder https-URL sein.",
"error.invalid_maintenance_duration": "Die Dauer muss zwischen 1 Minute und 30 Tagen liegen.",
"error.invalid_maintenance_time": "Prüfe Beginn, Wochentage und letzten Tag.",
@@ -429,6 +434,11 @@
"members.scope_org": "gesamte Organisation",
"members.title": "Mitglieder",
"members.unassign": "Rolle entfernen",
+ "monitors.assertion_op": "Operator",
+ "monitors.assertion_path": "Pfad",
+ "monitors.assertion_value": "Wert",
+ "monitors.assertions": "Bedingungen",
+ "monitors.assertions_hint": "Alle müssen erfüllt sein. Pfade wie status.database oder checks[0].state; leere Zeilen werden ignoriert.",
"monitors.by_region": "Nach Region",
"monitors.by_region_hint": "Anteil erfolgreicher Checks aus jeder Region. Die SLA sinkt nur, wenn alle Regionen gleichzeitig ausfallen.",
"monitors.confirmations": "Fehlschläge bis zum Alarm",
@@ -443,16 +453,28 @@
"monitors.follow_redirects": "Weiterleitungen folgen",
"monitors.grace": "Toleranz (Sekunden)",
"monitors.grace_hint": "Wie spät ein Ping sein darf, für Jobs, die manchmal länger laufen.",
+ "monitors.headers": "Request-Header",
+ "monitors.headers_hint": "Einer pro Zeile, „Name: Wert“. Nur Mitglieder, die den Monitor bearbeiten dürfen, sehen die Werte.",
"monitors.heartbeat_hint": "Dein Job ruft bei jedem Lauf eine geheime URL auf. Kommt innerhalb von Intervall plus Toleranz kein Aufruf, gilt der Monitor als ausgefallen. Die URL wird nach dem Speichern angezeigt.",
"monitors.history": "Verlauf, letzte {{.Range}}",
"monitors.interval": "Intervall (Sekunden)",
"monitors.interval_hint": "Mindestens {{.Min}} Sekunden.",
+ "monitors.json_body": "Request-Body (JSON, nur POST)",
"monitors.keyword": "Keyword in der Antwort",
"monitors.keyword_absent": "Fehler, wenn das Keyword vorkommt",
"monitors.last_90d": "Letzte 90 Tage",
"monitors.latency": "Durchschnittliche Latenz",
"monitors.method": "Methode",
"monitors.new": "Neuer Monitor",
+ "monitors.op_absent": "fehlt",
+ "monitors.op_contains": "enthält",
+ "monitors.op_eq": "gleich",
+ "monitors.op_exists": "existiert",
+ "monitors.op_ge": "≥",
+ "monitors.op_gt": ">",
+ "monitors.op_le": "≤",
+ "monitors.op_lt": "<",
+ "monitors.op_ne": "ungleich",
"monitors.ping_intro": "Rufe diese URL am Ende jedes erfolgreichen Laufs auf, per GET, HEAD oder POST. Mit angehängtem /fail meldest du einen Fehler; ein POST-Body oder ?msg= wird als Meldung gespeichert.",
"monitors.ping_secret": "Halte die URL geheim: Wer sie kennt, kann den Job als gesund melden. Nur Mitglieder, die diesen Monitor bearbeiten dürfen, sehen sie.",
"monitors.ping_url": "Ping-URL",
@@ -474,6 +496,7 @@
"monitors.type_heartbeat": "Heartbeat",
"monitors.type_http": "HTTP(S)",
"monitors.type_icmp": "Ping (ICMP)",
+ "monitors.type_json": "JSON-API",
"monitors.type_tcp": "TCP-Port",
"monitors.type_tls": "TLS-Zertifikat",
"monitors.uptime_chart": "Uptime pro Zeitraum",
diff --git a/internal/i18n/locales/en.json b/internal/i18n/locales/en.json
index 7b2abc2..66af142 100644
--- a/internal/i18n/locales/en.json
+++ b/internal/i18n/locales/en.json
@@ -146,6 +146,10 @@
"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_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_code": "Invalid code.",
"error.invalid_config": "The check settings are not valid.",
"error.invalid_credentials": "Wrong email or password.",
@@ -157,6 +161,7 @@
"error.invalid_header": "A request header is not valid.",
"error.invalid_input": "Please check your input.",
"error.invalid_interval": "The interval must be at least {{.Min}} seconds and at most one day.",
+ "error.invalid_json_body": "The request body is not valid JSON.",
"error.invalid_legal_url": "The link must be an http or https URL.",
"error.invalid_maintenance_duration": "The duration must be between 1 minute and 30 days.",
"error.invalid_maintenance_time": "Check start, weekdays and last day.",
@@ -429,6 +434,11 @@
"members.scope_org": "whole organization",
"members.title": "Members",
"members.unassign": "Remove role",
+ "monitors.assertion_op": "Operator",
+ "monitors.assertion_path": "Path",
+ "monitors.assertion_value": "Value",
+ "monitors.assertions": "Conditions",
+ "monitors.assertions_hint": "All must hold. Paths like status.database or checks[0].state; empty rows are ignored.",
"monitors.by_region": "By region",
"monitors.by_region_hint": "Share of successful checks from each region. The SLA only drops when all regions fail at the same time.",
"monitors.confirmations": "Failures before alerting",
@@ -443,16 +453,28 @@
"monitors.follow_redirects": "Follow redirects",
"monitors.grace": "Grace period (seconds)",
"monitors.grace_hint": "How late a ping may be, for jobs that sometimes run longer.",
+ "monitors.headers": "Request headers",
+ "monitors.headers_hint": "One per line, \"Name: value\". Only members who may edit the monitor see the values.",
"monitors.heartbeat_hint": "Your job calls a secret URL each time it runs. If no call arrives within the interval plus the grace period, the monitor is down. The URL is shown after saving.",
"monitors.history": "History, last {{.Range}}",
"monitors.interval": "Interval (seconds)",
"monitors.interval_hint": "At least {{.Min}} seconds.",
+ "monitors.json_body": "Request body (JSON, POST only)",
"monitors.keyword": "Keyword in response",
"monitors.keyword_absent": "Fail if the keyword is present",
"monitors.last_90d": "Last 90 days",
"monitors.latency": "Average latency",
"monitors.method": "Method",
"monitors.new": "New monitor",
+ "monitors.op_absent": "is absent",
+ "monitors.op_contains": "contains",
+ "monitors.op_eq": "equals",
+ "monitors.op_exists": "exists",
+ "monitors.op_ge": "≥",
+ "monitors.op_gt": ">",
+ "monitors.op_le": "≤",
+ "monitors.op_lt": "<",
+ "monitors.op_ne": "not equal",
"monitors.ping_intro": "Call this URL at the end of every successful run, with GET, HEAD or POST. Append /fail to report a failure; a POST body or ?msg= is stored as the message.",
"monitors.ping_secret": "Keep the URL secret: anyone who knows it can report the job as healthy. Only members who may edit this monitor see it.",
"monitors.ping_url": "Ping URL",
@@ -474,6 +496,7 @@
"monitors.type_heartbeat": "Heartbeat",
"monitors.type_http": "HTTP(S)",
"monitors.type_icmp": "Ping (ICMP)",
+ "monitors.type_json": "JSON API",
"monitors.type_tcp": "TCP port",
"monitors.type_tls": "TLS certificate",
"monitors.uptime_chart": "Uptime per period",
diff --git a/internal/migrations/sql/00029_json_checks.sql b/internal/migrations/sql/00029_json_checks.sql
new file mode 100644
index 0000000..1299298
--- /dev/null
+++ b/internal/migrations/sql/00029_json_checks.sql
@@ -0,0 +1,10 @@
+-- +goose Up
+ALTER TABLE monitors DROP CONSTRAINT monitors_type_check;
+ALTER TABLE monitors ADD CONSTRAINT monitors_type_check
+ CHECK (type IN ('http', 'tcp', 'icmp', 'dns', 'tls', 'json', 'heartbeat'));
+
+-- +goose Down
+DELETE FROM monitors WHERE type = 'json';
+ALTER TABLE monitors DROP CONSTRAINT monitors_type_check;
+ALTER TABLE monitors ADD CONSTRAINT monitors_type_check
+ CHECK (type IN ('http', 'tcp', 'icmp', 'dns', 'tls', 'heartbeat'));
diff --git a/internal/web/monitors.templ b/internal/web/monitors.templ
index 3626795..d39c2e5 100644
--- a/internal/web/monitors.templ
+++ b/internal/web/monitors.templ
@@ -459,6 +459,31 @@ type MonitorForm struct {
TLSMinDays int
TLSServerName string
GraceSeconds int
+ // Headers are "Name: value" lines, shared by HTTP and JSON checks.
+ Headers string
+ JSONMethod string
+ JSONBody string
+ JSONExpect string
+ JSONVerify bool
+ Assertions []AssertionRow
+}
+
+// AssertionRow is one condition of a JSON check; unused rows are empty.
+type AssertionRow struct {
+ Path string
+ Op string
+ Value string
+}
+
+// AssertionOps are offered in the JSON check form.
+var AssertionOps = []string{"==", "!=", ">", ">=", "<", "<=", "contains", "exists", "absent"}
+
+templ headersField(value string) {
+
}
templ typeFields(typ, current string) {
@@ -516,7 +541,7 @@ templ MonitorEditor(p Page, me Me, f MonitorForm) {
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3564,14 +3954,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, 299, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 332, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
return nil
})
- templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var150), templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var172), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3603,7 +3993,7 @@ func pingSection(url string) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 300, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 333, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3611,55 +4001,55 @@ func pingSection(url string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 301, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 334, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var162 string
- templ_7745c5c3_Var162, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.ping_intro"))
+ var templ_7745c5c3_Var184 string
+ templ_7745c5c3_Var184, 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: 780, Col: 83}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 840, Col: 83}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var162))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var184))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 302, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 335, "
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var163 string
- templ_7745c5c3_Var163, templ_7745c5c3_Err = templ.JoinStringErrs("curl -fsS -m 10 --retry 3 " + url + "\n")
+ var templ_7745c5c3_Var185 string
+ templ_7745c5c3_Var185, 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: 781, Col: 137}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 841, Col: 137}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var163))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var185))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var164 string
- templ_7745c5c3_Var164, templ_7745c5c3_Err = templ.JoinStringErrs("curl -fsS -m 10 --retry 3 --data-raw \"$output\" " + url + "/fail")
+ var templ_7745c5c3_Var186 string
+ templ_7745c5c3_Var186, 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: 781, Col: 208}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 841, Col: 208}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var164))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var186))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 303, "")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 336, "
")
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.ping_secret"))
+ var templ_7745c5c3_Var187 string
+ templ_7745c5c3_Var187, 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: 782, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 842, Col: 84}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var165))
+ _, 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, 304, "
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 337, "")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -3667,4 +4057,23 @@ func pingSection(url string) templ.Component {
})
}
+// opKey names an assertion operator in message IDs.
+func opKey(op string) string {
+ switch op {
+ case "==":
+ return "eq"
+ case "!=":
+ return "ne"
+ case ">":
+ return "gt"
+ case ">=":
+ return "ge"
+ case "<":
+ return "lt"
+ case "<=":
+ return "le"
+ }
+ return op
+}
+
var _ = templruntime.GeneratedTemplate