From 53ff2a628d584db253463f937f75c0034646f873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?= Date: Sun, 22 Nov 2026 12:54:56 +0100 Subject: [PATCH 1/2] feat(store): record agent instances and query results by checker Refs #82 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3 --- .../migrations/sql/00032_agent_instances.sql | 24 ++++ internal/store/agent_instances.sql.go | 130 ++++++++++++++++++ internal/store/check_results.sql.go | 82 ++++++++++- internal/store/models.go | 9 ++ internal/store/querier.go | 9 ++ internal/store/queries/agent_instances.sql | 20 +++ internal/store/queries/check_results.sql | 17 ++- 7 files changed, 289 insertions(+), 2 deletions(-) create mode 100644 internal/migrations/sql/00032_agent_instances.sql create mode 100644 internal/store/agent_instances.sql.go create mode 100644 internal/store/queries/agent_instances.sql diff --git a/internal/migrations/sql/00032_agent_instances.sql b/internal/migrations/sql/00032_agent_instances.sql new file mode 100644 index 0000000..388024b --- /dev/null +++ b/internal/migrations/sql/00032_agent_instances.sql @@ -0,0 +1,24 @@ +-- +goose Up +-- Processes running with an agent token. Several may share a token; check +-- results name the instance that ran them. +CREATE TABLE agent_instances ( + id uuid PRIMARY KEY, + agent_id uuid NOT NULL REFERENCES agents (id) ON DELETE CASCADE, + org_id uuid REFERENCES orgs (id) ON DELETE CASCADE, + release text NOT NULL DEFAULT '', + started_at timestamptz NOT NULL DEFAULT now(), + last_seen_at timestamptz NOT NULL DEFAULT now() +); +CREATE INDEX agent_instances_agent_idx ON agent_instances (agent_id, last_seen_at DESC); + +ALTER TABLE agent_instances ENABLE ROW LEVEL SECURITY; +ALTER TABLE agent_instances FORCE ROW LEVEL SECURITY; +-- Platform instances serve every organization and are visible to all, like +-- platform regions. +CREATE POLICY agent_instances_read ON agent_instances FOR SELECT + USING (app_scope_system() OR org_id IS NULL OR org_id = app_org_id()); +CREATE POLICY agent_instances_write ON agent_instances FOR ALL + USING (app_scope_system()) WITH CHECK (app_scope_system()); + +-- +goose Down +DROP TABLE agent_instances; diff --git a/internal/store/agent_instances.sql.go b/internal/store/agent_instances.sql.go new file mode 100644 index 0000000..ddcda64 --- /dev/null +++ b/internal/store/agent_instances.sql.go @@ -0,0 +1,130 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.31.1 +// source: agent_instances.sql + +package store + +import ( + "context" + "time" + + "github.com/google/uuid" +) + +const agentInstancesByID = `-- name: AgentInstancesByID :many +SELECT i.id, i.agent_id, i.release, i.started_at, i.last_seen_at, i.org_id, + a.name AS agent_name, a.kind, r.id AS region_id, coalesce(r.name, '')::text AS region_name +FROM agent_instances i +JOIN agents a ON a.id = i.agent_id +LEFT JOIN regions r ON r.id = a.region_id +WHERE i.id = ANY ($1::uuid[]) +` + +type AgentInstancesByIDRow struct { + ID uuid.UUID + AgentID uuid.UUID + Release string + StartedAt time.Time + LastSeenAt time.Time + OrgID *uuid.UUID + AgentName string + Kind string + RegionID *uuid.UUID + RegionName string +} + +func (q *Queries) AgentInstancesByID(ctx context.Context, ids []uuid.UUID) ([]AgentInstancesByIDRow, error) { + rows, err := q.db.Query(ctx, agentInstancesByID, ids) + if err != nil { + return nil, err + } + defer rows.Close() + items := []AgentInstancesByIDRow{} + for rows.Next() { + var i AgentInstancesByIDRow + if err := rows.Scan( + &i.ID, + &i.AgentID, + &i.Release, + &i.StartedAt, + &i.LastSeenAt, + &i.OrgID, + &i.AgentName, + &i.Kind, + &i.RegionID, + &i.RegionName, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const siblingInstances = `-- name: SiblingInstances :many +SELECT id, release, started_at, last_seen_at FROM agent_instances +WHERE agent_id = $1 AND last_seen_at > now() - interval '1 day' +ORDER BY last_seen_at DESC +` + +type SiblingInstancesRow struct { + ID uuid.UUID + Release string + StartedAt time.Time + LastSeenAt time.Time +} + +// Other instances of the same agent seen in the last day. +func (q *Queries) SiblingInstances(ctx context.Context, agentID uuid.UUID) ([]SiblingInstancesRow, error) { + rows, err := q.db.Query(ctx, siblingInstances, agentID) + if err != nil { + return nil, err + } + defer rows.Close() + items := []SiblingInstancesRow{} + for rows.Next() { + var i SiblingInstancesRow + if err := rows.Scan( + &i.ID, + &i.Release, + &i.StartedAt, + &i.LastSeenAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const touchAgentInstance = `-- name: TouchAgentInstance :exec +INSERT INTO agent_instances (id, agent_id, org_id, release) +VALUES ($1, $2, $3, $4) +ON CONFLICT (id) DO UPDATE SET release = EXCLUDED.release, last_seen_at = now() +WHERE agent_instances.last_seen_at < now() - interval '1 minute' OR agent_instances.release <> EXCLUDED.release +` + +type TouchAgentInstanceParams struct { + ID uuid.UUID + AgentID uuid.UUID + OrgID *uuid.UUID + Release string +} + +// Writes at most once a minute per instance; agents poll far more often. +func (q *Queries) TouchAgentInstance(ctx context.Context, arg TouchAgentInstanceParams) error { + _, err := q.db.Exec(ctx, touchAgentInstance, + arg.ID, + arg.AgentID, + arg.OrgID, + arg.Release, + ) + return err +} diff --git a/internal/store/check_results.sql.go b/internal/store/check_results.sql.go index 3ddd50e..64b726e 100644 --- a/internal/store/check_results.sql.go +++ b/internal/store/check_results.sql.go @@ -12,6 +12,32 @@ import ( "github.com/google/uuid" ) +const checkerStats = `-- name: CheckerStats :one +SELECT count(*)::bigint AS total, count(*) FILTER (WHERE NOT ok)::bigint AS failed, + coalesce(avg(latency_ms), 0)::real AS avg_latency_ms +FROM check_results +WHERE org_id = $1 AND checker_id = $2 AND time > now() - interval '1 hour' +` + +type CheckerStatsParams struct { + OrgID uuid.UUID + CheckerID uuid.UUID +} + +type CheckerStatsRow struct { + Total int64 + Failed int64 + AvgLatencyMs float32 +} + +// How much one instance checked for the organization in the last hour. +func (q *Queries) CheckerStats(ctx context.Context, arg CheckerStatsParams) (CheckerStatsRow, error) { + row := q.db.QueryRow(ctx, checkerStats, arg.OrgID, arg.CheckerID) + var i CheckerStatsRow + err := row.Scan(&i.Total, &i.Failed, &i.AvgLatencyMs) + return i, err +} + const dailyBuckets = `-- name: DailyBuckets :many SELECT bucket::timestamptz AS bucket, sum(total)::bigint AS total, sum(ok_count)::bigint AS ok_count FROM check_results_1d @@ -492,7 +518,7 @@ func (q *Queries) RangeBucketsHourly(ctx context.Context, arg RangeBucketsHourly } const recentResults = `-- name: RecentResults :many -SELECT time, region, ok, latency_ms, status_code, error +SELECT time, region, ok, latency_ms, status_code, error, checker_id FROM check_results WHERE org_id = $1 AND monitor_id = $2 AND time > $3 ORDER BY time DESC @@ -512,6 +538,7 @@ type RecentResultsRow struct { LatencyMs *int32 StatusCode *int32 Error *string + CheckerID uuid.UUID } func (q *Queries) RecentResults(ctx context.Context, arg RecentResultsParams) ([]RecentResultsRow, error) { @@ -530,6 +557,7 @@ func (q *Queries) RecentResults(ctx context.Context, arg RecentResultsParams) ([ &i.LatencyMs, &i.StatusCode, &i.Error, + &i.CheckerID, ); err != nil { return nil, err } @@ -701,6 +729,58 @@ func (q *Queries) RegionBucketsHourly(ctx context.Context, arg RegionBucketsHour return items, nil } +const resultsByChecker = `-- name: ResultsByChecker :many +SELECT r.time, r.monitor_id, r.region, r.ok, r.latency_ms, r.status_code, r.error +FROM check_results r +WHERE r.org_id = $1 AND r.checker_id = $2 AND r.time > now() - interval '1 day' +ORDER BY r.time DESC +LIMIT 50 +` + +type ResultsByCheckerParams struct { + OrgID uuid.UUID + CheckerID uuid.UUID +} + +type ResultsByCheckerRow struct { + Time time.Time + MonitorID uuid.UUID + Region string + Ok bool + LatencyMs *int32 + StatusCode *int32 + Error *string +} + +// The organization's latest results run by one checker instance. +func (q *Queries) ResultsByChecker(ctx context.Context, arg ResultsByCheckerParams) ([]ResultsByCheckerRow, error) { + rows, err := q.db.Query(ctx, resultsByChecker, arg.OrgID, arg.CheckerID) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ResultsByCheckerRow{} + for rows.Next() { + var i ResultsByCheckerRow + if err := rows.Scan( + &i.Time, + &i.MonitorID, + &i.Region, + &i.Ok, + &i.LatencyMs, + &i.StatusCode, + &i.Error, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + const uptimeSince = `-- name: UptimeSince :many SELECT monitor_id, sum(total)::bigint AS total, sum(ok_count)::bigint AS ok_count FROM check_results_1h diff --git a/internal/store/models.go b/internal/store/models.go index 6e27c11..b027dbb 100644 --- a/internal/store/models.go +++ b/internal/store/models.go @@ -24,6 +24,15 @@ type Agent struct { RegionID *uuid.UUID } +type AgentInstance struct { + ID uuid.UUID + AgentID uuid.UUID + OrgID *uuid.UUID + Release string + StartedAt time.Time + LastSeenAt time.Time +} + type AgentStorage struct { Owner string Key string diff --git a/internal/store/querier.go b/internal/store/querier.go index 68f1a5e..655fdeb 100644 --- a/internal/store/querier.go +++ b/internal/store/querier.go @@ -17,8 +17,11 @@ type Querier interface { AddMembership(ctx context.Context, arg AddMembershipParams) error AddMonitorRegion(ctx context.Context, arg AddMonitorRegionParams) error AddStatusPageMonitor(ctx context.Context, arg AddStatusPageMonitorParams) error + AgentInstancesByID(ctx context.Context, ids []uuid.UUID) ([]AgentInstancesByIDRow, 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. + CheckerStats(ctx context.Context, arg CheckerStatsParams) (CheckerStatsRow, error) // System scope. Leases due rows for five minutes so a crashed sender's rows // come back; SKIP LOCKED lets every API replica work the outbox. ClaimNotifications(ctx context.Context, max int32) ([]uuid.UUID, error) @@ -219,12 +222,16 @@ type Querier interface { // Moves the subgroups of a group that is about to be deleted. ReparentGroups(ctx context.Context, arg ReparentGroupsParams) error ResolveIncident(ctx context.Context, arg ResolveIncidentParams) (Incident, error) + // The organization's latest results run by one checker instance. + ResultsByChecker(ctx context.Context, arg ResultsByCheckerParams) ([]ResultsByCheckerRow, error) ScrubAuditEmail(ctx context.Context, email string) error SetPasswordHash(ctx context.Context, arg SetPasswordHashParams) error // Changing the domain drops a previous verification. SetStatusPageDomain(ctx context.Context, arg SetStatusPageDomainParams) (StatusPage, error) SetUserAdmin(ctx context.Context, arg SetUserAdminParams) (int64, error) SetUserLocale(ctx context.Context, arg SetUserLocaleParams) error + // Other instances of the same agent seen in the last day. + SiblingInstances(ctx context.Context, agentID uuid.UUID) ([]SiblingInstancesRow, error) StatusPageMonitors(ctx context.Context, pageID uuid.UUID) ([]StatusPageMonitorsRow, error) // Deletes key and, as certmagic expects, everything below it. StorageDelete(ctx context.Context, arg StorageDeleteParams) (int64, error) @@ -233,6 +240,8 @@ type Querier interface { StoragePut(ctx context.Context, arg StoragePutParams) error TouchAPIToken(ctx context.Context, id uuid.UUID) error TouchAgent(ctx context.Context, arg TouchAgentParams) error + // 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 UpdateChannel(ctx context.Context, arg UpdateChannelParams) (NotificationChannel, error) UpdateGroup(ctx context.Context, arg UpdateGroupParams) (MonitorGroup, error) diff --git a/internal/store/queries/agent_instances.sql b/internal/store/queries/agent_instances.sql new file mode 100644 index 0000000..63e3f76 --- /dev/null +++ b/internal/store/queries/agent_instances.sql @@ -0,0 +1,20 @@ +-- name: TouchAgentInstance :exec +-- Writes at most once a minute per instance; agents poll far more often. +INSERT INTO agent_instances (id, agent_id, org_id, release) +VALUES ($1, $2, $3, $4) +ON CONFLICT (id) DO UPDATE SET release = EXCLUDED.release, last_seen_at = now() +WHERE agent_instances.last_seen_at < now() - interval '1 minute' OR agent_instances.release <> EXCLUDED.release; + +-- name: AgentInstancesByID :many +SELECT i.id, i.agent_id, i.release, i.started_at, i.last_seen_at, i.org_id, + a.name AS agent_name, a.kind, r.id AS region_id, coalesce(r.name, '')::text AS region_name +FROM agent_instances i +JOIN agents a ON a.id = i.agent_id +LEFT JOIN regions r ON r.id = a.region_id +WHERE i.id = ANY (sqlc.arg(ids)::uuid[]); + +-- name: SiblingInstances :many +-- Other instances of the same agent seen in the last day. +SELECT id, release, started_at, last_seen_at FROM agent_instances +WHERE agent_id = $1 AND last_seen_at > now() - interval '1 day' +ORDER BY last_seen_at DESC; diff --git a/internal/store/queries/check_results.sql b/internal/store/queries/check_results.sql index e4b49e5..14c6a1b 100644 --- a/internal/store/queries/check_results.sql +++ b/internal/store/queries/check_results.sql @@ -13,7 +13,7 @@ WHERE org_id = $1 AND time > now() - interval '1 day' ORDER BY monitor_id, region, time DESC; -- name: RecentResults :many -SELECT time, region, ok, latency_ms, status_code, error +SELECT time, region, ok, latency_ms, status_code, error, checker_id FROM check_results WHERE org_id = $1 AND monitor_id = $2 AND time > $3 ORDER BY time DESC @@ -128,3 +128,18 @@ SELECT monitor_id, region, min(time)::timestamptz AS first FROM check_results WHERE org_id = $1 AND time >= $2 GROUP BY 1, 2; + +-- name: ResultsByChecker :many +-- The organization's latest results run by one checker instance. +SELECT r.time, r.monitor_id, r.region, r.ok, r.latency_ms, r.status_code, r.error +FROM check_results r +WHERE r.org_id = $1 AND r.checker_id = sqlc.arg(checker_id) AND r.time > now() - interval '1 day' +ORDER BY r.time DESC +LIMIT 50; + +-- name: CheckerStats :one +-- How much one instance checked for the organization in the last hour. +SELECT count(*)::bigint AS total, count(*) FILTER (WHERE NOT ok)::bigint AS failed, + coalesce(avg(latency_ms), 0)::real AS avg_latency_ms +FROM check_results +WHERE org_id = $1 AND checker_id = sqlc.arg(checker_id) AND time > now() - interval '1 hour'; -- 2.54.1 From 0c2155fdc2db8c005b72273dd38736e1ca2f416b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?= Date: Sun, 22 Nov 2026 12:54:57 +0100 Subject: [PATCH 2/2] feat: show which checker ran a check and what it is doing Every recent check on a monitor page names and links the checker instance that ran it. The checker page shows whether it is active, its version, the checks it runs right now and has queued, and the viewer's latest results on it, refreshing every five seconds. Platform checkers serve all organizations, so other organizations' work appears only as a count. Checks in progress are tracked in Redis between handing out a job and receiving its result. Closes #82 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3 --- internal/api/agent.go | 20 +- internal/api/checkers.go | 315 +++++++++++++ internal/api/checkers_test.go | 99 ++++ internal/api/console.go | 20 +- internal/api/server.go | 1 + internal/i18n/i18n_test.go | 1 + internal/i18n/locales/de.json | 22 + internal/i18n/locales/en.json | 22 + internal/schedule/schedule.go | 15 + internal/web/checkers.templ | 160 +++++++ internal/web/checkers_templ.go | 676 ++++++++++++++++++++++++++++ internal/web/layout.templ | 11 +- internal/web/layout_templ.go | 267 ++++++----- internal/web/monitors.templ | 5 + internal/web/monitors_templ.go | 798 +++++++++++++++++---------------- 15 files changed, 1909 insertions(+), 523 deletions(-) create mode 100644 internal/api/checkers.go create mode 100644 internal/api/checkers_test.go create mode 100644 internal/web/checkers.templ create mode 100644 internal/web/checkers_templ.go diff --git a/internal/api/agent.go b/internal/api/agent.go index 3eff643..88c13dc 100644 --- a/internal/api/agent.go +++ b/internal/api/agent.go @@ -75,7 +75,10 @@ func (s *Server) agentAuth() gin.HandlerFunc { if a, err = q.GetAgentByHash(ctx, HashToken(tok)); err != nil { return err } - return q.TouchAgent(ctx, store.TouchAgentParams{ID: a.ID, Release: &release}) + if err := q.TouchAgent(ctx, store.TouchAgentParams{ID: a.ID, Release: &release}); err != nil { + return err + } + return q.TouchAgentInstance(ctx, store.TouchAgentInstanceParams{ID: instance, AgentID: a.ID, OrgID: a.OrgID, Release: release}) }) if errors.Is(err, pgx.ErrNoRows) { fail(c, http.StatusUnauthorized, "unauthenticated") @@ -147,20 +150,23 @@ func (s *Server) agentJobs(c *gin.Context) { internalError(c, err) return } - jobs, err := s.resolveJobs(ctx, agentOf(c), entries) + jobs, orgs, err := s.resolveJobs(ctx, agentOf(c), entries) if err != nil { internalError(c, err) return } + s.trackRunning(ctx, instance, jobs, orgs) c.JSON(http.StatusOK, agentapi.JobsResponse{Jobs: jobs}) } // resolveJobs attaches the current monitor settings to dispatched runs. // Checking is cross-tenant work, hence the system scope. -func (s *Server) resolveJobs(ctx context.Context, a store.GetAgentByHashRow, entries []schedule.Entry) ([]agentapi.Job, error) { +// It also returns each monitor's organization. +func (s *Server) resolveJobs(ctx context.Context, a store.GetAgentByHashRow, entries []schedule.Entry) ([]agentapi.Job, map[uuid.UUID]uuid.UUID, error) { jobs := []agentapi.Job{} + orgs := map[uuid.UUID]uuid.UUID{} if len(entries) == 0 { - return jobs, nil + return jobs, orgs, nil } ids := make([]uuid.UUID, len(entries)) for i, e := range entries { @@ -173,7 +179,7 @@ func (s *Server) resolveJobs(ctx context.Context, a store.GetAgentByHashRow, ent return err }) if err != nil { - return nil, err + return nil, nil, err } byID := make(map[uuid.UUID]store.Monitor, len(rows)) for _, m := range rows { @@ -188,8 +194,9 @@ func (s *Server) resolveJobs(ctx context.Context, a store.GetAgentByHashRow, ent MonitorID: m.ID, ScheduledAt: e.ScheduledAt, Type: m.Type, Target: m.Target, TimeoutMS: int(m.TimeoutMs), Config: m.Config, AllowPrivate: s.allowPrivate(a), }) + orgs[m.ID] = m.OrgID } - return jobs, nil + return jobs, orgs, nil } func (s *Server) agentResults(c *gin.Context) { @@ -262,6 +269,7 @@ func (s *Server) agentResults(c *gin.Context) { } s.evaluateResults(ctx, region, accepted, monitors) s.storeEvidence(ctx, region, instance, accepted, monitors) + s.finishRunning(ctx, instance, accepted) c.Status(http.StatusNoContent) } diff --git a/internal/api/checkers.go b/internal/api/checkers.go new file mode 100644 index 0000000..f147ba4 --- /dev/null +++ b/internal/api/checkers.go @@ -0,0 +1,315 @@ +package api + +import ( + "context" + "errors" + "fmt" + "net/http" + "slices" + "strconv" + "strings" + "time" + + "github.com/a-h/templ" + "github.com/gin-gonic/gin" + "github.com/google/uuid" + "github.com/redis/go-redis/v9" + + "git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi" + "git.zb-server.de/ZB-Server/uptimesebi/internal/authz" + "git.zb-server.de/ZB-Server/uptimesebi/internal/schedule" + "git.zb-server.de/ZB-Server/uptimesebi/internal/store" + "git.zb-server.de/ZB-Server/uptimesebi/internal/web" +) + +// running: maps monitor IDs to "||" +// for runs handed out and not yet reported. It shows what a checker is +// doing; entries of crashed instances are ignored once their checks would +// have timed out. +func runningKey(instance uuid.UUID) string { return "running:" + instance.String() } + +// runningGrace is how long past its timeout a run counts as in progress, +// covering the report delay. +const runningGrace = 30 * time.Second + +func (s *Server) trackRunning(ctx context.Context, instance uuid.UUID, jobs []agentapi.Job, orgs map[uuid.UUID]uuid.UUID) { + if len(jobs) == 0 { + return + } + now := time.Now().UnixMilli() + fields := make([]any, 0, 2*len(jobs)) + for _, j := range jobs { + fields = append(fields, j.MonitorID.String(), fmt.Sprintf("%s|%d|%d", orgs[j.MonitorID], now, j.TimeoutMS)) + } + key := runningKey(instance) + _, err := s.rdb.TxPipelined(ctx, func(p redis.Pipeliner) error { + p.HSet(ctx, key, fields...) + p.Expire(ctx, key, 15*time.Minute) + return nil + }) + if err != nil { + s.log.WarnContext(ctx, "tracking running checks failed", "error", err) + } +} + +func (s *Server) finishRunning(ctx context.Context, instance uuid.UUID, results []agentapi.Result) { + if len(results) == 0 { + return + } + ids := make([]string, len(results)) + for i, r := range results { + ids[i] = r.MonitorID.String() + } + if err := s.rdb.HDel(ctx, runningKey(instance), ids...).Err(); err != nil { + s.log.WarnContext(ctx, "clearing running checks failed", "error", err) + } +} + +// runningRun is a check an instance is working on. +type runningRun struct { + MonitorID uuid.UUID + Org uuid.UUID + Since time.Time +} + +func (s *Server) runningOn(ctx context.Context, instance uuid.UUID, now time.Time) ([]runningRun, error) { + all, err := s.rdb.HGetAll(ctx, runningKey(instance)).Result() + if err != nil { + return nil, err + } + var out []runningRun + for id, v := range all { + parts := strings.Split(v, "|") + if len(parts) != 3 { + continue + } + m, err1 := uuid.Parse(id) + org, err2 := uuid.Parse(parts[0]) + at, err3 := strconv.ParseInt(parts[1], 10, 64) + timeout, err4 := strconv.ParseInt(parts[2], 10, 64) + if err1 != nil || err2 != nil || err3 != nil || err4 != nil { + continue + } + since := time.UnixMilli(at) + if now.Sub(since) > time.Duration(timeout)*time.Millisecond+runningGrace { + continue + } + out = append(out, runningRun{MonitorID: m, Org: org, Since: since}) + } + slices.SortFunc(out, func(a, b runningRun) int { return a.Since.Compare(b.Since) }) + return out, nil +} + +// checkerActivity is what the console and API show of a checker instance. +// Platform checkers work for every organization: only the viewer's own +// monitors are named, the rest is counted. +type checkerActivity struct { + ID uuid.UUID `json:"id"` + Agent string `json:"agent"` + Region string `json:"region"` + Platform bool `json:"platform"` + Release string `json:"release"` + StartedAt time.Time `json:"started_at"` + LastSeenAt time.Time `json:"last_seen_at"` + Live bool `json:"live"` + Queued int64 `json:"queued"` + Running []runningView `json:"running"` + OtherOrgs int `json:"running_for_others"` + LastHour checkerHourStats `json:"last_hour"` + Recent []recentByCheck `json:"recent"` + Siblings []uuid.UUID `json:"other_instances"` + regionID string + monitorName map[uuid.UUID]string +} + +type runningView struct { + MonitorID uuid.UUID `json:"monitor_id"` + Monitor string `json:"monitor"` + Since time.Time `json:"since"` +} + +type checkerHourStats struct { + Checks int64 `json:"checks"` + Failed int64 `json:"failed"` + AvgLatencyMS float32 `json:"avg_latency_ms"` +} + +type recentByCheck struct { + Time time.Time `json:"time"` + MonitorID uuid.UUID `json:"monitor_id"` + Monitor string `json:"monitor"` + OK bool `json:"ok"` + LatencyMS *int32 `json:"latency_ms,omitempty"` + StatusCode *int32 `json:"status_code,omitempty"` + Error *string `json:"error,omitempty"` +} + +var errNoChecker = errors.New("api: checker not found") + +// loadCheckerActivity gathers the activity of a checker instance visible to +// p: platform instances and those of p's organization. +func (s *Server) loadCheckerActivity(ctx context.Context, p *principal, instance uuid.UUID) (checkerActivity, error) { + now := time.Now() + a := checkerActivity{ID: instance, Running: []runningView{}, Recent: []recentByCheck{}, Siblings: []uuid.UUID{}, monitorName: map[uuid.UUID]string{}} + t, err := s.loadGroupTree(ctx, p.scope()) + if err != nil { + return a, err + } + readable := map[uuid.UUID]bool{} + err = s.db.Tx(ctx, p.scope(), func(q *store.Queries) error { + rows, err := q.AgentInstancesByID(ctx, []uuid.UUID{instance}) + if err != nil { + return err + } + if len(rows) == 0 || rows[0].Kind != "checker" { + return errNoChecker + } + r := rows[0] + a.Agent, a.Region, a.Platform, a.Release = r.AgentName, r.RegionName, r.OrgID == nil, r.Release + a.StartedAt, a.LastSeenAt = r.StartedAt, r.LastSeenAt + if r.RegionID != nil { + a.regionID = r.RegionID.String() + } + siblings, err := q.SiblingInstances(ctx, r.AgentID) + if err != nil { + return err + } + for _, sb := range siblings { + if sb.ID != instance { + a.Siblings = append(a.Siblings, sb.ID) + } + } + monitors, err := q.ListMonitors(ctx) + if err != nil { + return err + } + for _, m := range monitors { + if canInGroup(p, authz.MonitorsRead, t, m.GroupID) { + readable[m.ID] = true + a.monitorName[m.ID] = m.Name + } + } + stats, err := q.CheckerStats(ctx, store.CheckerStatsParams{OrgID: p.Org.ID, CheckerID: instance}) + if err != nil { + return err + } + a.LastHour = checkerHourStats{Checks: stats.Total, Failed: stats.Failed, AvgLatencyMS: stats.AvgLatencyMs} + recent, err := q.ResultsByChecker(ctx, store.ResultsByCheckerParams{OrgID: p.Org.ID, CheckerID: instance}) + for _, r := range recent { + if readable[r.MonitorID] { + a.Recent = append(a.Recent, recentByCheck{ + Time: r.Time, MonitorID: r.MonitorID, Monitor: a.monitorName[r.MonitorID], OK: r.Ok, + LatencyMS: r.LatencyMs, StatusCode: r.StatusCode, Error: r.Error, + }) + } + } + return err + }) + if err != nil { + return a, err + } + if a.regionID != "" { + if seen, err := s.sched.LastSeen(ctx, a.regionID, instance); err == nil && !seen.IsZero() { + a.LastSeenAt = seen + a.Live = now.Sub(seen) < schedule.StaleAfter + } + } + if a.Queued, err = s.sched.QueueLen(ctx, instance); err != nil { + return a, err + } + running, err := s.runningOn(ctx, instance, now) + if err != nil { + return a, err + } + for _, r := range running { + if r.Org != p.Org.ID || !readable[r.MonitorID] { + a.OtherOrgs++ + continue + } + a.Running = append(a.Running, runningView{MonitorID: r.MonitorID, Monitor: a.monitorName[r.MonitorID], Since: r.Since}) + } + return a, nil +} + +func (s *Server) getChecker(c *gin.Context) { + id, err := uuid.Parse(c.Param("id")) + if err != nil { + fail(c, http.StatusNotFound, "not_found") + return + } + a, err := s.loadCheckerActivity(c.Request.Context(), current(c), id) + if errors.Is(err, errNoChecker) { + fail(c, http.StatusNotFound, "not_found") + return + } + if err != nil { + internalError(c, err) + return + } + c.JSON(http.StatusOK, a) +} + +func (s *Server) checkerPage(c *gin.Context, p *principal, page web.Page, me web.Me) (templ.Component, error) { + id, err := uuid.Parse(c.Param("id")) + if err != nil { + return notFoundPage(c) + } + a, err := s.loadCheckerActivity(c.Request.Context(), p, id) + if errors.Is(err, errNoChecker) { + return notFoundPage(c) + } + if err != nil { + return nil, err + } + const layout = "2006-01-02 15:04:05" + v := web.CheckerView{ + ID: a.ID.String(), Agent: a.Agent, Region: a.Region, Platform: a.Platform, Release: a.Release, + Started: a.StartedAt.Local().Format(layout), LastSeen: a.LastSeenAt.Local().Format(layout), Live: a.Live, + Queued: int(a.Queued), OtherOrgs: a.OtherOrgs, + Checks: int(a.LastHour.Checks), Failed: int(a.LastHour.Failed), AvgLatency: fmt.Sprintf("%.0f ms", a.LastHour.AvgLatencyMS), + } + now := time.Now() + for _, r := range a.Running { + v.Running = append(v.Running, web.CheckerRun{ + MonitorURL: "/monitors/" + r.MonitorID.String(), Monitor: r.Monitor, For: now.Sub(r.Since).Round(time.Second).String(), + }) + } + for _, r := range a.Recent { + row := web.CheckerResult{ + Time: r.Time.Local().Format("15:04:05"), MonitorURL: "/monitors/" + r.MonitorID.String(), Monitor: r.Monitor, + OK: r.OK, Latency: "–", Detail: deref(r.Error), + } + if r.LatencyMS != nil { + row.Latency = fmt.Sprintf("%d ms", *r.LatencyMS) + } + if row.Detail == "" && r.StatusCode != nil { + row.Detail = strconv.Itoa(int(*r.StatusCode)) + } + v.Recent = append(v.Recent, row) + } + for _, sb := range a.Siblings { + v.Siblings = append(v.Siblings, web.CheckerLink{URL: "/checkers/" + sb.String(), Label: shortID(sb)}) + } + page.RefreshSeconds = 5 + return web.CheckerPage(page, me, v), nil +} + +func shortID(id uuid.UUID) string { return id.String()[:8] } + +// checkerLinks names the checker instances in ids for result lists. +func (s *Server) checkerLinks(ctx context.Context, p *principal, ids []uuid.UUID) (map[uuid.UUID]web.CheckerLink, error) { + out := map[uuid.UUID]web.CheckerLink{} + if len(ids) == 0 { + return out, nil + } + var rows []store.AgentInstancesByIDRow + err := s.db.Tx(ctx, p.scope(), func(q *store.Queries) error { + var err error + rows, err = q.AgentInstancesByID(ctx, ids) + return err + }) + for _, r := range rows { + out[r.ID] = web.CheckerLink{URL: "/checkers/" + r.ID.String(), Label: r.AgentName + " · " + shortID(r.ID)} + } + return out, err +} diff --git a/internal/api/checkers_test.go b/internal/api/checkers_test.go new file mode 100644 index 0000000..00f4e51 --- /dev/null +++ b/internal/api/checkers_test.go @@ -0,0 +1,99 @@ +package api_test + +import ( + "context" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/google/uuid" + + "git.zb-server.de/ZB-Server/uptimesebi/internal/api" + "git.zb-server.de/ZB-Server/uptimesebi/internal/store" + "git.zb-server.de/ZB-Server/uptimesebi/internal/tenant" +) + +func TestCheckerActivity(t *testing.T) { + e := newEnv(t) + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + go e.api.RunScheduler(ctx) + + slow := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + time.Sleep(3 * time.Second) + })) + defer slow.Close() + tok, region := e.platformChecker(t, uniq("eu-")) + instance, _ := e.startChecker(t, tok) + + alice, bob := e.browser(t), e.browser(t) + alice.signup("a@"+uniq("ca")+".test", uniq("ca-")) + bob.signup("b@"+uniq("cb")+".test", uniq("cb-")) + create := func(b *browser, name string) string { + t.Helper() + st, body := b.do("POST", "/api/v1/org/monitors", map[string]any{ + "name": name, "type": "http", "target": slow.URL, "interval_seconds": 3600, "timeout_ms": 5000, "regions": []string{region}, + }) + if st != http.StatusCreated { + t.Fatalf("create monitor = %d %v", st, body) + } + return body["id"].(string) + } + aliceMonitor := create(alice, "Alice shop") + create(bob, "Bob secret service") + + path := "/api/v1/org/checkers/" + instance.String() + var view map[string]any + waitFor(t, 10*time.Second, "both checks in progress", func() bool { + _, view = alice.do("GET", path, nil) + running, _ := view["running"].([]any) + return len(running) == 1 && view["running_for_others"] == float64(1) + }) + if raw := mustJSON(view); strings.Contains(raw, "Bob secret service") || view["live"] != true || view["platform"] != true { + t.Errorf("alice's view = %s", raw) + } + if _, bv := bob.do("GET", path, nil); strings.Contains(mustJSON(bv), "Alice shop") { + t.Error("bob sees alice's monitor") + } + + waitFor(t, 10*time.Second, "the finished check listed", func() bool { + _, view = alice.do("GET", path, nil) + recent, _ := view["recent"].([]any) + running, _ := view["running"].([]any) + return len(recent) == 1 && len(running) == 0 + }) + if _, _, page := alice.page("/monitors/" + aliceMonitor); !strings.Contains(page, `href="/checkers/`+instance.String()+`"`) { + t.Error("the monitor page does not link the checker that ran the check") + } + st, _, page := alice.page("/checkers/" + instance.String()) + if st != http.StatusOK || !strings.Contains(page, "Alice shop") || strings.Contains(page, "Bob secret service") || !strings.Contains(page, `http-equiv="refresh"`) { + t.Errorf("checker page = %d, lacks own monitor, shows others or does not refresh", st) + } + + // Checkers of another organization stay invisible. + bobOrg := uuid.MustParse(bob.orgID()) + var bobTok string + err := tenant.New(e.dbPool).Tx(context.Background(), tenant.System(), func(q *store.Queries) error { + r, err := q.CreateRegion(context.Background(), store.CreateRegionParams{OrgID: &bobOrg, Key: uniq("own-"), Name: "Bob DC"}) + if err != nil { + return err + } + var params store.CreateAgentParams + bobTok, params = api.NewAgentToken(&bobOrg, "checker", "bob-dc", &r.ID) + _, err = q.CreateAgent(context.Background(), params) + return err + }) + if err != nil { + t.Fatal(err) + } + bobInstance, _ := e.startChecker(t, bobTok) + waitFor(t, 5*time.Second, "bob's checker registered", func() bool { + st, _ := bob.do("GET", "/api/v1/org/checkers/"+bobInstance.String(), nil) + return st == http.StatusOK + }) + if st, _ := alice.do("GET", "/api/v1/org/checkers/"+bobInstance.String(), nil); st != http.StatusNotFound { + t.Errorf("alice sees bob's own checker: %d", st) + } +} diff --git a/internal/api/console.go b/internal/api/console.go index bb13445..79fc491 100644 --- a/internal/api/console.go +++ b/internal/api/console.go @@ -34,6 +34,7 @@ func (s *Server) registerConsole(r gin.IRouter) { r.GET("/monitors/:id", s.orgPage("console.monitors.title", "", s.monitorDetail)) r.GET("/monitors/:id/edit", s.orgPage("monitors.edit", "", s.monitorEditor)) r.GET("/monitors/:id/evidence/:evidence", s.orgPage("evidence.heading", "", s.evidencePage)) + r.GET("/checkers/:id", s.orgPage("checkers.title", "", s.checkerPage)) r.GET("/groups", s.orgPage("groups.title", "", s.groupsView)) r.GET("/settings", s.settingsIndex) r.GET("/incidents", s.orgPage("incidents.title", authz.IncidentsRead, s.incidentsView)) @@ -406,8 +407,25 @@ func (s *Server) monitorDetail(c *gin.Context, p *principal, page web.Page, me w return nil, err } } - for _, r := range recent[:min(len(recent), 50)] { + shown := recent[:min(len(recent), 50)] + var checkerIDs []uuid.UUID + for _, r := range shown { + if r.CheckerID != uuid.Nil && !slices.Contains(checkerIDs, r.CheckerID) { + checkerIDs = append(checkerIDs, r.CheckerID) + } + } + checkers, err := s.checkerLinks(ctx, p, checkerIDs) + if err != nil { + return nil, err + } + for _, r := range shown { row := web.ResultRow{Time: r.Time.Format("01-02 15:04:05"), Region: d.regionNameString(r.Region), OK: r.Ok, Latency: "–", Detail: deref(r.Error)} + row.Checker = checkers[r.CheckerID] + if row.Checker.Label == "" && r.CheckerID != uuid.Nil { + // Instances seen before names were recorded, or of a deleted + // agent. + row.Checker.Label = shortID(r.CheckerID) + } row.EvidenceURL = evidenceOf[evidenceKey(r.Region, r.Time)] if r.LatencyMs != nil { row.Latency = fmt.Sprintf("%d ms", *r.LatencyMs) diff --git a/internal/api/server.go b/internal/api/server.go index e666f49..5074f3b 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -126,6 +126,7 @@ func (s *Server) Mount(r gin.IRouter) { org.PUT("/monitors/:id", s.updateMonitor) org.DELETE("/monitors/:id", s.deleteMonitor) org.GET("/monitors/:id/evidence", s.listEvidence) + org.GET("/checkers/:id", s.getChecker) org.GET("/monitors/:id/evidence/:evidence", s.getEvidence) org.GET("/maintenance", s.listMaintenance) org.POST("/maintenance", s.createMaintenance) diff --git a/internal/i18n/i18n_test.go b/internal/i18n/i18n_test.go index c43aeec..a1fcf70 100644 --- a/internal/i18n/i18n_test.go +++ b/internal/i18n/i18n_test.go @@ -71,6 +71,7 @@ var usagePatterns = []struct { {re: regexp.MustCompile(`\binvalid\("([a-z_]+)"\)`), prefix: "error."}, {re: regexp.MustCompile(`NoticeID = "([a-z0-9_.]+)"`)}, {re: regexp.MustCompile(`@labeled\("([a-z0-9_.]+)"\)`)}, + {re: regexp.MustCompile(`@checkerFact\("([a-z0-9_.]+)"`)}, {re: regexp.MustCompile(`@(?:settingsHeading|sectionHeading)\("([a-z0-9_.]+)"`)}, {re: regexp.MustCompile(`@settingsHeading\("[a-z0-9_.]+", "([a-z0-9_.]+)"`)}, {re: regexp.MustCompile(`@policyBanner\("([a-z0-9_.]+)", "([a-z0-9_.]+)"`)}, diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json index c2c3dc0..898e340 100644 --- a/internal/i18n/locales/de.json +++ b/internal/i18n/locales/de.json @@ -107,6 +107,28 @@ "channels.type_email": "E-Mail", "channels.type_webhook": "Webhook", "channels.url": "Webhook-URL", + "checkers.avg_latency": "Mittlere Latenz", + "checkers.for": "seit {{.Duration}}", + "checkers.gone": "länger nicht gesehen", + "checkers.idle": "Gerade nichts.", + "checkers.instance": "Instanz", + "checkers.last_hour": "Deine Checks, letzte Stunde", + "checkers.last_seen": "Letzter Kontakt", + "checkers.live": "aktiv", + "checkers.no_recent": "Keine Checks deiner Organisation am letzten Tag.", + "checkers.now": "Läuft gerade", + "checkers.others": { + "one": "und {{.Count}} Check anderer Organisationen", + "other": "und {{.Count}} Checks anderer Organisationen" + }, + "checkers.queued": "Wartend", + "checkers.recent": "Deine letzten Checks auf dieser Instanz", + "checkers.refresh_hint": "Diese Seite aktualisiert sich alle 5 Sekunden.", + "checkers.release": "Version", + "checkers.running": "Läuft", + "checkers.siblings": "Weitere Instanzen dieses Checkers", + "checkers.started": "Gestartet", + "checkers.title": "Checker", "common.delete": "Löschen", "common.edit": "Bearbeiten", "common.no": "nein", diff --git a/internal/i18n/locales/en.json b/internal/i18n/locales/en.json index 689eec8..33d61bd 100644 --- a/internal/i18n/locales/en.json +++ b/internal/i18n/locales/en.json @@ -107,6 +107,28 @@ "channels.type_email": "Email", "channels.type_webhook": "Webhook", "channels.url": "Webhook URL", + "checkers.avg_latency": "Average latency", + "checkers.for": "for {{.Duration}}", + "checkers.gone": "not seen for a while", + "checkers.idle": "Nothing right now.", + "checkers.instance": "Instance", + "checkers.last_hour": "Your checks, last hour", + "checkers.last_seen": "Last contact", + "checkers.live": "active", + "checkers.no_recent": "No checks of your organization in the last day.", + "checkers.now": "Running now", + "checkers.others": { + "one": "and {{.Count}} check of other organizations", + "other": "and {{.Count}} checks of other organizations" + }, + "checkers.queued": "Queued", + "checkers.recent": "Your latest checks on this instance", + "checkers.refresh_hint": "This page refreshes every 5 seconds.", + "checkers.release": "Version", + "checkers.running": "Running", + "checkers.siblings": "Other instances of this checker", + "checkers.started": "Started", + "checkers.title": "Checker", "common.delete": "Delete", "common.edit": "Edit", "common.no": "no", diff --git a/internal/schedule/schedule.go b/internal/schedule/schedule.go index 8e87c46..be11e75 100644 --- a/internal/schedule/schedule.go +++ b/internal/schedule/schedule.go @@ -247,6 +247,21 @@ func (s *Scheduler) Dispatch(ctx context.Context) (int, error) { return total, nil } +// QueueLen returns how many runs wait for instance. +func (s *Scheduler) QueueLen(ctx context.Context, instance uuid.UUID) (int64, error) { + return s.rdb.LLen(ctx, jobsPrefix+instance.String()).Result() +} + +// LastSeen returns when instance last polled in region, or zero if it is +// not registered. +func (s *Scheduler) LastSeen(ctx context.Context, region string, instance uuid.UUID) (time.Time, error) { + score, err := s.rdb.ZScore(ctx, keyInstances(region), instance.String()).Result() + if errors.Is(err, redis.Nil) || score == 0 { + return time.Time{}, nil + } + return time.UnixMilli(int64(score)), err +} + // Take pops up to max queued runs for instance, waiting up to wait for the // first one. It returns within about a second once ctx is done, so long polls // do not hold up shutdown or cancelled requests. diff --git a/internal/web/checkers.templ b/internal/web/checkers.templ new file mode 100644 index 0000000..6d2c524 --- /dev/null +++ b/internal/web/checkers.templ @@ -0,0 +1,160 @@ +package web + +import ( + "strconv" + + "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" +) + +// CheckerView shows what a checker instance is doing. +type CheckerView struct { + ID string + Agent string + Region string + Platform bool + Release string + Started string + LastSeen string + Live bool + Queued int + Running []CheckerRun + OtherOrgs int + Checks int + Failed int + AvgLatency string + Recent []CheckerResult + Siblings []CheckerLink +} + +// CheckerRun is a check in progress. +type CheckerRun struct { + MonitorURL string + Monitor string + For string +} + +// CheckerResult is a finished check of the instance. +type CheckerResult struct { + Time string + MonitorURL string + Monitor string + OK bool + Latency string + Detail string +} + +// CheckerLink points to a checker instance. +type CheckerLink struct { + URL string + Label string +} + +templ CheckerPage(p Page, me Me, v CheckerView) { + @consoleShell(p, me) { +
+

