mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-06 13:34:13 +03:00
UI Tweaks (#20403)
Some checks failed
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
Stalebot / stale (push) Has been cancelled
Some checks failed
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
Stalebot / stale (push) Has been cancelled
* Fix context menu link to debug * Use genai title for tooltip when available
This commit is contained in:
parent
f4e7549311
commit
24a1874225
@ -50,6 +50,27 @@ export function AnimatedEventCard({
|
||||
fetchPreviews: !currentHour,
|
||||
});
|
||||
|
||||
const tooltipText = useMemo(() => {
|
||||
if (event?.data?.metadata?.title) {
|
||||
return event.data.metadata.title;
|
||||
}
|
||||
|
||||
return (
|
||||
`${[
|
||||
...new Set([
|
||||
...(event.data.objects || []),
|
||||
...(event.data.sub_labels || []),
|
||||
...(event.data.audio || []),
|
||||
]),
|
||||
]
|
||||
.filter((item) => item !== undefined && !item.includes("-verified"))
|
||||
.map((text) => text.charAt(0).toUpperCase() + text.substring(1))
|
||||
.sort()
|
||||
.join(", ")
|
||||
.replaceAll("-verified", "")} ` + t("detected")
|
||||
);
|
||||
}, [event, t]);
|
||||
|
||||
// visibility
|
||||
|
||||
const [windowVisible, setWindowVisible] = useState(true);
|
||||
@ -220,20 +241,7 @@ export function AnimatedEventCard({
|
||||
)}
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
{`${[
|
||||
...new Set([
|
||||
...(event.data.objects || []),
|
||||
...(event.data.sub_labels || []),
|
||||
...(event.data.audio || []),
|
||||
]),
|
||||
]
|
||||
.filter((item) => item !== undefined && !item.includes("-verified"))
|
||||
.map((text) => text.charAt(0).toUpperCase() + text.substring(1))
|
||||
.sort()
|
||||
.join(", ")
|
||||
.replaceAll("-verified", "")} ` + t("detected")}
|
||||
</TooltipContent>
|
||||
<TooltipContent>{tooltipText}</TooltipContent>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
@ -355,9 +355,7 @@ export default function LiveContextMenu({
|
||||
<div
|
||||
className="flex w-full cursor-pointer items-center justify-start gap-2"
|
||||
onClick={
|
||||
isEnabled
|
||||
? () => navigate(`/settings?page=debug&camera=${camera}`)
|
||||
: undefined
|
||||
isEnabled ? () => navigate(`?debug=true#${camera}`) : undefined
|
||||
}
|
||||
>
|
||||
<div className="text-primary">
|
||||
|
||||
@ -112,7 +112,8 @@ export function useSearchEffect(
|
||||
callback: (value: string) => boolean,
|
||||
) {
|
||||
const location = useLocation();
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const navigate = useNavigate();
|
||||
const [searchParams] = useSearchParams();
|
||||
|
||||
const param = useMemo(() => {
|
||||
const param = searchParams.get(key);
|
||||
@ -132,7 +133,17 @@ export function useSearchEffect(
|
||||
const remove = callback(param[1]);
|
||||
|
||||
if (remove) {
|
||||
setSearchParams(undefined, { state: location.state, replace: true });
|
||||
navigate(location.pathname + location.hash, {
|
||||
state: location.state,
|
||||
replace: true,
|
||||
});
|
||||
}
|
||||
}, [param, location.state, callback, setSearchParams]);
|
||||
}, [
|
||||
param,
|
||||
location.state,
|
||||
location.pathname,
|
||||
location.hash,
|
||||
callback,
|
||||
navigate,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ type FrigateObjectState = {
|
||||
};
|
||||
|
||||
export interface FrigateReview {
|
||||
type: "new" | "update" | "end";
|
||||
type: "new" | "update" | "end" | "genai";
|
||||
before: ReviewSegment;
|
||||
after: ReviewSegment;
|
||||
}
|
||||
|
||||
@ -111,6 +111,7 @@ import { Trans, useTranslation } from "react-i18next";
|
||||
import { useDocDomain } from "@/hooks/use-doc-domain";
|
||||
import PtzControlPanel from "@/components/overlay/PtzControlPanel";
|
||||
import ObjectSettingsView from "../settings/ObjectSettingsView";
|
||||
import { useSearchEffect } from "@/hooks/use-overlay-state";
|
||||
|
||||
type LiveCameraViewProps = {
|
||||
config?: FrigateConfig;
|
||||
@ -274,6 +275,14 @@ export default function LiveCameraView({
|
||||
const [showStats, setShowStats] = useState(false);
|
||||
const [debug, setDebug] = useState(false);
|
||||
|
||||
useSearchEffect("debug", (value: string) => {
|
||||
if (value === "true") {
|
||||
setDebug(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
const [fullResolution, setFullResolution] = useState<VideoResolutionType>({
|
||||
width: 0,
|
||||
height: 0,
|
||||
|
||||
@ -114,7 +114,11 @@ export default function LiveDashboardView({
|
||||
|
||||
// if event is ended and was saved, update events list
|
||||
if (eventUpdate.after.severity == "alert") {
|
||||
if (eventUpdate.type == "end" || eventUpdate.type == "new") {
|
||||
if (
|
||||
eventUpdate.type == "end" ||
|
||||
eventUpdate.type == "new" ||
|
||||
eventUpdate.type == "genai"
|
||||
) {
|
||||
setTimeout(
|
||||
() => updateEvents(),
|
||||
eventUpdate.type == "end" ? 1000 : 6000,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user