mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-30 13:48:07 +02:00
Fix face library menu item (#17155)
This commit is contained in:
parent
5d524e8060
commit
19342c8768
@ -56,6 +56,7 @@ import { useIsAdmin } from "@/hooks/use-is-admin";
|
|||||||
import SetPasswordDialog from "../overlay/SetPasswordDialog";
|
import SetPasswordDialog from "../overlay/SetPasswordDialog";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
|
|
||||||
type GeneralSettingsProps = {
|
type GeneralSettingsProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -63,7 +64,7 @@ type GeneralSettingsProps = {
|
|||||||
|
|
||||||
export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
||||||
const { data: profile } = useSWR("profile");
|
const { data: profile } = useSWR("profile");
|
||||||
const { data: config } = useSWR("config");
|
const { data: config } = useSWR<FrigateConfig>("config");
|
||||||
const logoutUrl = config?.proxy?.logout_url || "/api/logout";
|
const logoutUrl = config?.proxy?.logout_url || "/api/logout";
|
||||||
|
|
||||||
const { theme, colorScheme, setTheme, setColorScheme } = useTheme();
|
const { theme, colorScheme, setTheme, setColorScheme } = useTheme();
|
||||||
@ -255,7 +256,7 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
|||||||
</Link>
|
</Link>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{isAdmin && isMobile && (
|
{isAdmin && isMobile && config?.face_recognition.enabled && (
|
||||||
<>
|
<>
|
||||||
<Link to="/faces">
|
<Link to="/faces">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
@ -263,7 +264,7 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
|||||||
aria-label="Face Library"
|
aria-label="Face Library"
|
||||||
>
|
>
|
||||||
<LuSquarePen className="mr-2 size-4" />
|
<LuSquarePen className="mr-2 size-4" />
|
||||||
<span>Configuration editor</span>
|
<span>Face Library</span>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Link>
|
</Link>
|
||||||
</>
|
</>
|
||||||
|
@ -435,6 +435,10 @@ export interface FrigateConfig {
|
|||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
proxy: {
|
||||||
|
logout_url?: string;
|
||||||
|
};
|
||||||
|
|
||||||
record: {
|
record: {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
enabled_in_config: boolean | null;
|
enabled_in_config: boolean | null;
|
||||||
|
Loading…
Reference in New Issue
Block a user