fix(api): platform check type switch binds the platform's checkers only
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 11m25s
ci / test (pull_request) Successful in 12m34s
ci / build (pull_request) Successful in 18m7s
ci / image (pull_request) Successful in 5m22s
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 11m25s
ci / test (pull_request) Successful in 12m34s
ci / build (pull_request) Successful in 18m7s
ci / image (pull_request) Successful in 5m22s
Switching a check type off in the admin area removed it for every organization, own checkers included, and hid it from the organization's own choice. The platform switch now only keeps such monitors off the platform's regions: organizations with regions of their own still create them there (422 check_type_own_checkers_only on a platform region), and the editor marks them "own checkers only". Passive types, which no checker runs, stay switched off entirely. The organization's check types are chosen independently of the platform's: its settings list every type, and the platform switch no longer rewrites that choice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
12e6de77aa
commit
bd887523de
12 files changed
+2296
-2096
No files matched your search
@@ -579,6 +579,13 @@ templ IncidentsPage(p Page, me Me, v IncidentsView) {
|
||||
}
|
||||
}
|
||||
|
||||
// TypeOption is a check type offered in the monitor form. OwnOnly types
|
||||
// run on the organization's own checkers only.
|
||||
type TypeOption struct {
|
||||
Type string
|
||||
OwnOnly bool
|
||||
}
|
||||
|
||||
// RegionOption is a selectable region in the monitor form.
|
||||
type RegionOption struct {
|
||||
ID string
|
||||
@@ -639,7 +646,7 @@ type MonitorForm struct {
|
||||
Game GameForm
|
||||
DockerHost string
|
||||
// Types are the check types to offer.
|
||||
Types []string
|
||||
Types []TypeOption
|
||||
}
|
||||
|
||||
// BrokerForm holds the settings of message broker checks.
|
||||
@@ -765,7 +772,12 @@ templ MonitorEditor(p Page, me Me, f MonitorForm) {
|
||||
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "monitors.type") }</span>
|
||||
<select name="type" data-type-select class="w-full border border-rule bg-transparent px-2 py-1.5 text-sm">
|
||||
for _, t := range f.Types {
|
||||
<option value={ t } selected?={ t == f.Type }>{ i18n.T(ctx, "monitors.type_"+t) }</option>
|
||||
<option value={ t.Type } selected?={ t.Type == f.Type }>
|
||||
{ i18n.T(ctx, "monitors.type_"+t.Type) }
|
||||
if t.OwnOnly {
|
||||
({ i18n.T(ctx, "monitors.type_own_only") })
|
||||
}
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
+1724
-1694
File diff suppressed because it is too large.
Load diff
@@ -212,6 +212,8 @@ templ AdminPage(p Page, me Me, v RegionsView, storage StorageView, checkTypes []
|
||||
type CheckTypeOption struct {
|
||||
Type string
|
||||
Enabled bool
|
||||
// Note is the i18n key of a remark next to the type, if any.
|
||||
Note string
|
||||
}
|
||||
|
||||
templ checkerNetworkSection(allow bool) {
|
||||
@@ -239,6 +241,9 @@ templ checkTypesSection(types []CheckTypeOption, api, next, introID string) {
|
||||
<label class="flex items-center gap-2">
|
||||
<input type="checkbox" name="enabled" value={ t.Type } data-multi checked?={ t.Enabled } class="accent-ink"/>
|
||||
{ i18n.T(ctx, "monitors.type_"+t.Type) }
|
||||
if t.Note != "" {
|
||||
<span class="text-xs text-muted">{ i18n.T(ctx, t.Note) }</span>
|
||||
}
|
||||
</label>
|
||||
}
|
||||
</div>
|
||||
|
||||
+376
-351
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user