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