add page titles for settings views (#11132)

This commit is contained in:
Josh Hawkins 2024-04-27 12:02:01 -05:00 committed by GitHub
parent cc851555e4
commit 3348af1e6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 37 additions and 3 deletions

View File

@ -10,8 +10,13 @@ import {
SelectValue, SelectValue,
} from "@/components/ui/select"; } from "@/components/ui/select";
import { Switch } from "@/components/ui/switch"; import { Switch } from "@/components/ui/switch";
import { useEffect } from "react";
export default function General() { export default function General() {
useEffect(() => {
document.title = "General Settings - Frigate";
}, []);
return ( return (
<> <>
<Heading as="h2">Settings</Heading> <Heading as="h2">Settings</Heading>

View File

@ -171,6 +171,7 @@ export default function MasksAndZones({
setActivePolygonIndex(undefined); setActivePolygonIndex(undefined);
setHoveredPolygonIndex(null); setHoveredPolygonIndex(null);
setUnsavedChanges(false); setUnsavedChanges(false);
document.title = "Mask and Zone Editor - Frigate";
}, [allPolygons, setUnsavedChanges]); }, [allPolygons, setUnsavedChanges]);
const handleSave = useCallback(() => { const handleSave = useCallback(() => {
@ -353,6 +354,10 @@ export default function MasksAndZones({
} }
}, [selectedCamera]); }, [selectedCamera]);
useEffect(() => {
document.title = "Mask and Zone Editor - Frigate";
}, []);
if (!cameraConfig && !selectedCamera) { if (!cameraConfig && !selectedCamera) {
return <ActivityIndicator />; return <ActivityIndicator />;
} }

View File

@ -2,7 +2,7 @@ import Heading from "../ui/heading";
import { Separator } from "../ui/separator"; import { Separator } from "../ui/separator";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Form, FormField, FormItem, FormMessage } from "@/components/ui/form"; import { Form, FormField, FormItem, FormMessage } from "@/components/ui/form";
import { useCallback, useMemo } from "react"; import { useCallback, useEffect, useMemo } from "react";
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { z } from "zod"; import { z } from "zod";
@ -173,6 +173,10 @@ export default function MotionMaskEditPane({
} }
} }
useEffect(() => {
document.title = "Edit Motion Mask - Frigate";
}, []);
if (!polygon) { if (!polygon) {
return; return;
} }

View File

@ -159,6 +159,10 @@ export default function MotionTuner({
} }
}, [changedValue, addMessage, clearMessages]); }, [changedValue, addMessage, clearMessages]);
useEffect(() => {
document.title = "Motion Tuner - Frigate";
}, []);
if (!cameraConfig && !selectedCamera) { if (!cameraConfig && !selectedCamera) {
return <ActivityIndicator />; return <ActivityIndicator />;
} }

View File

@ -19,7 +19,7 @@ import {
FormLabel, FormLabel,
FormMessage, FormMessage,
} from "@/components/ui/form"; } from "@/components/ui/form";
import { useCallback, useMemo } from "react"; import { useCallback, useEffect, useMemo } from "react";
import { ATTRIBUTE_LABELS, FrigateConfig } from "@/types/frigateConfig"; import { ATTRIBUTE_LABELS, FrigateConfig } from "@/types/frigateConfig";
import useSWR from "swr"; import useSWR from "swr";
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
@ -235,6 +235,10 @@ export default function ObjectMaskEditPane({
} }
} }
useEffect(() => {
document.title = "Edit Object Mask - Frigate";
}, []);
if (!polygon) { if (!polygon) {
return; return;
} }

View File

@ -1,4 +1,4 @@
import { useMemo } from "react"; import { useEffect, useMemo } from "react";
import DebugCameraImage from "../camera/DebugCameraImage"; import DebugCameraImage from "../camera/DebugCameraImage";
import { FrigateConfig } from "@/types/frigateConfig"; import { FrigateConfig } from "@/types/frigateConfig";
import useSWR from "swr"; import useSWR from "swr";
@ -19,6 +19,10 @@ export default function ObjectSettings({
} }
}, [config, selectedCamera]); }, [config, selectedCamera]);
useEffect(() => {
document.title = "Object Settings - Frigate";
}, []);
if (!cameraConfig) { if (!cameraConfig) {
return <ActivityIndicator />; return <ActivityIndicator />;
} }

View File

@ -308,6 +308,10 @@ export default function ZoneEditPane({
} }
} }
useEffect(() => {
document.title = "Edit Zone - Frigate";
}, []);
if (!polygon) { if (!polygon) {
return; return;
} }

View File

@ -100,6 +100,10 @@ export default function Settings() {
} }
}, [tabsRef, pageToggle]); }, [tabsRef, pageToggle]);
useEffect(() => {
document.title = "Settings - Frigate";
}, []);
return ( return (
<div className="size-full p-2 flex flex-col"> <div className="size-full p-2 flex flex-col">
<div className="w-full h-11 relative flex justify-between items-center"> <div className="w-full h-11 relative flex justify-between items-center">