mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-03 05:44:52 +03:00
Compare commits
No commits in common. "35cca5bd4b0bd7ac2be7f5d91e9e4b3013eace58" and "ab43a33d19e40d7e29bb06d1890779e8f09d8a47" have entirely different histories.
35cca5bd4b
...
ab43a33d19
@ -369,10 +369,6 @@ def get_ort_providers(
|
|||||||
"enable_cpu_mem_arena": False,
|
"enable_cpu_mem_arena": False,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
elif provider == "AzureExecutionProvider":
|
|
||||||
# Skip Azure provider - not typically available on local hardware
|
|
||||||
# and prevents fallback to OpenVINO when it's the first provider
|
|
||||||
continue
|
|
||||||
else:
|
else:
|
||||||
providers.append(provider)
|
providers.append(provider)
|
||||||
options.append({})
|
options.append({})
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import {
|
|||||||
useEffect,
|
useEffect,
|
||||||
useState,
|
useState,
|
||||||
useCallback,
|
useCallback,
|
||||||
useRef,
|
|
||||||
} from "react";
|
} from "react";
|
||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
import { motion, AnimatePresence } from "framer-motion";
|
import { motion, AnimatePresence } from "framer-motion";
|
||||||
@ -122,20 +121,17 @@ export function MobilePagePortal({
|
|||||||
type MobilePageContentProps = {
|
type MobilePageContentProps = {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
scrollerRef?: React.RefObject<HTMLDivElement>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export function MobilePageContent({
|
export function MobilePageContent({
|
||||||
children,
|
children,
|
||||||
className,
|
className,
|
||||||
scrollerRef,
|
|
||||||
}: MobilePageContentProps) {
|
}: MobilePageContentProps) {
|
||||||
const context = useContext(MobilePageContext);
|
const context = useContext(MobilePageContext);
|
||||||
if (!context)
|
if (!context)
|
||||||
throw new Error("MobilePageContent must be used within MobilePage");
|
throw new Error("MobilePageContent must be used within MobilePage");
|
||||||
|
|
||||||
const [isVisible, setIsVisible] = useState(context.open);
|
const [isVisible, setIsVisible] = useState(context.open);
|
||||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (context.open) {
|
if (context.open) {
|
||||||
@ -144,27 +140,15 @@ export function MobilePageContent({
|
|||||||
}, [context.open]);
|
}, [context.open]);
|
||||||
|
|
||||||
const handleAnimationComplete = () => {
|
const handleAnimationComplete = () => {
|
||||||
if (context.open) {
|
if (!context.open) {
|
||||||
// After opening animation completes, ensure scroller is at the top
|
|
||||||
if (scrollerRef?.current) {
|
|
||||||
scrollerRef.current.scrollTop = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setIsVisible(false);
|
setIsVisible(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (context.open && scrollerRef?.current) {
|
|
||||||
scrollerRef.current.scrollTop = 0;
|
|
||||||
}
|
|
||||||
}, [context.open, scrollerRef]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{isVisible && (
|
{isVisible && (
|
||||||
<motion.div
|
<motion.div
|
||||||
ref={containerRef}
|
|
||||||
className={cn(
|
className={cn(
|
||||||
"fixed inset-0 z-50 mb-12 bg-background",
|
"fixed inset-0 z-50 mb-12 bg-background",
|
||||||
isPWA && "mb-16",
|
isPWA && "mb-16",
|
||||||
|
|||||||
@ -20,9 +20,7 @@ import {
|
|||||||
SheetTitle,
|
SheetTitle,
|
||||||
SheetTrigger,
|
SheetTrigger,
|
||||||
} from "@/components/ui/sheet";
|
} from "@/components/ui/sheet";
|
||||||
import { cn } from "@/lib/utils";
|
|
||||||
import { isMobile } from "react-device-detect";
|
import { isMobile } from "react-device-detect";
|
||||||
import { useRef } from "react";
|
|
||||||
|
|
||||||
type PlatformAwareDialogProps = {
|
type PlatformAwareDialogProps = {
|
||||||
trigger: JSX.Element;
|
trigger: JSX.Element;
|
||||||
@ -81,8 +79,6 @@ export function PlatformAwareSheet({
|
|||||||
open,
|
open,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
}: PlatformAwareSheetProps) {
|
}: PlatformAwareSheetProps) {
|
||||||
const scrollerRef = useRef<HTMLDivElement>(null);
|
|
||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
return (
|
return (
|
||||||
<MobilePage open={open} onOpenChange={onOpenChange}>
|
<MobilePage open={open} onOpenChange={onOpenChange}>
|
||||||
@ -90,22 +86,14 @@ export function PlatformAwareSheet({
|
|||||||
{trigger}
|
{trigger}
|
||||||
</MobilePageTrigger>
|
</MobilePageTrigger>
|
||||||
<MobilePagePortal>
|
<MobilePagePortal>
|
||||||
<MobilePageContent
|
<MobilePageContent className="h-full overflow-hidden">
|
||||||
className="flex h-full flex-col"
|
|
||||||
scrollerRef={scrollerRef}
|
|
||||||
>
|
|
||||||
<MobilePageHeader
|
<MobilePageHeader
|
||||||
className="mx-2"
|
className="mx-2"
|
||||||
onClose={() => onOpenChange(false)}
|
onClose={() => onOpenChange(false)}
|
||||||
>
|
>
|
||||||
<MobilePageTitle>{title}</MobilePageTitle>
|
<MobilePageTitle>{title}</MobilePageTitle>
|
||||||
</MobilePageHeader>
|
</MobilePageHeader>
|
||||||
<div
|
<div className={contentClassName}>{content}</div>
|
||||||
ref={scrollerRef}
|
|
||||||
className={cn("flex-1 overflow-y-auto", contentClassName)}
|
|
||||||
>
|
|
||||||
{content}
|
|
||||||
</div>
|
|
||||||
</MobilePageContent>
|
</MobilePageContent>
|
||||||
</MobilePagePortal>
|
</MobilePagePortal>
|
||||||
</MobilePage>
|
</MobilePage>
|
||||||
|
|||||||
@ -230,7 +230,6 @@ export default function SearchFilterDialog({
|
|||||||
<PlatformAwareSheet
|
<PlatformAwareSheet
|
||||||
trigger={trigger}
|
trigger={trigger}
|
||||||
title={t("more")}
|
title={t("more")}
|
||||||
titleClassName="mb-5 -mt-3"
|
|
||||||
content={content}
|
content={content}
|
||||||
contentClassName={cn(
|
contentClassName={cn(
|
||||||
"w-auto lg:min-w-[275px] scrollbar-container h-full overflow-auto px-4",
|
"w-auto lg:min-w-[275px] scrollbar-container h-full overflow-auto px-4",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user