mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-21 23:58:22 +03:00
Compare commits
4 Commits
ab43a33d19
...
35cca5bd4b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35cca5bd4b | ||
|
|
b93dcf151d | ||
|
|
b1eca87cb5 | ||
|
|
4ab9fd114f |
@ -369,6 +369,10 @@ def get_ort_providers(
|
||||
"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:
|
||||
providers.append(provider)
|
||||
options.append({})
|
||||
|
||||
@ -4,6 +4,7 @@ import {
|
||||
useEffect,
|
||||
useState,
|
||||
useCallback,
|
||||
useRef,
|
||||
} from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
@ -121,17 +122,20 @@ export function MobilePagePortal({
|
||||
type MobilePageContentProps = {
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
scrollerRef?: React.RefObject<HTMLDivElement>;
|
||||
};
|
||||
|
||||
export function MobilePageContent({
|
||||
children,
|
||||
className,
|
||||
scrollerRef,
|
||||
}: MobilePageContentProps) {
|
||||
const context = useContext(MobilePageContext);
|
||||
if (!context)
|
||||
throw new Error("MobilePageContent must be used within MobilePage");
|
||||
|
||||
const [isVisible, setIsVisible] = useState(context.open);
|
||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (context.open) {
|
||||
@ -140,15 +144,27 @@ export function MobilePageContent({
|
||||
}, [context.open]);
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (context.open && scrollerRef?.current) {
|
||||
scrollerRef.current.scrollTop = 0;
|
||||
}
|
||||
}, [context.open, scrollerRef]);
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
{isVisible && (
|
||||
<motion.div
|
||||
ref={containerRef}
|
||||
className={cn(
|
||||
"fixed inset-0 z-50 mb-12 bg-background",
|
||||
isPWA && "mb-16",
|
||||
|
||||
@ -20,7 +20,9 @@ import {
|
||||
SheetTitle,
|
||||
SheetTrigger,
|
||||
} from "@/components/ui/sheet";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { isMobile } from "react-device-detect";
|
||||
import { useRef } from "react";
|
||||
|
||||
type PlatformAwareDialogProps = {
|
||||
trigger: JSX.Element;
|
||||
@ -79,6 +81,8 @@ export function PlatformAwareSheet({
|
||||
open,
|
||||
onOpenChange,
|
||||
}: PlatformAwareSheetProps) {
|
||||
const scrollerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
if (isMobile) {
|
||||
return (
|
||||
<MobilePage open={open} onOpenChange={onOpenChange}>
|
||||
@ -86,14 +90,22 @@ export function PlatformAwareSheet({
|
||||
{trigger}
|
||||
</MobilePageTrigger>
|
||||
<MobilePagePortal>
|
||||
<MobilePageContent className="h-full overflow-hidden">
|
||||
<MobilePageContent
|
||||
className="flex h-full flex-col"
|
||||
scrollerRef={scrollerRef}
|
||||
>
|
||||
<MobilePageHeader
|
||||
className="mx-2"
|
||||
onClose={() => onOpenChange(false)}
|
||||
>
|
||||
<MobilePageTitle>{title}</MobilePageTitle>
|
||||
</MobilePageHeader>
|
||||
<div className={contentClassName}>{content}</div>
|
||||
<div
|
||||
ref={scrollerRef}
|
||||
className={cn("flex-1 overflow-y-auto", contentClassName)}
|
||||
>
|
||||
{content}
|
||||
</div>
|
||||
</MobilePageContent>
|
||||
</MobilePagePortal>
|
||||
</MobilePage>
|
||||
|
||||
@ -230,6 +230,7 @@ export default function SearchFilterDialog({
|
||||
<PlatformAwareSheet
|
||||
trigger={trigger}
|
||||
title={t("more")}
|
||||
titleClassName="mb-5 -mt-3"
|
||||
content={content}
|
||||
contentClassName={cn(
|
||||
"w-auto lg:min-w-[275px] scrollbar-container h-full overflow-auto px-4",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user