+ if v.Live { + @statusDot(StatusUp) + } else { + @statusDot(StatusUnknown) + } + { v.Agent } + { v.ID[:8] } +

+

+ { v.Region } · + if v.Platform { + { i18n.T(ctx, "regions.platform") } + } else { + { i18n.T(ctx, "regions.own") } + } + · + if v.Live { + { i18n.T(ctx, "checkers.live") } + } else { + { i18n.T(ctx, "checkers.gone") } + } +

+
+
+ @checkerFact("checkers.running", strconv.Itoa(len(v.Running)+v.OtherOrgs)) + @checkerFact("checkers.queued", strconv.Itoa(v.Queued)) + @checkerFact("checkers.last_hour", strconv.Itoa(v.Checks)+" / "+strconv.Itoa(v.Failed)+" ✕") + @checkerFact("checkers.avg_latency", v.AvgLatency) + @checkerFact("checkers.release", v.Release) + @checkerFact("checkers.started", v.Started) + @checkerFact("checkers.last_seen", v.LastSeen) + @checkerFact("checkers.instance", v.ID) +
+
+ @sectionHeading("checkers.now") + if len(v.Running) == 0 && v.OtherOrgs == 0 { +

{ i18n.T(ctx, "checkers.idle") }

+ } else { +
    + for _, r := range v.Running { +
  • + { r.Monitor } + { i18n.T(ctx, "checkers.for", "Duration", r.For) } +
  • + } + if v.OtherOrgs > 0 { +
  • { i18n.T(ctx, "checkers.others", "Count", v.OtherOrgs) }
  • + } +
+ } +

