mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-23 08:38:22 +03:00
feat(settings): add toggle for displaying camera names in multi-camera views
This commit is contained in:
parent
61f927c941
commit
2fa7a5a7b2
@ -43,4 +43,3 @@ class UIConfig(FrigateBaseModel):
|
|||||||
unit_system: UnitSystemEnum = Field(
|
unit_system: UnitSystemEnum = Field(
|
||||||
default=UnitSystemEnum.metric, title="The unit system to use for measurements."
|
default=UnitSystemEnum.metric, title="The unit system to use for measurements."
|
||||||
)
|
)
|
||||||
show_camera_names: Optional[bool] = Field(default=False, title="Show camera name")
|
|
||||||
|
|||||||
@ -18,9 +18,6 @@
|
|||||||
},
|
},
|
||||||
"unit_system": {
|
"unit_system": {
|
||||||
"label": "The unit system to use for measurements."
|
"label": "The unit system to use for measurements."
|
||||||
},
|
|
||||||
"show_camera_names": {
|
|
||||||
"label": "Show the camera name in the player"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,6 +47,10 @@
|
|||||||
"playAlertVideos": {
|
"playAlertVideos": {
|
||||||
"label": "Play Alert Videos",
|
"label": "Play Alert Videos",
|
||||||
"desc": "By default, recent alerts on the Live dashboard play as small looping videos. Disable this option to only show a static image of recent alerts on this device/browser."
|
"desc": "By default, recent alerts on the Live dashboard play as small looping videos. Disable this option to only show a static image of recent alerts on this device/browser."
|
||||||
|
},
|
||||||
|
"displayCameraNames": {
|
||||||
|
"label": "Display Camera Names",
|
||||||
|
"desc": "Displays the camera name in the top-right corner at all times, not just when offline or disabled. Useful for quick identification in multi-camera views."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"storedLayouts": {
|
"storedLayouts": {
|
||||||
|
|||||||
@ -440,11 +440,7 @@ export default function LivePlayer({
|
|||||||
(offline && showStillWithoutActivity) ||
|
(offline && showStillWithoutActivity) ||
|
||||||
!cameraEnabled) && (
|
!cameraEnabled) && (
|
||||||
<Chip
|
<Chip
|
||||||
className={`z-0 flex items-start justify-between space-x-1 text-xs capitalize ${
|
className={`z-0 flex items-start justify-between space-x-1 bg-gray-500 bg-gradient-to-br from-gray-400 to-gray-500 text-xs capitalize`}
|
||||||
(offline && showStillWithoutActivity) || !cameraEnabled
|
|
||||||
? "bg-red-500 bg-gradient-to-br from-red-400 to-red-500"
|
|
||||||
: "bg-gray-500 bg-gradient-to-br from-gray-400 to-gray-500"
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
{cameraName}
|
{cameraName}
|
||||||
</Chip>
|
</Chip>
|
||||||
|
|||||||
@ -10,7 +10,6 @@ export interface UiConfig {
|
|||||||
dashboard: boolean;
|
dashboard: boolean;
|
||||||
order: number;
|
order: number;
|
||||||
unit_system?: "metric" | "imperial";
|
unit_system?: "metric" | "imperial";
|
||||||
show_camera_names?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BirdseyeConfig {
|
export interface BirdseyeConfig {
|
||||||
|
|||||||
@ -95,6 +95,7 @@ export default function DraggableGridLayout({
|
|||||||
} = useCameraLiveMode(cameras, windowVisible);
|
} = useCameraLiveMode(cameras, windowVisible);
|
||||||
|
|
||||||
const [globalAutoLive] = usePersistence("autoLiveView", true);
|
const [globalAutoLive] = usePersistence("autoLiveView", true);
|
||||||
|
const [displayCameraNames] = usePersistence("displayCameraNames", false);
|
||||||
|
|
||||||
const { allGroupsStreamingSettings, setAllGroupsStreamingSettings } =
|
const { allGroupsStreamingSettings, setAllGroupsStreamingSettings } =
|
||||||
useStreamingSettings();
|
useStreamingSettings();
|
||||||
@ -610,7 +611,7 @@ export default function DraggableGridLayout({
|
|||||||
streamName={streamName}
|
streamName={streamName}
|
||||||
autoLive={autoLive ?? globalAutoLive}
|
autoLive={autoLive ?? globalAutoLive}
|
||||||
showStillWithoutActivity={showStillWithoutActivity ?? true}
|
showStillWithoutActivity={showStillWithoutActivity ?? true}
|
||||||
alwaysShowCameraName={config?.ui.show_camera_names ?? false}
|
alwaysShowCameraName={displayCameraNames}
|
||||||
useWebGL={useWebGL}
|
useWebGL={useWebGL}
|
||||||
cameraRef={cameraRef}
|
cameraRef={cameraRef}
|
||||||
className={cn(
|
className={cn(
|
||||||
|
|||||||
@ -654,7 +654,7 @@ export default function LiveCameraView({
|
|||||||
className={`${fullscreen ? "*:rounded-none" : ""}`}
|
className={`${fullscreen ? "*:rounded-none" : ""}`}
|
||||||
windowVisible
|
windowVisible
|
||||||
showStillWithoutActivity={false}
|
showStillWithoutActivity={false}
|
||||||
alwaysShowCameraName={config?.ui.show_camera_names ?? false}
|
alwaysShowCameraName={false}
|
||||||
cameraConfig={camera}
|
cameraConfig={camera}
|
||||||
playAudio={audio}
|
playAudio={audio}
|
||||||
playInBackground={playInBackground ?? false}
|
playInBackground={playInBackground ?? false}
|
||||||
|
|||||||
@ -211,6 +211,7 @@ export default function LiveDashboardView({
|
|||||||
} = useCameraLiveMode(cameras, windowVisible);
|
} = useCameraLiveMode(cameras, windowVisible);
|
||||||
|
|
||||||
const [globalAutoLive] = usePersistence("autoLiveView", true);
|
const [globalAutoLive] = usePersistence("autoLiveView", true);
|
||||||
|
const [displayCameraNames] = usePersistence("displayCameraNames", false);
|
||||||
|
|
||||||
const { allGroupsStreamingSettings, setAllGroupsStreamingSettings } =
|
const { allGroupsStreamingSettings, setAllGroupsStreamingSettings } =
|
||||||
useStreamingSettings();
|
useStreamingSettings();
|
||||||
@ -549,7 +550,7 @@ export default function LiveDashboardView({
|
|||||||
preferredLiveMode={preferredLiveModes[camera.name] ?? "mse"}
|
preferredLiveMode={preferredLiveModes[camera.name] ?? "mse"}
|
||||||
autoLive={autoLive ?? globalAutoLive}
|
autoLive={autoLive ?? globalAutoLive}
|
||||||
showStillWithoutActivity={showStillWithoutActivity ?? true}
|
showStillWithoutActivity={showStillWithoutActivity ?? true}
|
||||||
alwaysShowCameraName={config?.ui.show_camera_names ?? false}
|
alwaysShowCameraName={displayCameraNames}
|
||||||
useWebGL={useWebGL}
|
useWebGL={useWebGL}
|
||||||
playInBackground={false}
|
playInBackground={false}
|
||||||
showStats={statsStates[camera.name]}
|
showStats={statsStates[camera.name]}
|
||||||
|
|||||||
@ -92,6 +92,10 @@ export default function UiSettingsView() {
|
|||||||
// settings
|
// settings
|
||||||
|
|
||||||
const [autoLive, setAutoLive] = usePersistence("autoLiveView", true);
|
const [autoLive, setAutoLive] = usePersistence("autoLiveView", true);
|
||||||
|
const [cameraNames, setCameraName] = usePersistence(
|
||||||
|
"displayCameraNames",
|
||||||
|
false,
|
||||||
|
);
|
||||||
const [playbackRate, setPlaybackRate] = usePersistence("playbackRate", 1);
|
const [playbackRate, setPlaybackRate] = usePersistence("playbackRate", 1);
|
||||||
const [weekStartsOn, setWeekStartsOn] = usePersistence("weekStartsOn", 0);
|
const [weekStartsOn, setWeekStartsOn] = usePersistence("weekStartsOn", 0);
|
||||||
const [alertVideos, setAlertVideos] = usePersistence("alertVideos", true);
|
const [alertVideos, setAlertVideos] = usePersistence("alertVideos", true);
|
||||||
@ -142,6 +146,21 @@ export default function UiSettingsView() {
|
|||||||
<p>{t("general.liveDashboard.playAlertVideos.desc")}</p>
|
<p>{t("general.liveDashboard.playAlertVideos.desc")}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="space-y-3">
|
||||||
|
<div className="flex flex-row items-center justify-start gap-2">
|
||||||
|
<Switch
|
||||||
|
id="camera-names"
|
||||||
|
checked={cameraNames}
|
||||||
|
onCheckedChange={setCameraName}
|
||||||
|
/>
|
||||||
|
<Label className="cursor-pointer" htmlFor="auto-live">
|
||||||
|
{t("general.liveDashboard.displayCameraNames.label")}
|
||||||
|
</Label>
|
||||||
|
</div>
|
||||||
|
<div className="my-2 max-w-5xl text-sm text-muted-foreground">
|
||||||
|
<p>{t("general.liveDashboard.displayCameraNames.desc")}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="my-3 flex w-full flex-col space-y-6">
|
<div className="my-3 flex w-full flex-col space-y-6">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user