mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-10 02:29:19 +03:00
Miscellaneous Fixes (0.17 beta) (#21912)
Some checks are pending
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
Some checks are pending
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
* fix display of custom sublabels in review item chip use "manual" as type so it's not run through translation and normalized, producing "Josh S Car" instead of "Josh's Car" * use css instead of js for reviewed button hover state in filmstrip
This commit is contained in:
parent
41b983a133
commit
ea1533f456
@ -12,7 +12,7 @@ import { useCameraPreviews } from "@/hooks/use-camera-previews";
|
|||||||
import { baseUrl } from "@/api/baseUrl";
|
import { baseUrl } from "@/api/baseUrl";
|
||||||
import { VideoPreview } from "../preview/ScrubbablePreview";
|
import { VideoPreview } from "../preview/ScrubbablePreview";
|
||||||
import { useApiHost } from "@/api";
|
import { useApiHost } from "@/api";
|
||||||
import { isDesktop, isSafari } from "react-device-detect";
|
import { isSafari } from "react-device-detect";
|
||||||
import { useUserPersistence } from "@/hooks/use-user-persistence";
|
import { useUserPersistence } from "@/hooks/use-user-persistence";
|
||||||
import { Skeleton } from "../ui/skeleton";
|
import { Skeleton } from "../ui/skeleton";
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
@ -87,7 +87,6 @@ export function AnimatedEventCard({
|
|||||||
}, [visibilityListener]);
|
}, [visibilityListener]);
|
||||||
|
|
||||||
const [isLoaded, setIsLoaded] = useState(false);
|
const [isLoaded, setIsLoaded] = useState(false);
|
||||||
const [isHovered, setIsHovered] = useState(false);
|
|
||||||
|
|
||||||
// interaction
|
// interaction
|
||||||
|
|
||||||
@ -134,31 +133,27 @@ export function AnimatedEventCard({
|
|||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<div
|
<div
|
||||||
className="relative h-24 flex-shrink-0 overflow-hidden rounded md:rounded-lg 4k:h-32"
|
className="group relative h-24 flex-shrink-0 overflow-hidden rounded md:rounded-lg 4k:h-32"
|
||||||
style={{
|
style={{
|
||||||
aspectRatio: alertVideos ? aspectRatio : undefined,
|
aspectRatio: alertVideos ? aspectRatio : undefined,
|
||||||
}}
|
}}
|
||||||
onMouseEnter={isDesktop ? () => setIsHovered(true) : undefined}
|
|
||||||
onMouseLeave={isDesktop ? () => setIsHovered(false) : undefined}
|
|
||||||
>
|
>
|
||||||
{isHovered && (
|
<Tooltip>
|
||||||
<Tooltip>
|
<TooltipTrigger asChild>
|
||||||
<TooltipTrigger asChild>
|
<Button
|
||||||
<Button
|
className="pointer-events-none absolute left-2 top-1 z-40 bg-gray-500 bg-gradient-to-br from-gray-400 to-gray-500 opacity-0 transition-opacity group-hover:pointer-events-auto group-hover:opacity-100"
|
||||||
className="absolute left-2 top-1 z-40 bg-gray-500 bg-gradient-to-br from-gray-400 to-gray-500"
|
size="xs"
|
||||||
size="xs"
|
aria-label={t("markAsReviewed")}
|
||||||
aria-label={t("markAsReviewed")}
|
onClick={async () => {
|
||||||
onClick={async () => {
|
await axios.post(`reviews/viewed`, { ids: [event.id] });
|
||||||
await axios.post(`reviews/viewed`, { ids: [event.id] });
|
updateEvents();
|
||||||
updateEvents();
|
}}
|
||||||
}}
|
>
|
||||||
>
|
<FaCircleCheck className="size-3 text-white" />
|
||||||
<FaCircleCheck className="size-3 text-white" />
|
</Button>
|
||||||
</Button>
|
</TooltipTrigger>
|
||||||
</TooltipTrigger>
|
<TooltipContent>{t("markAsReviewed")}</TooltipContent>
|
||||||
<TooltipContent>{t("markAsReviewed")}</TooltipContent>
|
</Tooltip>
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
{previews != undefined && alertVideosLoaded && (
|
{previews != undefined && alertVideosLoaded && (
|
||||||
<div
|
<div
|
||||||
className="size-full cursor-pointer"
|
className="size-full cursor-pointer"
|
||||||
|
|||||||
@ -181,6 +181,13 @@ export default function PreviewThumbnailPlayer({
|
|||||||
config?.ui?.timezone,
|
config?.ui?.timezone,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const getEventType = (text: string) => {
|
||||||
|
if (review.data.objects.includes(text)) return "object";
|
||||||
|
if (review.data.audio.includes(text)) return "audio";
|
||||||
|
if (review.data.sub_labels?.includes(text)) return "manual";
|
||||||
|
return "object";
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="relative size-full cursor-pointer"
|
className="relative size-full cursor-pointer"
|
||||||
@ -295,7 +302,7 @@ export default function PreviewThumbnailPlayer({
|
|||||||
(item) =>
|
(item) =>
|
||||||
item !== undefined && !item.includes("-verified"),
|
item !== undefined && !item.includes("-verified"),
|
||||||
)
|
)
|
||||||
.map((text) => getTranslatedLabel(text))
|
.map((text) => getTranslatedLabel(text, getEventType(text)))
|
||||||
.sort()
|
.sort()
|
||||||
.join(", ")}
|
.join(", ")}
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user