Visit camera directly from system page

This commit is contained in:
tpjanssen 2023-10-31 21:46:43 +01:00
parent d1620b4e39
commit 29e5093355
3 changed files with 20 additions and 1 deletions

View File

@ -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 directly from system page (default: shown below)
visit_url: ""
# Optional: zones for this camera
zones:
# Required: name of the zone

View File

@ -731,6 +731,10 @@ class CameraConfig(FrigateBaseModel):
default=60,
title="How long to wait for the image with the highest confidence score.",
)
visit_url: str = Field(
default="",
title="URL to visit the camera directly from system page.",
)
zones: Dict[str, ZoneConfig] = Field(
default_factory=dict, title="Zone configuration."
)

View File

@ -347,7 +347,19 @@ export default function System() {
>
<div className="capitalize text-lg flex justify-between p-4">
<Link href={`/cameras/${camera}`}>{camera.replaceAll('_', ' ')}</Link>
<Button onClick={(e) => onHandleFfprobe(camera, e)}>ffprobe</Button>
<div className="flex">
{(config.cameras[camera]['visit_url'] != "") && (
<Link
className="text-blue-500 hover:underline"
target="_blank"
rel="noopener noreferrer"
href={config.cameras[camera]['visit_url']}
>
visit
</Link>
)}
<Button className="ml-2" onClick={(e) => onHandleFfprobe(camera, e)}>ffprobe</Button>
</div>
</div>
<div className="p-2">
<Table className="w-full">