Link live recordings (#10799)

* Add button to link to recordings from camera live view

* Change name and show text on both

* Use history button next to back button

* Match designs better
This commit is contained in:
Nicolas Mowen 2024-04-02 13:25:02 -06:00 committed by GitHub
parent d1082ec305
commit 759ad427d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 56 additions and 26 deletions

View File

@ -42,7 +42,9 @@ export default function CameraFeatureToggle({
variants[variant][isActive ? "active" : "inactive"]
}`}
>
<Icon className="size-5 md:m-[6px]" />
<Icon
className={`size-5 md:m-[6px] ${isActive ? "text-white" : "text-secondary-foreground"}`}
/>
</div>
);

View File

@ -329,20 +329,22 @@ export default function Events() {
return <ActivityIndicator />;
}
if (selectedReviewData) {
return (
<RecordingView
startCamera={selectedReviewData.camera}
startTime={selectedReviewData.start_time}
allCameras={selectedReviewData.allCameras}
reviewItems={reviews}
reviewSummary={reviewSummary}
allPreviews={allPreviews}
timeRange={selectedTimeRange}
filter={reviewFilter}
updateFilter={onUpdateFilter}
/>
);
if (recording) {
if (selectedReviewData) {
return (
<RecordingView
startCamera={selectedReviewData.camera}
startTime={selectedReviewData.start_time}
allCameras={selectedReviewData.allCameras}
reviewItems={reviews}
reviewSummary={reviewSummary}
allPreviews={allPreviews}
timeRange={selectedTimeRange}
filter={reviewFilter}
updateFilter={onUpdateFilter}
/>
);
}
} else {
return (
<EventView

View File

@ -251,6 +251,7 @@ export function RecordingView({
<Button
className="flex items-center gap-2 rounded-lg"
size="sm"
variant="secondary"
onClick={() => navigate(-1)}
>
<IoMdArrowRoundBack className="size-5" size="small" />

View File

@ -22,6 +22,7 @@ import { useResizeObserver } from "@/hooks/resize-observer";
import useKeyboardListener from "@/hooks/use-keyboard-listener";
import { CameraConfig } from "@/types/frigateConfig";
import { CameraPtzInfo } from "@/types/ptz";
import { RecordingStartingPoint } from "@/types/record";
import React, {
useCallback,
useEffect,
@ -50,10 +51,11 @@ import {
} from "react-icons/fa";
import { GiSpeaker, GiSpeakerOff } from "react-icons/gi";
import { HiViewfinderCircle } from "react-icons/hi2";
import { IoMdArrowBack } from "react-icons/io";
import { IoMdArrowRoundBack } from "react-icons/io";
import {
LuEar,
LuEarOff,
LuHistory,
LuPictureInPicture,
LuVideo,
LuVideoOff,
@ -218,14 +220,37 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
}
>
{!fullscreen ? (
<Button
className={`rounded-lg ${isMobile ? "ml-2" : "ml-0"}`}
size={isMobile ? "icon" : "sm"}
onClick={() => navigate(-1)}
>
<IoMdArrowBack className="size-5 lg:mr-[10px]" />
{isDesktop && "Back"}
</Button>
<div className="flex items-center gap-2">
<Button
className={`flex items-center gap-2.5 rounded-lg`}
size="sm"
variant="secondary"
onClick={() => navigate(-1)}
>
<IoMdArrowRoundBack className="size-5" />
{isDesktop && "Back"}
</Button>
<Button
className="flex items-center gap-2.5 rounded-lg"
size="sm"
variant="secondary"
onClick={() => {
navigate("events", {
state: {
severity: "alert",
recording: {
camera: camera.name,
startTime: Date.now() / 1000 - 30,
severity: "alert",
} as RecordingStartingPoint,
},
});
}}
>
<LuHistory className="size-5" />
{isDesktop && "History"}
</Button>
</div>
) : (
<div />
)}

View File

@ -27,8 +27,8 @@
--secondary: hsl(0, 0%, 96%);
--secondary: 0 0% 96%;
--secondary-foreground: hsl(0, 0%, 45%);
--secondary-foreground: 0 0% 45%;
--secondary-foreground: hsl(0, 0%, 32%);
--secondary-foreground: 0 0% 32%;
--secondary-highlight: hsl(0, 0%, 94%);
--secondary-highlight: 0 0% 94%;