Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link live recordings #10799

Merged
merged 4 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web/src/components/dynamic/CameraFeatureToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);

Expand Down
30 changes: 16 additions & 14 deletions web/src/pages/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions web/src/views/events/RecordingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
43 changes: 34 additions & 9 deletions web/src/views/live/LiveCameraView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 />
)}
Expand Down
4 changes: 2 additions & 2 deletions web/themes/theme-default.css
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
Expand Down
Loading