{ i18n.T(ctx, "checkers.refresh_hint") }

+
+
+ @sectionHeading("checkers.recent") + if len(v.Recent) == 0 { +

{ i18n.T(ctx, "checkers.no_recent") }

+ } else { + + + for _, r := range v.Recent { + + + + + + + + } + +
{ r.Time }{ r.Monitor } + if r.OK { + ● + } else { + ● + } + { r.Latency }{ r.Detail }
+ } +
+ if len(v.Siblings) > 0 { +
+ @sectionHeading("checkers.siblings") +

+ for _, sb := range v.Siblings { + { sb.Label } + } +

+
+ } + } +} + +templ checkerFact(labelID, value string) { +
+
{ i18n.T(ctx, labelID) }
+
{ value }
+
+} + +templ checkerCell(l CheckerLink) { + if l.URL != "" { + { l.Label } + } else { + { l.Label } + } +} diff --git a/internal/web/checkers_templ.go b/internal/web/checkers_templ.go new file mode 100644 index 0000000..9854498 --- /dev/null +++ b/internal/web/checkers_templ.go @@ -0,0 +1,676 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.1118 + +package web + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "strconv" + + "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" +) + +// CheckerView shows what a checker instance is doing. +type CheckerView struct { + ID string + Agent string + Region string + Platform bool + Release string + Started string + LastSeen string + Live bool + Queued int + Running []CheckerRun + OtherOrgs int + Checks int + Failed int + AvgLatency string + Recent []CheckerResult + Siblings []CheckerLink +} + +// CheckerRun is a check in progress. +type CheckerRun struct { + MonitorURL string + Monitor string + For string +} + +// CheckerResult is a finished check of the instance. +type CheckerResult struct { + Time string + MonitorURL string + Monitor string + OK bool + Latency string + Detail string +} + +// CheckerLink points to a checker instance. +type CheckerLink struct { + URL string + Label string +} + +func CheckerPage(p Page, me Me, v CheckerView) 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_Var2 := 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, 1, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if v.Live { + templ_7745c5c3_Err = statusDot(StatusUp).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = statusDot(StatusUnknown).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(v.Agent) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 61, Col: 13} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.ID[:8]) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 62, Col: 69} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v.Region) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 65, Col: 14} + } + _, 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, 6, " · ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if v.Platform { + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, 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/checkers.templ`, Line: 67, Col: 38} + } + _, 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, 7, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, 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/checkers.templ`, Line: 69, Col: 33} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "· ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if v.Live { + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "checkers.live")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 73, Col: 35} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "checkers.gone")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 75, Col: 35} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkerFact("checkers.running", strconv.Itoa(len(v.Running)+v.OtherOrgs)).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkerFact("checkers.queued", strconv.Itoa(v.Queued)).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkerFact("checkers.last_hour", strconv.Itoa(v.Checks)+" / "+strconv.Itoa(v.Failed)+" ✕").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkerFact("checkers.avg_latency", v.AvgLatency).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkerFact("checkers.release", v.Release).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkerFact("checkers.started", v.Started).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkerFact("checkers.last_seen", v.LastSeen).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkerFact("checkers.instance", v.ID).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sectionHeading("checkers.now").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(v.Running) == 0 && v.OtherOrgs == 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var10 string + templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "checkers.idle")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 92, Col: 64} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "checkers.refresh_hint")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 106, Col: 76} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sectionHeading("checkers.recent").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(v.Recent) == 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var16 string + templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "checkers.no_recent")) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 111, Col: 69} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, r := range v.Recent { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var17 string + templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(r.Time) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 117, Col: 87} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var19 string + templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(r.Monitor) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 118, Col: 107} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if r.OK { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "●") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "●") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var20 string + templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(r.Latency) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 126, Col: 61} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var21 string + templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(r.Detail) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 127, Col: 66} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(v.Siblings) > 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sectionHeading("checkers.siblings").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, sb := range v.Siblings { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var23 string + templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(sb.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 139, Col: 87} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) + templ_7745c5c3_Err = consoleShell(p, me).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func checkerFact(labelID, value string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var25 string + templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, labelID)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 149, Col: 55} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var27 string + templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(value) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 150, Col: 64} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func checkerCell(l CheckerLink) 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) + if l.URL != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var30 string + templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(l.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 156, Col: 68} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var31 string + templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(l.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/checkers.templ`, Line: 158, Col: 36} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/web/layout.templ b/internal/web/layout.templ index cc2a01d..bd0a458 100644 --- a/internal/web/layout.templ +++ b/internal/web/layout.templ @@ -1,6 +1,10 @@ package web -import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" +import ( + "strconv" + + "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" +) // Page carries what every rendered page needs besides its own content. type Page struct { @@ -13,6 +17,8 @@ type Page struct { NoticeID string // Legal links the platform's legal notice and privacy policy. Legal []LegalLink + // RefreshSeconds reloads pages that show live state. + RefreshSeconds int } templ Layout(p Page) { @@ -24,6 +30,9 @@ templ Layout(p Page) { if p.CSRF != "" { } + if p.RefreshSeconds > 0 { + + } { i18n.T(ctx, p.TitleID) } · uptimesebi diff --git a/internal/web/layout_templ.go b/internal/web/layout_templ.go index 59b46b0..8a15b74 100644 --- a/internal/web/layout_templ.go +++ b/internal/web/layout_templ.go @@ -9,7 +9,11 @@ package web import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" +import ( + "strconv" + + "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" +) // Page carries what every rendered page needs besides its own content. type Page struct { @@ -22,6 +26,8 @@ type Page struct { NoticeID string // Legal links the platform's legal notice and privacy policy. Legal []LegalLink + // RefreshSeconds reloads pages that show live state. + RefreshSeconds int } func Layout(p Page) templ.Component { @@ -49,7 +55,7 @@ func Layout(p Page) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.Lang(ctx)).Resolve(ctx) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 20, Col: 28} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 26, Col: 28} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2) if templ_7745c5c3_Err != nil { @@ -67,7 +73,7 @@ func Layout(p Page) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templruntime.NewAttributeExpression(p.CSRF).Resolve(ctx) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 25, Col: 44} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 31, Col: 44} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3) if templ_7745c5c3_Err != nil { @@ -78,33 +84,52 @@ func Layout(p Page) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err + if p.RefreshSeconds > 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<meta http-equiv=\"refresh\" content=\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templruntime.NewAttributeExpression(strconv.Itoa(p.RefreshSeconds)).Resolve(ctx) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 34, Col: 71} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\">") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, 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/layout.templ`, Line: 27, Col: 34} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " · uptimesebi") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "app.network_error")).Resolve(ctx) + templ_7745c5c3_Var5, 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/layout.templ`, Line: 32, Col: 94} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 36, Col: 34} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5) + _, 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, 7, "\">
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, " · uptimesebi
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -112,7 +137,7 @@ func Layout(p Page) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -120,7 +145,7 @@ func Layout(p Page) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -145,76 +170,76 @@ func languageSwitch(langs []string) templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, l := range langs { if l == i18n.Lang(ctx) { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(l) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 45, Col: 50} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\">") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(l) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 56, Col: 114} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -238,9 +263,9 @@ func authShell(p Page) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var11 := templ.GetChildren(ctx) + templ_7745c5c3_Var12 := templ.GetChildren(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var13 := 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 { @@ -252,7 +277,7 @@ func authShell(p Page) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "

uptimesebi

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "

uptimesebi

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -260,20 +285,20 @@ func authShell(p Page) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var13 string - templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, p.TitleID)) + var templ_7745c5c3_Var14 string + templ_7745c5c3_Var14, 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/layout.templ`, Line: 60, Col: 66} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 69, Col: 66} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -281,17 +306,17 @@ func authShell(p Page) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var11.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var12.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = Layout(p).Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Layout(p).Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -316,69 +341,69 @@ func field(label, name, typ, autocomplete string, required bool) templ.Component } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -403,20 +428,20 @@ func submit(label string) templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -442,33 +467,14 @@ func flash(p Page) templ.Component { ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) if p.ErrorID != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var22 string - templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, p.ErrorID)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 88, Col: 88} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.NoticeID != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var23 string - templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, p.NoticeID)) + templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, p.ErrorID)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 91, Col: 77} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 97, Col: 88} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) if templ_7745c5c3_Err != nil { @@ -479,6 +485,25 @@ func flash(p Page) templ.Component { return templ_7745c5c3_Err } } + if p.NoticeID != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var24 string + templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, p.NoticeID)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/layout.templ`, Line: 100, Col: 77} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } return nil }) } @@ -500,7 +525,7 @@ func formError() templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/web/monitors.templ b/internal/web/monitors.templ index 5192087..5b5b330 100644 --- a/internal/web/monitors.templ +++ b/internal/web/monitors.templ @@ -219,6 +219,8 @@ type ResultRow struct { Detail string // EvidenceURL links to what the checker saw, for editors. EvidenceURL string + // Checker names the instance that ran the check. + Checker CheckerLink } // IncidentRow is an incident in a list. @@ -376,6 +378,9 @@ templ MonitorDetail(p Page, me Me, v MonitorDetailView) { { r.Time } { r.Region } + + @checkerCell(r.Checker) + if r.OK { ● diff --git a/internal/web/monitors_templ.go b/internal/web/monitors_templ.go index e5e670d..299306f 100644 --- a/internal/web/monitors_templ.go +++ b/internal/web/monitors_templ.go @@ -843,6 +843,8 @@ type ResultRow struct { Detail string // EvidenceURL links to what the checker saw, for editors. EvidenceURL string + // Checker names the instance that ran the check. + Checker CheckerLink } // IncidentRow is an incident in a list. @@ -922,7 +924,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: 267, Col: 115} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 269, Col: 115} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41)) if templ_7745c5c3_Err != nil { @@ -943,7 +945,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: 272, Col: 23} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 274, Col: 23} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42)) if templ_7745c5c3_Err != nil { @@ -956,7 +958,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: 275, Col: 47} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 277, Col: 47} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43)) if templ_7745c5c3_Err != nil { @@ -970,7 +972,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: 277, Col: 29} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 279, Col: 29} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44)) if templ_7745c5c3_Err != nil { @@ -984,7 +986,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: 279, Col: 26} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 281, Col: 26} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45)) if templ_7745c5c3_Err != nil { @@ -1002,7 +1004,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: 283, Col: 62} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 285, Col: 62} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46) if templ_7745c5c3_Err != nil { @@ -1015,7 +1017,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: 283, Col: 173} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 285, Col: 173} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47)) if templ_7745c5c3_Err != nil { @@ -1033,7 +1035,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: 288, Col: 123} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 290, Col: 123} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48)) if templ_7745c5c3_Err != nil { @@ -1054,7 +1056,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: 292, Col: 39} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 294, Col: 39} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49)) if templ_7745c5c3_Err != nil { @@ -1067,7 +1069,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: 293, Col: 49} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 295, Col: 49} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var50)) if templ_7745c5c3_Err != nil { @@ -1089,7 +1091,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: 298, Col: 44} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 300, Col: 44} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51)) if templ_7745c5c3_Err != nil { @@ -1102,7 +1104,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: 299, Col: 46} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 301, Col: 46} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var52)) if templ_7745c5c3_Err != nil { @@ -1115,7 +1117,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: 301, Col: 96} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 303, Col: 96} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53) if templ_7745c5c3_Err != nil { @@ -1128,7 +1130,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: 302, Col: 40} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 304, Col: 40} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var54) if templ_7745c5c3_Err != nil { @@ -1164,7 +1166,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: 312, Col: 38} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 314, Col: 38} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var55)) if templ_7745c5c3_Err != nil { @@ -1207,7 +1209,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: 314, Col: 127} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 316, Col: 127} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var58) if templ_7745c5c3_Err != nil { @@ -1234,7 +1236,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: 314, Col: 140} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 316, Col: 140} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59)) if templ_7745c5c3_Err != nil { @@ -1252,7 +1254,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: 318, Col: 79} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 320, Col: 79} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var60)) if templ_7745c5c3_Err != nil { @@ -1337,7 +1339,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: 334, Col: 114} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 336, Col: 114} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var63) if templ_7745c5c3_Err != nil { @@ -1364,7 +1366,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: 335, Col: 56} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 337, Col: 56} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64)) if templ_7745c5c3_Err != nil { @@ -1377,7 +1379,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: 336, Col: 45} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 338, Col: 45} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var65)) if templ_7745c5c3_Err != nil { @@ -1403,7 +1405,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: 344, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 346, Col: 48} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66)) if templ_7745c5c3_Err != nil { @@ -1445,7 +1447,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: 355, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 357, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67)) if templ_7745c5c3_Err != nil { @@ -1458,7 +1460,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: 356, Col: 77} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 358, Col: 77} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68)) if templ_7745c5c3_Err != nil { @@ -1521,7 +1523,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: 377, Col: 86} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 379, Col: 86} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69)) if templ_7745c5c3_Err != nil { @@ -1534,95 +1536,103 @@ 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: 378, Col: 41} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 380, Col: 41} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = checkerCell(r.Checker).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if r.OK { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, "●") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "●") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "●") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, "●") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var71 string templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.JoinStringErrs(r.Latency) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 386, Col: 60} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 391, Col: 60} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var71)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var72 string templ_7745c5c3_Var72, templ_7745c5c3_Err = templ.JoinStringErrs(r.Detail) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 388, Col: 18} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 393, Col: 18} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var72)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if r.EvidenceURL != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "\" class=\"ml-2 underline underline-offset-2 hover:text-ink\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var74 string templ_7745c5c3_Var74, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "evidence.show")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 390, Col: 137} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 395, Col: 137} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var74)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1653,139 +1663,139 @@ func incidentList(rows []IncidentRow, showMonitor bool) templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "
    ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "
      ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, r := range rows { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "
    • ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, "
    • ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if r.Open { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } 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: 407, Col: 76} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 412, Col: 76} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var76)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } 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: 409, Col: 63} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 414, Col: 63} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var77)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } if showMonitor { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, "\" class=\"hover:underline\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } 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: 412, Col: 95} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 417, Col: 95} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var79)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } 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: 414, Col: 59} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 419, Col: 59} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var80)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } 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: 415, Col: 57} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 420, Col: 57} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var81)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "
      ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if len(r.Cause) > 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "

      ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 143, "

      ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } 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: 418, Col: 81} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 423, Col: 81} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var82)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 143, "

      ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, "

      ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, "
    • ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 145, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 145, "
    ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 146, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1827,20 +1837,20 @@ func IncidentsPage(p Page, me Me, rows []IncidentRow) templ.Component { return templ_7745c5c3_Err } if len(rows) == 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 146, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 147, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } 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: 429, Col: 103} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 434, Col: 103} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var85)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 147, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1940,46 +1950,46 @@ func headersField(value string) templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2005,36 +2015,36 @@ func typeFields(typ, current string) templ.Component { ctx = templ.InitializeContext(ctx) templ_7745c5c3_Var90 := templ.GetChildren(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 152, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, " class=\"mb-2\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2042,7 +2052,7 @@ func typeFields(typ, current string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2067,95 +2077,95 @@ func numberField(label, name string, value, min, max int, hint string) templ.Com } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2192,115 +2202,115 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if f.ID == "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "← ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "← ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var101 string templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 535, Col: 93} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 540, Col: 93} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "← ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "\" class=\"text-muted hover:text-ink\">← ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } 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: 537, Col: 97} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 542, Col: 97} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var104 string templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, p.TitleID)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 540, Col: 65} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 545, Col: 65} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, " class=\"grid max-w-4xl gap-x-12 md:grid-cols-2\">
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2312,20 +2322,20 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2410,20 +2420,20 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, "

