mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-01 17:41:13 +03:00
change replay confg dialog to platform aware sheet
This commit is contained in:
parent
58d66bf17a
commit
9e7ad7a9bd
@ -27,13 +27,7 @@ import {
|
|||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover";
|
} from "@/components/ui/popover";
|
||||||
import {
|
import { PlatformAwareSheet } from "@/components/overlay/dialog/PlatformAwareDialog";
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogDescription,
|
|
||||||
} from "@/components/ui/dialog";
|
|
||||||
import { useCameraActivity } from "@/hooks/use-camera-activity";
|
import { useCameraActivity } from "@/hooks/use-camera-activity";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import Heading from "@/components/ui/heading";
|
import Heading from "@/components/ui/heading";
|
||||||
@ -333,15 +327,64 @@ export default function Replay() {
|
|||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Button
|
<PlatformAwareSheet
|
||||||
variant="outline"
|
trigger={
|
||||||
size="sm"
|
<Button
|
||||||
className="flex items-center gap-2"
|
variant="outline"
|
||||||
onClick={() => setConfigDialogOpen(true)}
|
size="sm"
|
||||||
>
|
className="flex items-center gap-2"
|
||||||
<LuSettings className="size-4" />
|
>
|
||||||
<span className="hidden md:inline">{t("page.configuration")}</span>
|
<LuSettings className="size-4" />
|
||||||
</Button>
|
<span className="hidden md:inline">
|
||||||
|
{t("page.configuration")}
|
||||||
|
</span>
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
title={t("page.configuration")}
|
||||||
|
titleClassName="text-lg font-semibold"
|
||||||
|
contentClassName="scrollbar-container flex flex-col gap-0 overflow-y-auto px-6 pb-6 sm:max-w-xl md:max-w-2xl xl:max-w-3xl"
|
||||||
|
content={
|
||||||
|
<>
|
||||||
|
<p className="mb-5 text-sm text-muted-foreground">
|
||||||
|
{t("page.configurationDesc")}
|
||||||
|
</p>
|
||||||
|
{configSchema == null ? (
|
||||||
|
<div className="flex h-40 items-center justify-center">
|
||||||
|
<ActivityIndicator />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="space-y-6">
|
||||||
|
<ConfigSectionTemplate
|
||||||
|
sectionKey="motion"
|
||||||
|
level="replay"
|
||||||
|
cameraName={status.replay_camera ?? undefined}
|
||||||
|
skipSave
|
||||||
|
noStickyButtons
|
||||||
|
requiresRestart={false}
|
||||||
|
collapsible
|
||||||
|
defaultCollapsed={false}
|
||||||
|
showTitle
|
||||||
|
showOverrideIndicator={false}
|
||||||
|
/>
|
||||||
|
<ConfigSectionTemplate
|
||||||
|
sectionKey="objects"
|
||||||
|
level="replay"
|
||||||
|
cameraName={status.replay_camera ?? undefined}
|
||||||
|
skipSave
|
||||||
|
noStickyButtons
|
||||||
|
requiresRestart={false}
|
||||||
|
collapsible
|
||||||
|
defaultCollapsed={false}
|
||||||
|
showTitle
|
||||||
|
showOverrideIndicator={false}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
open={configDialogOpen}
|
||||||
|
onOpenChange={setConfigDialogOpen}
|
||||||
|
/>
|
||||||
|
|
||||||
<AlertDialog>
|
<AlertDialog>
|
||||||
<AlertDialogTrigger asChild>
|
<AlertDialogTrigger asChild>
|
||||||
@ -644,49 +687,6 @@ export default function Replay() {
|
|||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Dialog open={configDialogOpen} onOpenChange={setConfigDialogOpen}>
|
|
||||||
<DialogContent className="scrollbar-container max-h-[90dvh] overflow-y-auto sm:max-w-xl md:max-w-3xl lg:max-w-4xl">
|
|
||||||
<DialogHeader>
|
|
||||||
<DialogTitle>{t("page.configuration")}</DialogTitle>
|
|
||||||
<DialogDescription className="mb-5">
|
|
||||||
{t("page.configurationDesc")}
|
|
||||||
</DialogDescription>
|
|
||||||
</DialogHeader>
|
|
||||||
{configSchema == null ? (
|
|
||||||
<div className="flex h-40 items-center justify-center">
|
|
||||||
<ActivityIndicator />
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div className="space-y-6">
|
|
||||||
<ConfigSectionTemplate
|
|
||||||
sectionKey="motion"
|
|
||||||
level="replay"
|
|
||||||
cameraName={status.replay_camera ?? undefined}
|
|
||||||
skipSave
|
|
||||||
noStickyButtons
|
|
||||||
requiresRestart={false}
|
|
||||||
collapsible
|
|
||||||
defaultCollapsed={false}
|
|
||||||
showTitle
|
|
||||||
showOverrideIndicator={false}
|
|
||||||
/>
|
|
||||||
<ConfigSectionTemplate
|
|
||||||
sectionKey="objects"
|
|
||||||
level="replay"
|
|
||||||
cameraName={status.replay_camera ?? undefined}
|
|
||||||
skipSave
|
|
||||||
noStickyButtons
|
|
||||||
requiresRestart={false}
|
|
||||||
collapsible
|
|
||||||
defaultCollapsed={false}
|
|
||||||
showTitle
|
|
||||||
showOverrideIndicator={false}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user