From e2da8aa04c965cbd3befed61da27923e0bc5cd4e Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 23 Oct 2025 14:58:22 -0500 Subject: [PATCH] Camera wizard tweaks (#20643) * dialog size tweaks * move icon and make links in popvers clickable * colors and clickable links --- .../settings/CameraWizardDialog.tsx | 12 ++- .../settings/wizard/Step1NameCamera.tsx | 89 +++++++++++-------- .../settings/wizard/Step2StreamConfig.tsx | 10 +-- 3 files changed, 66 insertions(+), 45 deletions(-) diff --git a/web/src/components/settings/CameraWizardDialog.tsx b/web/src/components/settings/CameraWizardDialog.tsx index 12b150e37..db1804982 100644 --- a/web/src/components/settings/CameraWizardDialog.tsx +++ b/web/src/components/settings/CameraWizardDialog.tsx @@ -20,6 +20,8 @@ import type { ConfigSetBody, } from "@/types/cameraWizard"; import { processCameraName } from "@/utils/cameraUtil"; +import { isDesktop } from "react-device-detect"; +import { cn } from "@/lib/utils"; type WizardState = { wizardData: Partial; @@ -335,7 +337,15 @@ export default function CameraWizardDialog({ return ( 1 && "max-w-4xl", + )} onInteractOutside={(e) => { e.preventDefault(); }} diff --git a/web/src/components/settings/wizard/Step1NameCamera.tsx b/web/src/components/settings/wizard/Step1NameCamera.tsx index 2065d1ae6..df6e55269 100644 --- a/web/src/components/settings/wizard/Step1NameCamera.tsx +++ b/web/src/components/settings/wizard/Step1NameCamera.tsx @@ -6,7 +6,6 @@ import { FormItem, FormLabel, FormMessage, - FormDescription, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { @@ -298,6 +297,7 @@ export default function Step1NameCamera({ }; setTestResult(testResult); + onUpdate({ streams: [{ id: "", url: "", roles: [], testResult }] }); toast.success(t("cameraWizard.step1.testSuccess")); } else { const error = @@ -337,7 +337,7 @@ export default function Step1NameCamera({ setIsTesting(false); setTestStatus(""); } - }, [form, generateStreamUrl, t]); + }, [form, generateStreamUrl, t, onUpdate]); const onSubmit = (data: z.infer) => { onUpdate(data); @@ -380,7 +380,9 @@ export default function Step1NameCamera({ name="cameraName" render={({ field }) => ( - {t("cameraWizard.step1.cameraName")} + + {t("cameraWizard.step1.cameraName")} + ( - {t("cameraWizard.step1.cameraBrand")} +
+ + {t("cameraWizard.step1.cameraBrand")} + + {field.value && + (() => { + const selectedBrand = CAMERA_BRANDS.find( + (brand) => brand.value === field.value, + ); + return selectedBrand && + selectedBrand.value != "other" ? ( + + + + + +
+

+ {selectedBrand.label} +

+

+ {t("cameraWizard.step1.brandUrlFormat", { + exampleUrl: selectedBrand.exampleUrl, + })} +

+
+
+
+ ) : null; + })()} +
- {field.value && - (() => { - const selectedBrand = CAMERA_BRANDS.find( - (brand) => brand.value === field.value, - ); - return selectedBrand && - selectedBrand.value != "other" ? ( - - - -
- - {t("cameraWizard.step1.brandInformation")} -
-
- -
-

- {selectedBrand.label} -

-

- {t("cameraWizard.step1.brandUrlFormat", { - exampleUrl: selectedBrand.exampleUrl, - })} -

-
-
-
-
- ) : null; - })()}
)} /> @@ -463,7 +470,9 @@ export default function Step1NameCamera({ name="host" render={({ field }) => ( - {t("cameraWizard.step1.host")} + + {t("cameraWizard.step1.host")} + ( - + {t("cameraWizard.step1.username")} @@ -503,7 +512,7 @@ export default function Step1NameCamera({ name="password" render={({ field }) => ( - + {t("cameraWizard.step1.password")} @@ -544,7 +553,9 @@ export default function Step1NameCamera({ name="customUrl" render={({ field }) => ( - {t("cameraWizard.step1.customUrl")} + + {t("cameraWizard.step1.customUrl")} +
-