") 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")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 569, Col: 83} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 574, Col: 83} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var111)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2439,20 +2449,20 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var113 string templ_7745c5c3_Var113, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.heartbeat_hint")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 572, Col: 80} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 577, Col: 80} } _, 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, 195, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2478,66 +2488,66 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2579,203 +2589,203 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, "

") 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.prom_hint")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 594, Col: 75} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 599, 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, 205, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2809,92 +2819,92 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -2906,193 +2916,193 @@ 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, 235, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var137 string templ_7745c5c3_Var137, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.assertions")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 643, Col: 125} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 648, Col: 125} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var137)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 237, "

") 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.assertions_hint")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 644, Col: 82} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 649, Col: 82} } _, 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, 237, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for i, a := range f.Assertions { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, "\" class=\"border border-rule bg-transparent px-1 py-1 font-mono text-xs\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, op := range AssertionOps { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, "") + 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, 249, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 253, "\" 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, 253, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3114,66 +3124,66 @@ func MonitorEditor(p Page, me Me, f MonitorForm) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3217,7 +3227,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, 262, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3225,17 +3235,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, 263, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 266, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3243,7 +3253,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, 266, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3251,90 +3261,90 @@ 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, 267, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var154 string templ_7745c5c3_Var154, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "monitors.regions")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 682, Col: 121} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 687, Col: 121} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var154)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 272, "

") 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.regions_hint")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 683, Col: 78} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 688, Col: 78} } _, 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, 272, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, r := range f.Regions { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 283, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3398,51 +3408,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, 283, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 287, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 287, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 288, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3507,12 +3517,12 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component { return templ_7745c5c3_Err } if len(v.Channels) > 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 288, "
    ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 289, "
      ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, ch := range v.Channels { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 289, "
    • ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 290, "
    • ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3527,149 +3537,149 @@ func ChannelsPage(p Page, me Me, v ChannelsView) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 290, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 291, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var166 string templ_7745c5c3_Var166, 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: 744, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 749, Col: 21} } _, 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, 291, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 292, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var167 string templ_7745c5c3_Var167, 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: 745, Col: 70} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 750, Col: 70} } _, 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, 292, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 293, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var168 string templ_7745c5c3_Var168, 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: 746, Col: 77} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 751, Col: 77} } _, 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, 293, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 294, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if v.CanWrite { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 294, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 301, "") 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, 302, "") 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, 303, "
