From 7096afcdf2955f510e01551955f76975728a000f Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Tue, 18 Aug 2026 02:37:54 -0400 Subject: [PATCH] fix(status-page): allow DNS monitors to be added to status pages The monitor picker on the status page create/configure form fetched candidates using a hardcoded list of monitor types that omitted "dns", so DNS monitors were filtered out server-side and never appeared in the dialog. Everything else was already in place: the DNS provider stores checks like any other monitor type, and the status page renders them once attached. Rather than appending "dns" to the hardcoded list, derive the query from the existing SelectableMonitorTypes tuple in @/Types/Monitor. The two lists had silently drifted apart, and deriving prevents the next new monitor type from hitting the same bug. "hardware" is appended explicitly because infrastructure monitors are created on their own page and so are absent from the selectable set. Net effect on the requested types: gains "dns", loses none. Fixes #3721 --- client/src/Pages/StatusPage/Create/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/Pages/StatusPage/Create/index.tsx b/client/src/Pages/StatusPage/Create/index.tsx index 1a3a5c344..c04bcb186 100644 --- a/client/src/Pages/StatusPage/Create/index.tsx +++ b/client/src/Pages/StatusPage/Create/index.tsx @@ -15,6 +15,7 @@ import type { StatusPageFormData } from "@/Validation/statusPage"; import { statusPageStepCount, statusPageStepFieldsFor } from "@/Validation/statusPage"; import { useGet, usePost, usePut, useDelete } from "@/Hooks/UseApi"; import type { Monitor } from "@/Types/Monitor"; +import { SelectableMonitorTypes } from "@/Types/Monitor"; import type { MonitorDisplayType, StatusPageResponse } from "@/Types/StatusPage"; import { getMonitorTypeLabel } from "@/Types/StatusPage"; import { timezoneOptions } from "@/Utils/timezoneOptions"; @@ -58,11 +59,13 @@ const LogoUploadField = () => { ); }; +// Derived from SelectableMonitorTypes so a newly supported monitor type is +// offered here automatically; the previous hardcoded list silently omitted DNS. +// "hardware" is appended because infrastructure monitors are created on their +// own page and so are absent from the selectable set. const monitorsUrl = (() => { const params = new URLSearchParams(); - ["http", "ping", "port", "docker", "game", "grpc", "websocket", "hardware"].forEach( - (type) => params.append("type", type) - ); + [...SelectableMonitorTypes, "hardware"].forEach((type) => params.append("type", type)); return `/monitors/team?${params.toString()}`; })();