diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 1fe1048e9..efaa64382 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -520,6 +520,9 @@ cameras: # to be replaced by a newer image. (default: shown below) best_image_timeout: 60 + # Optional: URL to visit the camera web UI directly from the system page. Might not be available on every camera. + webui_url: "" + # Optional: zones for this camera zones: # Required: name of the zone diff --git a/frigate/config.py b/frigate/config.py index b413a8cc8..902a6b32b 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -731,6 +731,9 @@ class CameraConfig(FrigateBaseModel): default=60, title="How long to wait for the image with the highest confidence score.", ) + webui_url: Optional[str] = Field( + title="URL to visit the camera directly from system page", + ) zones: Dict[str, ZoneConfig] = Field( default_factory=dict, title="Zone configuration." ) diff --git a/web/src/components/Button.jsx b/web/src/components/Button.jsx index abaf81548..11e469506 100644 --- a/web/src/components/Button.jsx +++ b/web/src/components/Button.jsx @@ -67,6 +67,7 @@ export default function Button({ disabled = false, ariaCapitalize = false, href, + target, type = 'contained', ...attrs }) { @@ -101,6 +102,7 @@ export default function Button({ tabindex="0" className={classes} href={href} + target={target} ref={ref} onmouseenter={handleMousenter} onmouseleave={handleMouseleave} diff --git a/web/src/icons/WebUI.jsx b/web/src/icons/WebUI.jsx new file mode 100644 index 000000000..214f30a60 --- /dev/null +++ b/web/src/icons/WebUI.jsx @@ -0,0 +1,21 @@ +import { h } from 'preact'; +import { memo } from 'preact/compat'; + +export function WebUI({ className = 'h-6 w-6', stroke = 'currentColor', fill = 'none', onClick = () => {} }) { + return ( + + + + ); +} + +export default memo(WebUI); diff --git a/web/src/routes/System.jsx b/web/src/routes/System.jsx index 5ad3fd215..eb094faa2 100644 --- a/web/src/routes/System.jsx +++ b/web/src/routes/System.jsx @@ -12,6 +12,7 @@ import Dialog from '../components/Dialog'; import TimeAgo from '../components/TimeAgo'; import copy from 'copy-to-clipboard'; import { About } from '../icons/About'; +import { WebUI } from '../icons/WebUI'; const emptyObject = Object.freeze({}); @@ -347,7 +348,17 @@ export default function System() { >
{camera.replaceAll('_', ' ')} - +
+ {config.cameras[camera]['webui_url'] && ( + + )} + +