From df6f8b6f629686abe5dc9c8419645f5754d29cbd Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Tue, 21 Jul 2026 14:24:38 +0100 Subject: [PATCH] feat(web): notification channel settings UI --- web/app/monitors/new/page.tsx | 34 ++++- web/app/monitors/page.tsx | 11 +- web/app/settings/notifications/page.tsx | 174 ++++++++++++++++++++++++ web/lib/api.ts | 39 ++++++ 4 files changed, 254 insertions(+), 4 deletions(-) create mode 100644 web/app/settings/notifications/page.tsx diff --git a/web/app/monitors/new/page.tsx b/web/app/monitors/new/page.tsx index 3f02ac3..1c60a1e 100644 --- a/web/app/monitors/new/page.tsx +++ b/web/app/monitors/new/page.tsx @@ -29,8 +29,10 @@ export default function NewMonitorPage() { const [retries, setRetries] = useState(1); const [runner, setRunner] = useState("server"); const [enabled, setEnabled] = useState(true); + const [channelIds, setChannelIds] = useState([]); const { data: servers } = useQuery({ queryKey: ["servers"], queryFn: () => api.listServers() }); + const { data: channels } = useQuery({ queryKey: ["channels"], queryFn: () => api.listChannels() }); const { mutate: create, isPending, error } = useMutation({ mutationFn: (input: MonitorInput) => api.createMonitor(input), @@ -58,7 +60,7 @@ export default function NewMonitorPage() { target.host = host; target.port = port; } - create({ name, type, target, interval_sec: intervalSec, retries, runner, enabled }); + create({ name, type, target, interval_sec: intervalSec, retries, runner, enabled, channel_ids: channelIds }); } return ( @@ -165,6 +167,36 @@ export default function NewMonitorPage() {

Agent-run monitors require the agent monitor scheduler (P2).

+
+ + {!channels || channels.length === 0 ? ( +

+ No channels yet.{" "} + + Add one + + . +

+ ) : ( +
+ {channels.map((ch) => ( + + ))} +
+ )} +
+