feat(limits): limit the monitors shown on one status page

Platform admins set a default for how many monitors a status page may
show, and an override per organization, like the other limits. Saving a
page with more gives 422 page_monitor_limit; a page beyond a lowered
limit keeps its monitors but cannot grow. The page editor names the
limit and the organization's usage lists it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-25 23:21:26 +01:00
1 parent 4cde0f7e56
commit ca852c8299
17 files changed
+611 -416

No files matched your search

+5
View File
@@ -118,6 +118,8 @@ type PageEditor struct {
SwitchOffAt string
// DomainChangesPerDay is how often the domain may be changed a day.
DomainChangesPerDay int
// MonitorLimit is how many monitors the page may show; 0 is any.
MonitorLimit int
RecordName string
RecordValue string
Suspended bool
@@ -273,6 +275,9 @@ templ StatusPageEditor(p Page, me Me, e PageEditor) {
if len(e.Monitors) == 0 {
<p class="mb-4 text-sm text-muted">{ i18n.T(ctx, "console.monitors.empty") }</p>
} else {
if e.MonitorLimit > 0 {
<p class="mb-2 text-xs text-muted">{ i18n.T(ctx, "pages.monitor_limit", "Max", e.MonitorLimit) }</p>
}
<p class="mb-2 flex gap-4 text-xs">
<button type="button" data-check-all="on" data-check-target="[data-field=include]" class="text-muted hover:text-ink">{ i18n.T(ctx, "pages.monitors_all") }</button>
<button type="button" data-check-all="off" data-check-target="[data-field=include]" class="text-muted hover:text-ink">{ i18n.T(ctx, "pages.monitors_none") }</button>