mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Add option to hide "debug" information.
This commit is contained in:
parent
f2030d301f
commit
69def58321
@ -46,6 +46,9 @@ class DetectorConfig(FrigateBaseModel):
|
|||||||
|
|
||||||
class UIConfig(FrigateBaseModel):
|
class UIConfig(FrigateBaseModel):
|
||||||
use_experimental: bool = Field(default=False, title="Experimental UI")
|
use_experimental: bool = Field(default=False, title="Experimental UI")
|
||||||
|
hide_configuration_options: bool = Field(
|
||||||
|
default=False, title="Hide UI components used for configuring Frigate"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class MqttConfig(FrigateBaseModel):
|
class MqttConfig(FrigateBaseModel):
|
||||||
|
|||||||
@ -23,7 +23,8 @@ export default function Sidebar() {
|
|||||||
if (!config) {
|
if (!config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const { birdseye } = config;
|
const { birdseye, ui } = config;
|
||||||
|
const hideConfigurationOptions = ui?.hide_configuration_options;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NavigationDrawer header={<Header />}>
|
<NavigationDrawer header={<Header />}>
|
||||||
@ -44,7 +45,7 @@ export default function Sidebar() {
|
|||||||
</Match>
|
</Match>
|
||||||
{birdseye?.enabled ? <Destination href="/birdseye" text="Birdseye" /> : null}
|
{birdseye?.enabled ? <Destination href="/birdseye" text="Birdseye" /> : null}
|
||||||
<Destination href="/events" text="Events" />
|
<Destination href="/events" text="Events" />
|
||||||
<Destination href="/debug" text="Debug" />
|
{ hideConfigurationOptions ? null : <Destination href="/debug" text="Debug" /> }
|
||||||
<Separator />
|
<Separator />
|
||||||
<div className="flex flex-grow" />
|
<div className="flex flex-grow" />
|
||||||
{ENV !== 'production' ? (
|
{ENV !== 'production' ? (
|
||||||
|
|||||||
@ -14,6 +14,9 @@ export function Tabs({ children, selectedIndex: selectedIndexProp, onChange, cla
|
|||||||
|
|
||||||
const RenderChildren = useCallback(() => {
|
const RenderChildren = useCallback(() => {
|
||||||
return children.map((child, i) => {
|
return children.map((child, i) => {
|
||||||
|
if (!child) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
child.props.selected = i === selectedIndex;
|
child.props.selected = i === selectedIndex;
|
||||||
child.props.onClick = handleSelected(i);
|
child.props.onClick = handleSelected(i);
|
||||||
return child;
|
return child;
|
||||||
|
|||||||
@ -14,6 +14,7 @@ export default function Camera({ camera }) {
|
|||||||
const [playerType, setPlayerType] = useState('live');
|
const [playerType, setPlayerType] = useState('live');
|
||||||
|
|
||||||
const cameraConfig = config?.cameras[camera];
|
const cameraConfig = config?.cameras[camera];
|
||||||
|
const hideConfigurationOptions = config?.ui?.hide_configuration_options;
|
||||||
|
|
||||||
const handleTabChange = (index) => {
|
const handleTabChange = (index) => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
@ -49,7 +50,7 @@ export default function Camera({ camera }) {
|
|||||||
<Tabs selectedIndex={1} onChange={handleTabChange} className='justify'>
|
<Tabs selectedIndex={1} onChange={handleTabChange} className='justify'>
|
||||||
<TextTab text='History' />
|
<TextTab text='History' />
|
||||||
<TextTab text='Live' />
|
<TextTab text='Live' />
|
||||||
<TextTab text='Debug' />
|
{hideConfigurationOptions ? null : <TextTab text="Debug"/>}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user