* Don't save animated webp

* Fix bad export state

* Contain scroll for camera group

* Use dvh
This commit is contained in:
Nicolas Mowen 2024-04-29 15:23:24 -06:00 committed by GitHub
parent 7745313cdc
commit 1c9626ecff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 43 additions and 31 deletions

View File

@ -110,6 +110,8 @@ class RecordingExporter(threading.Thread):
f"00:{minutes}:{seconds}", f"00:{minutes}:{seconds}",
"-i", "-i",
preview.path, preview.path,
"-frames",
"1",
"-c:v", "-c:v",
"libwebp", "libwebp",
thumb_path, thumb_path,

View File

@ -282,7 +282,7 @@ function NewGroupDialog({
}} }}
> >
<Content <Content
className={`min-w-0 ${isMobile ? "w-full p-3 rounded-t-2xl max-h-[90%]" : "w-6/12 max-h-dvh overflow-y-auto"}`} className={`min-w-0 ${isMobile ? "w-full p-3 rounded-t-2xl max-h-[90%]" : "w-6/12 max-h-dvh overflow-y-hidden"}`}
> >
<div className="flex flex-col my-4 overflow-y-auto"> <div className="flex flex-col my-4 overflow-y-auto">
{editState === "none" && ( {editState === "none" && (
@ -535,7 +535,10 @@ export function CameraGroupEdit({
return ( return (
<Form {...form}> <Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="mt-2 space-y-6"> <form
onSubmit={form.handleSubmit(onSubmit)}
className="mt-2 space-y-6 overflow-y-hidden"
>
<FormField <FormField
control={form.control} control={form.control}
name="name" name="name"
@ -556,34 +559,38 @@ export function CameraGroupEdit({
/> />
<Separator className="flex my-2 bg-secondary" /> <Separator className="flex my-2 bg-secondary" />
<FormField <div className="max-h-[40dvh] overflow-y-auto">
control={form.control} <FormField
name="cameras" control={form.control}
render={({ field }) => ( name="cameras"
<FormItem> render={({ field }) => (
<FormLabel>Cameras</FormLabel> <FormItem>
<FormDescription>Select cameras for this group.</FormDescription> <FormLabel>Cameras</FormLabel>
{[ <FormDescription>
...(birdseyeConfig?.enabled ? ["birdseye"] : []), Select cameras for this group.
...Object.keys(config?.cameras ?? {}), </FormDescription>
].map((camera) => ( {[
<FormControl key={camera}> ...(birdseyeConfig?.enabled ? ["birdseye"] : []),
<FilterSwitch ...Object.keys(config?.cameras ?? {}),
isChecked={field.value && field.value.includes(camera)} ].map((camera) => (
label={camera.replaceAll("_", " ")} <FormControl key={camera}>
onCheckedChange={(checked) => { <FilterSwitch
const updatedCameras = checked isChecked={field.value && field.value.includes(camera)}
? [...(field.value || []), camera] label={camera.replaceAll("_", " ")}
: (field.value || []).filter((c) => c !== camera); onCheckedChange={(checked) => {
form.setValue("cameras", updatedCameras); const updatedCameras = checked
}} ? [...(field.value || []), camera]
/> : (field.value || []).filter((c) => c !== camera);
</FormControl> form.setValue("cameras", updatedCameras);
))} }}
<FormMessage /> />
</FormItem> </FormControl>
)} ))}
/> <FormMessage />
</FormItem>
)}
/>
</div>
<Separator className="flex my-2 bg-secondary" /> <Separator className="flex my-2 bg-secondary" />
<FormField <FormField

View File

@ -138,7 +138,10 @@ export default function MobileReviewSettingsDrawer({
{features.includes("export") && ( {features.includes("export") && (
<Button <Button
className="w-full flex justify-center items-center gap-2" className="w-full flex justify-center items-center gap-2"
onClick={() => setDrawerMode("export")} onClick={() => {
setDrawerMode("export");
setMode("select");
}}
> >
<FaArrowDown className="p-1 fill-secondary bg-secondary-foreground rounded-md" /> <FaArrowDown className="p-1 fill-secondary bg-secondary-foreground rounded-md" />
Export Export