mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-22 20:18:30 +03:00
Compare commits
2 Commits
6d50ef2063
...
49c5f71632
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49c5f71632 | ||
|
|
72eb0352ad |
@ -181,6 +181,16 @@
|
|||||||
"restricted": {
|
"restricted": {
|
||||||
"title": "No Cameras Available",
|
"title": "No Cameras Available",
|
||||||
"description": "You don't have permission to view any cameras in this group."
|
"description": "You don't have permission to view any cameras in this group."
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"title": "No Cameras Configured",
|
||||||
|
"description": "Get started by connecting a camera to Frigate.",
|
||||||
|
"buttonText": "Add Camera"
|
||||||
|
},
|
||||||
|
"group": {
|
||||||
|
"title": "No Cameras in Group",
|
||||||
|
"description": "This camera group has no assigned or enabled cameras.",
|
||||||
|
"buttonText": "Manage Groups"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,9 @@ export function EmptyCard({
|
|||||||
{icon}
|
{icon}
|
||||||
{TitleComponent}
|
{TitleComponent}
|
||||||
{description && (
|
{description && (
|
||||||
<div className="mb-3 text-secondary-foreground">{description}</div>
|
<div className="mb-3 text-center text-secondary-foreground">
|
||||||
|
{description}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
{buttonText?.length && (
|
{buttonText?.length && (
|
||||||
<Button size="sm" variant="select">
|
<Button size="sm" variant="select">
|
||||||
|
|||||||
@ -447,7 +447,7 @@ export default function LiveDashboardView({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{cameras.length == 0 && !includeBirdseye ? (
|
{cameras.length == 0 && !includeBirdseye ? (
|
||||||
<NoCameraView />
|
<NoCameraView cameraGroup={cameraGroup} />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{!fullscreen && events && events.length > 0 && (
|
{!fullscreen && events && events.length > 0 && (
|
||||||
@ -666,28 +666,39 @@ export default function LiveDashboardView({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function NoCameraView() {
|
function NoCameraView({ cameraGroup }: { cameraGroup?: string }) {
|
||||||
const { t } = useTranslation(["views/live"]);
|
const { t } = useTranslation(["views/live"]);
|
||||||
const { auth } = useContext(AuthContext);
|
const { auth } = useContext(AuthContext);
|
||||||
const isAdmin = useIsAdmin();
|
const isAdmin = useIsAdmin();
|
||||||
|
|
||||||
// Check if this is a restricted user with no cameras in this group
|
const isDefault = cameraGroup === "default";
|
||||||
const isRestricted = !isAdmin && auth.isAuthenticated;
|
const isRestricted = !isAdmin && auth.isAuthenticated;
|
||||||
|
|
||||||
|
let type: "default" | "group" | "restricted";
|
||||||
|
if (isRestricted) {
|
||||||
|
type = "restricted";
|
||||||
|
} else if (isDefault) {
|
||||||
|
type = "default";
|
||||||
|
} else {
|
||||||
|
type = "group";
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex size-full items-center justify-center">
|
<div className="flex size-full items-center justify-center">
|
||||||
<EmptyCard
|
<EmptyCard
|
||||||
icon={<BsFillCameraVideoOffFill className="size-8" />}
|
icon={<BsFillCameraVideoOffFill className="size-8" />}
|
||||||
title={
|
title={t(`noCameras.${type}.title`)}
|
||||||
isRestricted ? t("noCameras.restricted.title") : t("noCameras.title")
|
description={t(`noCameras.${type}.description`)}
|
||||||
|
buttonText={
|
||||||
|
type !== "restricted" && isDefault
|
||||||
|
? t(`noCameras.${type}.buttonText`)
|
||||||
|
: undefined
|
||||||
}
|
}
|
||||||
description={
|
link={
|
||||||
isRestricted
|
type !== "restricted" && isDefault
|
||||||
? t("noCameras.restricted.description")
|
? "/settings?page=cameraManagement"
|
||||||
: t("noCameras.description")
|
: undefined
|
||||||
}
|
}
|
||||||
buttonText={!isRestricted ? t("noCameras.buttonText") : undefined}
|
|
||||||
link={!isRestricted ? "/settings?page=cameraManagement" : undefined}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user