diff --git a/frigate/config.py b/frigate/config.py index 1973913c9..f69406ee5 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -43,6 +43,8 @@ class DetectorConfig(FrigateBaseModel): device: str = Field(default="usb", title="Device Type") num_threads: int = Field(default=3, title="Number of detection threads") +class UIConfig(FrigateBaseModel): + useExperimentalUI: bool = Field(default=False, title="Experimental UI") class MqttConfig(FrigateBaseModel): host: str = Field(title="MQTT Host") @@ -682,6 +684,7 @@ class FrigateConfig(FrigateBaseModel): environment_vars: Dict[str, str] = Field( default_factory=dict, title="Frigate environment variables." ) + ui: UIConfig = Field(default_factory=UIConfig, title="UI configuration.") model: ModelConfig = Field( default_factory=ModelConfig, title="Detection model configuration." ) diff --git a/web/src/App.jsx b/web/src/App.jsx index d4352a236..545ce450f 100644 --- a/web/src/App.jsx +++ b/web/src/App.jsx @@ -10,29 +10,30 @@ import { DarkModeProvider, DrawerProvider } from './context'; import { FetchStatus, useConfig } from './api'; export default function App() { - const { status } = useConfig(); + const { status, data: config } = useConfig(); + const cameraComponent = config && config.ui.useExperimentalUI ? Routes.getCameraV2 : Routes.getCamera; return ( -
+
{status !== FetchStatus.LOADED ? ( -
+
) : ( -
+
-
+
- - - - - - - - + + + + + + + +
diff --git a/web/src/components/Timeline.jsx b/web/src/components/Timeline.jsx index 378ef9949..115acc938 100644 --- a/web/src/components/Timeline.jsx +++ b/web/src/components/Timeline.jsx @@ -162,7 +162,9 @@ export default function Timeline({ events, offset, currentIndex, onChange }) {
- {markerTime && {markerTime.toLocaleTimeString()}} + + {markerTime && {markerTime.toLocaleTimeString()}} +
+
- - + + Mask & Zone creator
@@ -92,38 +92,37 @@ export default function Camera({ camera }) {
); - } - else if (viewMode === 'debug') { + } else if (viewMode === 'debug') { player = (
- - {showSettings ? : null} + {showSettings ? : null}
); } return ( -
- {camera} +
+ {camera} {player} -
- Tracked objects -
+
+ Tracked objects +
{cameraConfig.objects.track.map((objectType) => (