mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-18 11:33:00 +03:00
Compare commits
3
Commits
00a4b163fc
...
b7aeda15d1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7aeda15d1 | ||
|
|
e2ce0c82ff | ||
|
|
4211250912 |
Generated
+14
-4
@@ -52,7 +52,7 @@
|
|||||||
"i18next-http-backend": "^3.0.1",
|
"i18next-http-backend": "^3.0.1",
|
||||||
"idb-keyval": "^6.2.1",
|
"idb-keyval": "^6.2.1",
|
||||||
"immer": "^10.1.1",
|
"immer": "^10.1.1",
|
||||||
"js-yaml": "^4.1.1",
|
"js-yaml": "^4.2.0",
|
||||||
"konva": "^10.2.3",
|
"konva": "^10.2.3",
|
||||||
"lodash": "^4.18.1",
|
"lodash": "^4.18.1",
|
||||||
"lucide-react": "^0.577.0",
|
"lucide-react": "^0.577.0",
|
||||||
@@ -9407,9 +9407,19 @@
|
|||||||
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
|
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
|
||||||
},
|
},
|
||||||
"node_modules/js-yaml": {
|
"node_modules/js-yaml": {
|
||||||
"version": "4.1.1",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz",
|
||||||
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
"integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/puzrin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/nodeca"
|
||||||
|
}
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"argparse": "^2.0.1"
|
"argparse": "^2.0.1"
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@
|
|||||||
"i18next-http-backend": "^3.0.1",
|
"i18next-http-backend": "^3.0.1",
|
||||||
"idb-keyval": "^6.2.1",
|
"idb-keyval": "^6.2.1",
|
||||||
"immer": "^10.1.1",
|
"immer": "^10.1.1",
|
||||||
"js-yaml": "^4.1.1",
|
"js-yaml": "^4.2.0",
|
||||||
"konva": "^10.2.3",
|
"konva": "^10.2.3",
|
||||||
"lodash": "^4.18.1",
|
"lodash": "^4.18.1",
|
||||||
"lucide-react": "^0.577.0",
|
"lucide-react": "^0.577.0",
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
},
|
},
|
||||||
"state": {
|
"state": {
|
||||||
"submitted": "Submitted"
|
"submitted": "Submitted"
|
||||||
|
},
|
||||||
|
"toast": {
|
||||||
|
"error": "Failed to submit to Frigate+. Please check your network connection and try again."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1251,30 +1251,42 @@ function ObjectDetailsTab({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
falsePositive
|
try {
|
||||||
? axios.put(`events/${search.id}/false_positive`)
|
const resp = falsePositive
|
||||||
: axios.post(`events/${search.id}/plus`, {
|
? await axios.put(`events/${search.id}/false_positive`)
|
||||||
include_annotation: 1,
|
: await axios.post(`events/${search.id}/plus`, {
|
||||||
});
|
include_annotation: 1,
|
||||||
|
});
|
||||||
|
|
||||||
setState("submitted");
|
if (resp.status !== 200 || !resp.data?.success) {
|
||||||
setSearch({ ...search, plus_id: "new_upload" });
|
throw new Error();
|
||||||
mutate(
|
}
|
||||||
(key) => isEventsKey(key),
|
|
||||||
(currentData: SearchResult[][] | SearchResult[] | undefined) =>
|
setState("submitted");
|
||||||
mapSearchResults(currentData, (event) =>
|
setSearch({ ...search, plus_id: "new_upload" });
|
||||||
event.id === search.id
|
mutate(
|
||||||
? { ...event, plus_id: "new_upload" }
|
(key) => isEventsKey(key),
|
||||||
: event,
|
(currentData: SearchResult[][] | SearchResult[] | undefined) =>
|
||||||
),
|
mapSearchResults(currentData, (event) =>
|
||||||
{
|
event.id === search.id
|
||||||
optimisticData: true,
|
? { ...event, plus_id: "new_upload" }
|
||||||
rollbackOnError: true,
|
: event,
|
||||||
revalidate: false,
|
),
|
||||||
},
|
{
|
||||||
);
|
optimisticData: true,
|
||||||
|
rollbackOnError: true,
|
||||||
|
revalidate: false,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} catch {
|
||||||
|
setState("reviewing");
|
||||||
|
toast.error(
|
||||||
|
t("explore.plus.review.toast.error", { ns: "components/dialog" }),
|
||||||
|
{ position: "top-center" },
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[search, mutate, mapSearchResults, setSearch, isEventsKey],
|
[search, mutate, mapSearchResults, setSearch, isEventsKey, t],
|
||||||
);
|
);
|
||||||
|
|
||||||
const popoverContainerRef = useRef<HTMLDivElement | null>(null);
|
const popoverContainerRef = useRef<HTMLDivElement | null>(null);
|
||||||
|
|||||||
@@ -1225,11 +1225,15 @@ function LifecycleIconRow({
|
|||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
className="cursor-pointer"
|
className="cursor-pointer"
|
||||||
onSelect={async () => {
|
onSelect={async () => {
|
||||||
const resp = await axios.post(
|
try {
|
||||||
`/${item.camera}/plus/${item.timestamp + annotationOffset / 1000}`,
|
const resp = await axios.post(
|
||||||
);
|
`/${item.camera}/plus/${item.timestamp + annotationOffset / 1000}`,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (resp.status !== 200) {
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
|
||||||
if (resp && resp.status == 200) {
|
|
||||||
toast.success(
|
toast.success(
|
||||||
t("toast.success.submittedFrigatePlus", {
|
t("toast.success.submittedFrigatePlus", {
|
||||||
ns: "components/player",
|
ns: "components/player",
|
||||||
@@ -1238,8 +1242,8 @@ function LifecycleIconRow({
|
|||||||
position: "top-center",
|
position: "top-center",
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} catch {
|
||||||
toast.success(
|
toast.error(
|
||||||
t("toast.error.submitFrigatePlusFailed", {
|
t("toast.error.submitFrigatePlusFailed", {
|
||||||
ns: "components/player",
|
ns: "components/player",
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { isDesktop, isMobile, isSafari } from "react-device-detect";
|
|||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { toast } from "sonner";
|
||||||
import { useTranslation, Trans } from "react-i18next";
|
import { useTranslation, Trans } from "react-i18next";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
||||||
@@ -48,13 +49,28 @@ export function FrigatePlusDialog({
|
|||||||
const onSubmitToPlus = useCallback(
|
const onSubmitToPlus = useCallback(
|
||||||
async (falsePositive: boolean) => {
|
async (falsePositive: boolean) => {
|
||||||
if (!upload) return;
|
if (!upload) return;
|
||||||
falsePositive
|
|
||||||
? axios.put(`events/${upload.id}/false_positive`)
|
try {
|
||||||
: axios.post(`events/${upload.id}/plus`, { include_annotation: 1 });
|
const resp = falsePositive
|
||||||
setState("submitted");
|
? await axios.put(`events/${upload.id}/false_positive`)
|
||||||
onEventUploaded();
|
: await axios.post(`events/${upload.id}/plus`, {
|
||||||
|
include_annotation: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (resp.status !== 200 || !resp.data?.success) {
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
|
||||||
|
setState("submitted");
|
||||||
|
onEventUploaded();
|
||||||
|
} catch {
|
||||||
|
setState("reviewing");
|
||||||
|
toast.error(t("explore.plus.review.toast.error"), {
|
||||||
|
position: "top-center",
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[upload, onEventUploaded],
|
[upload, onEventUploaded, t],
|
||||||
);
|
);
|
||||||
|
|
||||||
const [imgRef, imgLoaded, onImgLoad] = useImageLoaded();
|
const [imgRef, imgLoaded, onImgLoad] = useImageLoaded();
|
||||||
|
|||||||
Reference in New Issue
Block a user