Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add page titles for settings views #11132

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions web/src/components/settings/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ import {
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import { useEffect } from "react";

export default function General() {
useEffect(() => {
document.title = "General Settings - Frigate";
}, []);

return (
<>
<Heading as="h2">Settings</Heading>
Expand Down
5 changes: 5 additions & 0 deletions web/src/components/settings/MasksAndZones.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export default function MasksAndZones({
setActivePolygonIndex(undefined);
setHoveredPolygonIndex(null);
setUnsavedChanges(false);
document.title = "Mask and Zone Editor - Frigate";
}, [allPolygons, setUnsavedChanges]);

const handleSave = useCallback(() => {
Expand Down Expand Up @@ -353,6 +354,10 @@ export default function MasksAndZones({
}
}, [selectedCamera]);

useEffect(() => {
document.title = "Mask and Zone Editor - Frigate";
}, []);

if (!cameraConfig && !selectedCamera) {
return <ActivityIndicator />;
}
Expand Down
6 changes: 5 additions & 1 deletion web/src/components/settings/MotionMaskEditPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Heading from "../ui/heading";
import { Separator } from "../ui/separator";
import { Button } from "@/components/ui/button";
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 { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down Expand Up @@ -173,6 +173,10 @@ export default function MotionMaskEditPane({
}
}

useEffect(() => {
document.title = "Edit Motion Mask - Frigate";
}, []);

if (!polygon) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions web/src/components/settings/MotionTuner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ export default function MotionTuner({
}
}, [changedValue, addMessage, clearMessages]);

useEffect(() => {
document.title = "Motion Tuner - Frigate";
}, []);

if (!cameraConfig && !selectedCamera) {
return <ActivityIndicator />;
}
Expand Down
6 changes: 5 additions & 1 deletion web/src/components/settings/ObjectMaskEditPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { useCallback, useMemo } from "react";
import { useCallback, useEffect, useMemo } from "react";
import { ATTRIBUTE_LABELS, FrigateConfig } from "@/types/frigateConfig";
import useSWR from "swr";
import { zodResolver } from "@hookform/resolvers/zod";
Expand Down Expand Up @@ -235,6 +235,10 @@ export default function ObjectMaskEditPane({
}
}

useEffect(() => {
document.title = "Edit Object Mask - Frigate";
}, []);

if (!polygon) {
return;
}
Expand Down
6 changes: 5 additions & 1 deletion web/src/components/settings/ObjectSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMemo } from "react";
import { useEffect, useMemo } from "react";
import DebugCameraImage from "../camera/DebugCameraImage";
import { FrigateConfig } from "@/types/frigateConfig";
import useSWR from "swr";
Expand All @@ -19,6 +19,10 @@ export default function ObjectSettings({
}
}, [config, selectedCamera]);

useEffect(() => {
document.title = "Object Settings - Frigate";
}, []);

if (!cameraConfig) {
return <ActivityIndicator />;
}
Expand Down
4 changes: 4 additions & 0 deletions web/src/components/settings/ZoneEditPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ export default function ZoneEditPane({
}
}

useEffect(() => {
document.title = "Edit Zone - Frigate";
}, []);

if (!polygon) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions web/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export default function Settings() {
}
}, [tabsRef, pageToggle]);

useEffect(() => {
document.title = "Settings - Frigate";
}, []);

return (
<div className="size-full p-2 flex flex-col">
<div className="w-full h-11 relative flex justify-between items-center">
Expand Down
Loading