") 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, 304, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if v.CanWrite { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 304, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 305, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3677,7 +3687,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, 305, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 306, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3685,7 +3695,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, 306, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 307, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3701,20 +3711,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, 307, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 309, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3723,7 +3733,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, 309, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 310, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3731,7 +3741,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, 310, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 311, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3739,79 +3749,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, 311, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3819,30 +3829,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, 320, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 321, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 321, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 322, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var180 string templ_7745c5c3_Var180, 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: 795, Col: 79} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 800, Col: 79} } _, 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, 322, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 323, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 323, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 324, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -3874,85 +3884,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, 324, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 334, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -4007,20 +4017,20 @@ func GroupsPage(p Page, me Me, v GroupsView) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 334, "

← ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 335, "

← ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var188 string templ_7745c5c3_Var188, 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: 834, Col: 115} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 839, Col: 115} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var188)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 335, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 336, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -4029,69 +4039,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, 336, "
    ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 337, "
      ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, g := range v.Groups { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 337, "
    • ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 339, "\">
      ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var190 string templ_7745c5c3_Var190, 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: 841, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 846, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var190)) 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, 340, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if g.CanWrite { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 340, "
      ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 341, "
      ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var191 string templ_7745c5c3_Var191, 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: 844, Col: 99} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 849, Col: 99} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var191)) 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, 343, "\" data-method=\"put\" data-next=\"/groups\" class=\"mt-3 w-72\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -4103,20 +4113,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, 343, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 346, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -4132,66 +4142,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, 346, "
      ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 350, "
      ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - 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 } } - 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 } } - 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 } if v.CanWrite { - 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 } @@ -4199,7 +4209,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, 354, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 355, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -4211,20 +4221,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, 355, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 358, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -4240,7 +4250,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, 358, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 359, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -4279,7 +4289,7 @@ func pingSection(url string) templ.Component { } ctx = templ.InitializeContext(ctx) ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 359, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 360, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -4287,27 +4297,27 @@ func pingSection(url string) templ.Component { 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, 361, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var199 string templ_7745c5c3_Var199, 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: 889, Col: 83} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 894, Col: 83} } _, 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, 361, "

")
+		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 362, "

")
 		if templ_7745c5c3_Err != nil {
 			return templ_7745c5c3_Err
 		}
 		var templ_7745c5c3_Var200 string
 		templ_7745c5c3_Var200, 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: 890, Col: 137}
+			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 895, Col: 137}
 		}
 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var200))
 		if templ_7745c5c3_Err != nil {
@@ -4316,26 +4326,26 @@ func pingSection(url string) templ.Component {
 		var templ_7745c5c3_Var201 string
 		templ_7745c5c3_Var201, 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: 890, Col: 208}
+			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 895, Col: 208}
 		}
 		_, 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, 362, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 363, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var202 string templ_7745c5c3_Var202, 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: 891, Col: 84} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/monitors.templ`, Line: 896, Col: 84} } _, 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, 363, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 364, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } -- 2.54.1