Add link to go2rtc in system page (#5478)

* Add link to go2rtc in the system page

* Open in new page

* Add color and underline behavior

* Cleanup

* Cleanup

* Fix color

* fix tests
This commit is contained in:
Nicolas Mowen 2023-02-16 06:50:03 -07:00 committed by GitHub
parent 7b26935462
commit 6cfa73a284
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,13 +81,27 @@ export default function System() {
return ( return (
<div className="space-y-4 p-2 px-4"> <div className="space-y-4 p-2 px-4">
<div className="flex justify-between">
<Heading> <Heading>
System <span className="text-sm">{service.version}</span> System <span className="text-sm">{service.version}</span>
</Heading> </Heading>
{config && (
<Link
className="p-1 text-blue-500 hover:underline"
target="_blank"
rel="noopener noreferrer"
href="live/webrtc"
>
go2rtc dashboard
</Link>
)}
</div>
{service.last_updated && ( {service.last_updated && (
<p> <p>
<span>Last refreshed: <TimeAgo time={service.last_updated * 1000} dense /></span> <span>
Last refreshed: <TimeAgo time={service.last_updated * 1000} dense />
</span>
</p> </p>
)} )}
@ -256,11 +270,15 @@ export default function System() {
{(() => { {(() => {
if (cameras[camera]['pid'] && cameras[camera]['detection_enabled'] == 1) if (cameras[camera]['pid'] && cameras[camera]['detection_enabled'] == 1)
return <Td>{cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped)</Td> return (
<Td>
{cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped)
</Td>
);
else if (cameras[camera]['pid'] && cameras[camera]['detection_enabled'] == 0) else if (cameras[camera]['pid'] && cameras[camera]['detection_enabled'] == 0)
return <Td>disabled</Td> return <Td>disabled</Td>;
return <Td>- </Td> return <Td>- </Td>;
})()} })()}
<Td>{cpu_usages[cameras[camera]['pid']]?.['cpu'] || '- '}%</Td> <Td>{cpu_usages[cameras[camera]['pid']]?.['cpu'] || '- '}%</Td>