mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25: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):
|
||||
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):
|
||||
|
||||
@ -23,7 +23,8 @@ export default function Sidebar() {
|
||||
if (!config) {
|
||||
return null;
|
||||
}
|
||||
const { birdseye } = config;
|
||||
const { birdseye, ui } = config;
|
||||
const hideConfigurationOptions = ui?.hide_configuration_options;
|
||||
|
||||
return (
|
||||
<NavigationDrawer header={<Header />}>
|
||||
@ -44,7 +45,7 @@ export default function Sidebar() {
|
||||
</Match>
|
||||
{birdseye?.enabled ? <Destination href="/birdseye" text="Birdseye" /> : null}
|
||||
<Destination href="/events" text="Events" />
|
||||
<Destination href="/debug" text="Debug" />
|
||||
{ hideConfigurationOptions ? null : <Destination href="/debug" text="Debug" /> }
|
||||
<Separator />
|
||||
<div className="flex flex-grow" />
|
||||
{ENV !== 'production' ? (
|
||||
|
||||
@ -14,6 +14,9 @@ export function Tabs({ children, selectedIndex: selectedIndexProp, onChange, cla
|
||||
|
||||
const RenderChildren = useCallback(() => {
|
||||
return children.map((child, i) => {
|
||||
if (!child) {
|
||||
return null
|
||||
}
|
||||
child.props.selected = i === selectedIndex;
|
||||
child.props.onClick = handleSelected(i);
|
||||
return child;
|
||||
|
||||
@ -14,6 +14,7 @@ export default function Camera({ camera }) {
|
||||
const [playerType, setPlayerType] = useState('live');
|
||||
|
||||
const cameraConfig = config?.cameras[camera];
|
||||
const hideConfigurationOptions = config?.ui?.hide_configuration_options;
|
||||
|
||||
const handleTabChange = (index) => {
|
||||
if (index === 0) {
|
||||
@ -49,7 +50,7 @@ export default function Camera({ camera }) {
|
||||
<Tabs selectedIndex={1} onChange={handleTabChange} className='justify'>
|
||||
<TextTab text='History' />
|
||||
<TextTab text='Live' />
|
||||
<TextTab text='Debug' />
|
||||
{hideConfigurationOptions ? null : <TextTab text="Debug"/>}
|
||||
</Tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user