From 8d3f43101aaceb2b0588668a1570b907f2bf2e2d Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 26 Oct 2025 12:28:14 -0500 Subject: [PATCH] add ability to submit frames to frigate+ --- .../overlay/detail/ObjectLifecycle.tsx | 65 ++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/web/src/components/overlay/detail/ObjectLifecycle.tsx b/web/src/components/overlay/detail/ObjectLifecycle.tsx index 954f9cd6d..1ff4ade8d 100644 --- a/web/src/components/overlay/detail/ObjectLifecycle.tsx +++ b/web/src/components/overlay/detail/ObjectLifecycle.tsx @@ -41,6 +41,13 @@ import { ContextMenuItem, ContextMenuTrigger, } from "@/components/ui/context-menu"; +import { + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuPortal, +} from "@/components/ui/dropdown-menu"; import { Link, useNavigate } from "react-router-dom"; import { ObjectPath } from "./ObjectPath"; import { getLifecycleItemDescription } from "@/utils/lifecycleUtil"; @@ -48,6 +55,10 @@ import { IoPlayCircleOutline } from "react-icons/io5"; import { useTranslation } from "react-i18next"; import { getTranslatedLabel } from "@/utils/i18n"; import { Badge } from "@/components/ui/badge"; +import FrigatePlusIcon from "@/components/icons/FrigatePlusIcon"; +import { HiDotsHorizontal } from "react-icons/hi"; +import axios from "axios"; +import { toast } from "sonner"; type ObjectLifecycleProps = { className?: string; @@ -816,7 +827,9 @@ function LifecycleIconRow({ setSelectedZone, getZoneColor, }: LifecycleIconRowProps) { - const { t } = useTranslation(["views/explore"]); + const { t } = useTranslation(["views/explore", "components/player"]); + const [isOpen, setIsOpen] = useState(false); + const { data: config } = useSWR("config"); return (
-
{formattedEventTimestamp}
+
+
{formattedEventTimestamp}
+ {config?.plus?.enabled && ( + + +
+ +
+
+ + + {config?.plus?.enabled && ( + { + const resp = await axios.post( + `/${item.camera}/plus/${item.timestamp}`, + ); + + if (resp && resp.status == 200) { + toast.success( + t("toast.success.submittedFrigatePlus", { + ns: "components/player", + }), + { + position: "top-center", + }, + ); + } else { + toast.success( + t("toast.error.submitFrigatePlusFailed", { + ns: "components/player", + }), + { + position: "top-center", + }, + ); + } + }} + > + + {t("itemMenu.submitToPlus.label")} + + )} + + +
+ )} +