show/hide camera dash buttons in config

This commit is contained in:
spacebares 2023-06-23 11:35:51 -04:00
parent 9e531b0b5b
commit 6edb4bcfb2
2 changed files with 7 additions and 1 deletions

View File

@ -596,6 +596,10 @@ class CameraUiConfig(FrigateBaseModel):
dashboard: bool = Field( dashboard: bool = Field(
default=True, title="Show this camera in Frigate dashboard UI." default=True, title="Show this camera in Frigate dashboard UI."
) )
hidecambuttons: bool = Field(
default=False,
title="Hides this camera's Detect/Recordings/Snapshots toggle buttons in Frigate dashboard UI.",
)
class CameraConfig(FrigateBaseModel): class CameraConfig(FrigateBaseModel):

View File

@ -54,7 +54,9 @@ function Camera({ name, config }) {
() => { return `${name.replaceAll('_', ' ')}` }, () => { return `${name.replaceAll('_', ' ')}` },
[name] [name]
); );
const icons = useMemo(
const hideIcons = config.ui.hidecambuttons;
const icons = hideIcons ? [] : useMemo(
() => [ () => [
{ {
name: `Toggle detect ${detectValue === 'ON' ? 'off' : 'on'}`, name: `Toggle detect ${detectValue === 'ON' ? 'off' : 'on'}`,