mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-06 21:45:32 +03:00
Compare commits
No commits in common. "c5fec3271f99493ee9afe5841e9fdd1c19dd498c" and "4319118e947b6ca49c9bb408d2a0b129abe78b9b" have entirely different histories.
c5fec3271f
...
4319118e94
@ -175,8 +175,8 @@
|
|||||||
"exitEdit": "Exit Editing"
|
"exitEdit": "Exit Editing"
|
||||||
},
|
},
|
||||||
"noCameras": {
|
"noCameras": {
|
||||||
"title": "No Cameras Configured",
|
"title": "No Cameras Set Up",
|
||||||
"description": "Get started by connecting a camera to Frigate.",
|
"description": "Get started by connecting a camera.",
|
||||||
"buttonText": "Add Camera"
|
"buttonText": "Add Camera"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,30 +1,27 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import Heading from "../ui/heading";
|
import Heading from "../ui/heading";
|
||||||
import { Link } from "react-router-dom";
|
|
||||||
|
|
||||||
type EmptyCardProps = {
|
type EmptyCardProps = {
|
||||||
icon: React.ReactNode;
|
icon: React.ReactNode;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
buttonText?: string;
|
buttonText?: string;
|
||||||
link?: string;
|
|
||||||
};
|
};
|
||||||
export function EmptyCard({
|
export function EmptyCard({
|
||||||
icon,
|
icon,
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
buttonText,
|
buttonText,
|
||||||
link,
|
|
||||||
}: EmptyCardProps) {
|
}: EmptyCardProps) {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center gap-2">
|
<div className="flex flex-col items-center gap-2">
|
||||||
{icon}
|
{icon}
|
||||||
<Heading as="h4">{title}</Heading>
|
<Heading as="h4">{title}</Heading>
|
||||||
<div className="mb-3 text-secondary-foreground">{description}</div>
|
<div className="text-secondary-foreground">{description}</div>
|
||||||
{buttonText?.length && (
|
{buttonText?.length && (
|
||||||
<Button size="sm" variant="select">
|
<Button size="sm" variant="select">
|
||||||
<Link to={link ?? "#"}>{buttonText}</Link>
|
{buttonText}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -150,9 +150,7 @@ export default function SearchThumbnail({
|
|||||||
.filter(
|
.filter(
|
||||||
(item) => item !== undefined && !item.includes("-verified"),
|
(item) => item !== undefined && !item.includes("-verified"),
|
||||||
)
|
)
|
||||||
.map((text) =>
|
.map((text) => getTranslatedLabel(text, searchResult.data.type))
|
||||||
getTranslatedLabel(text, searchResult.data.type),
|
|
||||||
)
|
|
||||||
.sort()
|
.sort()
|
||||||
.join(", ")
|
.join(", ")
|
||||||
.replaceAll("-verified", "")}
|
.replaceAll("-verified", "")}
|
||||||
|
|||||||
@ -152,38 +152,36 @@ export default function CameraEditForm({
|
|||||||
}))
|
}))
|
||||||
: defaultValues.ffmpeg.inputs;
|
: defaultValues.ffmpeg.inputs;
|
||||||
|
|
||||||
|
// Load go2rtc streams for this camera
|
||||||
const go2rtcStreams = config.go2rtc?.streams || {};
|
const go2rtcStreams = config.go2rtc?.streams || {};
|
||||||
const cameraStreams: Record<string, string[]> = {};
|
const cameraStreams: Record<string, string[]> = {};
|
||||||
|
|
||||||
// get candidate stream names for this camera. could be the camera's own name,
|
// Find streams that match this camera's name pattern
|
||||||
// any restream names referenced by this camera, or any keys under live --> streams
|
Object.entries(go2rtcStreams).forEach(([streamName, urls]) => {
|
||||||
const validNames = new Set<string>();
|
if (streamName.startsWith(cameraName) || streamName === cameraName) {
|
||||||
validNames.add(cameraName);
|
cameraStreams[streamName] = Array.isArray(urls) ? urls : [urls];
|
||||||
|
|
||||||
// deduce go2rtc stream names from rtsp restream inputs
|
|
||||||
camera.ffmpeg?.inputs?.forEach((input) => {
|
|
||||||
// exclude any query strings or trailing slashes from the stream name
|
|
||||||
const restreamMatch = input.path.match(
|
|
||||||
/^rtsp:\/\/127\.0\.0\.1:8554\/([^?#/]+)(?:[?#].*)?$/,
|
|
||||||
);
|
|
||||||
if (restreamMatch) {
|
|
||||||
const streamName = restreamMatch[1];
|
|
||||||
validNames.add(streamName);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Include live --> streams keys
|
// Also deduce go2rtc streams from restream URLs in camera inputs
|
||||||
const liveStreams = camera?.live?.streams;
|
camera.ffmpeg?.inputs?.forEach((input, index) => {
|
||||||
if (liveStreams) {
|
const restreamMatch = input.path.match(
|
||||||
Object.keys(liveStreams).forEach((key) => {
|
/^rtsp:\/\/127\.0\.0\.1:8554\/(.+)$/,
|
||||||
validNames.add(key);
|
);
|
||||||
});
|
if (restreamMatch) {
|
||||||
}
|
const streamName = restreamMatch[1];
|
||||||
|
// Find the corresponding go2rtc stream
|
||||||
// Map only go2rtc entries that match the collected names
|
const go2rtcStream = Object.entries(go2rtcStreams).find(
|
||||||
Object.entries(go2rtcStreams).forEach(([name, urls]) => {
|
([name]) =>
|
||||||
if (validNames.has(name)) {
|
name === streamName ||
|
||||||
cameraStreams[name] = Array.isArray(urls) ? urls : [urls];
|
name === `${cameraName}_${index + 1}` ||
|
||||||
|
name === cameraName,
|
||||||
|
);
|
||||||
|
if (go2rtcStream) {
|
||||||
|
cameraStreams[go2rtcStream[0]] = Array.isArray(go2rtcStream[1])
|
||||||
|
? go2rtcStream[1]
|
||||||
|
: [go2rtcStream[1]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -354,7 +354,7 @@ export default function LiveDashboardView({
|
|||||||
onSaveMuting(true);
|
onSaveMuting(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (cameras.length == 0 && !includeBirdseye) {
|
if (cameras.length == 0) {
|
||||||
return <NoCameraView />;
|
return <NoCameraView />;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -625,7 +625,6 @@ function NoCameraView() {
|
|||||||
title={t("noCameras.title")}
|
title={t("noCameras.title")}
|
||||||
description={t("noCameras.description")}
|
description={t("noCameras.description")}
|
||||||
buttonText={t("noCameras.buttonText")}
|
buttonText={t("noCameras.buttonText")}
|
||||||
link="/settings?page=cameraManagement"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user