System page: fix 0 FPS for disabled camera (#5155)

This commit is contained in:
James L 2023-01-19 00:05:18 +00:00 committed by GitHub
parent 5fa1fbafed
commit 12d51d3c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,11 +246,14 @@ export default function System() {
<Td>Detect</Td> <Td>Detect</Td>
<Td>{cameras[camera]['pid'] || '- '}</Td> <Td>{cameras[camera]['pid'] || '- '}</Td>
{cameras[camera]['detection_enabled'] == 1 ? ( {(() => {
<Td>{cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped)</Td> if (cameras[camera]['pid'] && cameras[camera]['detection_enabled'] == 1)
) : ( return <Td>{cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped)</Td>
<Td>disabled</Td> else if (cameras[camera]['pid'] && cameras[camera]['detection_enabled'] == 0)
)} return <Td>disabled</Td>
return <Td>- </Td>
})()}
<Td>{cpu_usages[cameras[camera]['pid']]?.['cpu'] || '- '}%</Td> <Td>{cpu_usages[cameras[camera]['pid']]?.['cpu'] || '- '}%</Td>
<Td>{cpu_usages[cameras[camera]['pid']]?.['mem'] || '- '}%</Td> <Td>{cpu_usages[cameras[camera]['pid']]?.['mem'] || '- '}%</Td>