Compare commits

..

1 Commits

Author SHA1 Message Date
Josh Hawkins
6d50ef2063
Merge ec5f191187 into 0a8f499640 2026-01-18 17:38:43 +00:00
3 changed files with 12 additions and 35 deletions

View File

@ -181,16 +181,6 @@
"restricted": {
"title": "No Cameras Available",
"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"
}
}
}

View File

@ -35,9 +35,7 @@ export function EmptyCard({
{icon}
{TitleComponent}
{description && (
<div className="mb-3 text-center text-secondary-foreground">
{description}
</div>
<div className="mb-3 text-secondary-foreground">{description}</div>
)}
{buttonText?.length && (
<Button size="sm" variant="select">

View File

@ -447,7 +447,7 @@ export default function LiveDashboardView({
)}
{cameras.length == 0 && !includeBirdseye ? (
<NoCameraView cameraGroup={cameraGroup} />
<NoCameraView />
) : (
<>
{!fullscreen && events && events.length > 0 && (
@ -666,39 +666,28 @@ export default function LiveDashboardView({
);
}
function NoCameraView({ cameraGroup }: { cameraGroup?: string }) {
function NoCameraView() {
const { t } = useTranslation(["views/live"]);
const { auth } = useContext(AuthContext);
const isAdmin = useIsAdmin();
const isDefault = cameraGroup === "default";
// Check if this is a restricted user with no cameras in this group
const isRestricted = !isAdmin && auth.isAuthenticated;
let type: "default" | "group" | "restricted";
if (isRestricted) {
type = "restricted";
} else if (isDefault) {
type = "default";
} else {
type = "group";
}
return (
<div className="flex size-full items-center justify-center">
<EmptyCard
icon={<BsFillCameraVideoOffFill className="size-8" />}
title={t(`noCameras.${type}.title`)}
description={t(`noCameras.${type}.description`)}
buttonText={
type !== "restricted" && isDefault
? t(`noCameras.${type}.buttonText`)
: undefined
title={
isRestricted ? t("noCameras.restricted.title") : t("noCameras.title")
}
link={
type !== "restricted" && isDefault
? "/settings?page=cameraManagement"
: undefined
description={
isRestricted
? t("noCameras.restricted.description")
: t("noCameras.description")
}
buttonText={!isRestricted ? t("noCameras.buttonText") : undefined}
link={!isRestricted ? "/settings?page=cameraManagement" : undefined}
/>
</div>
);