diff --git a/apps/dashboard/src/components/forms/monitor-tag/sheet.tsx b/apps/dashboard/src/components/forms/monitor-tag/sheet.tsx index 3442c4992..c5e7b6478 100644 --- a/apps/dashboard/src/components/forms/monitor-tag/sheet.tsx +++ b/apps/dashboard/src/components/forms/monitor-tag/sheet.tsx @@ -49,7 +49,10 @@ export function FormSheetMonitorTag({ { + await onSubmit(values); + setOpen(false); + }} defaultValues={defaultValues} id="tags-form" className="my-4" diff --git a/apps/dashboard/src/components/forms/monitor/form-follow-redirect.tsx b/apps/dashboard/src/components/forms/monitor/form-follow-redirect.tsx index 8c783e303..65baeb81c 100644 --- a/apps/dashboard/src/components/forms/monitor/form-follow-redirect.tsx +++ b/apps/dashboard/src/components/forms/monitor/form-follow-redirect.tsx @@ -108,7 +108,7 @@ export function FormFollowRedirect({ Learn more about{" "} diff --git a/apps/dashboard/src/components/forms/monitor/form-general.tsx b/apps/dashboard/src/components/forms/monitor/form-general.tsx index 519de499c..7ecbc4250 100644 --- a/apps/dashboard/src/components/forms/monitor/form-general.tsx +++ b/apps/dashboard/src/components/forms/monitor/form-general.tsx @@ -36,6 +36,7 @@ import { AlertDialogTitle, } from "@openstatus/ui/components/ui/alert-dialog"; import { Button } from "@openstatus/ui/components/ui/button"; +import { Checkbox } from "@openstatus/ui/components/ui/checkbox"; import { Form, FormControl, @@ -57,7 +58,6 @@ import { SelectTrigger, SelectValue, } from "@openstatus/ui/components/ui/select"; -import { Switch } from "@openstatus/ui/components/ui/switch"; import { Textarea } from "@openstatus/ui/components/ui/textarea"; import { Tooltip, @@ -153,6 +153,9 @@ export function FormGeneral({ const [isPending, startTransition] = useTransition(); const watchType = form.watch("type"); const watchMethod = form.watch("method"); + // Each type has its own reference page; only http and dns support assertions. + const referenceUrl = `https://www.openstatus.dev/docs/reference/${watchType ?? "http"}-monitor/`; + const hasAssertions = watchType === "http" || watchType === "dns"; useEffect(() => { // NOTE: reset form when type changes @@ -259,8 +262,7 @@ export function FormGeneral({ - Internal name for your monitor. This will be used to - identify the monitor in the dashboard. + Internal name to identify the monitor in the dashboard. )} @@ -269,14 +271,18 @@ export function FormGeneral({ control={form.control} name="active" render={({ field }) => ( - - Active - - - + + {/* pt = label height + gap, so the checkbox sits on the input line */} +
+ + + + Active +
+ Uncheck to pause checks.
)} /> @@ -1131,21 +1137,22 @@ export function FormGeneral({ Learn more about{" "} - + Monitor Type - {" "} - and{" "} - - Assertions + {hasAssertions && ( + <> + {" "} + and{" "} + + Assertions + + + )} . We test your endpoint before saving the monitor. +
diff --git a/apps/web/src/content/docs.config.ts b/apps/web/src/content/docs.config.ts index 7f55327ca..6d8a890e5 100644 --- a/apps/web/src/content/docs.config.ts +++ b/apps/web/src/content/docs.config.ts @@ -245,12 +245,12 @@ export const docsNav: DocsNavSection[] = [ { slug: "reference/grpc-monitor", label: "gRPC Monitor Reference" }, { slug: "reference/http-monitor", label: "HTTP Monitor Reference" }, { slug: "reference/icmp-monitor", label: "ICMP Monitor Reference" }, - { slug: "reference/incident", label: "Incident Reference" }, { slug: "reference/tcp-monitor", label: "TCP Monitor Reference" }, { slug: "reference/notification", label: "Notification Channels Reference", }, + { slug: "reference/incident", label: "Incident Reference" }, { slug: "reference/location", label: "Location Reference" }, { slug: "reference/private-location", diff --git a/packages/ui/src/components/ui/form.tsx b/packages/ui/src/components/ui/form.tsx index a5f88f4ba..f0023cdbb 100644 --- a/packages/ui/src/components/ui/form.tsx +++ b/packages/ui/src/components/ui/form.tsx @@ -79,7 +79,7 @@ function FormItem({ className, ...props }: React.ComponentProps<"div">) {