Skip to content

Commit

Permalink
System page: fix 0 FPS for disabled camera (#5155)
Browse files Browse the repository at this point in the history
  • Loading branch information
leccelecce authored Jan 19, 2023
1 parent 5fa1fba commit 12d51d3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions web/src/routes/System.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,14 @@ export default function System() {
<Td>Detect</Td>
<Td>{cameras[camera]['pid'] || '- '}</Td>

{cameras[camera]['detection_enabled'] == 1 ? (
<Td>{cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped)</Td>
) : (
<Td>disabled</Td>
)}
{(() => {
if (cameras[camera]['pid'] && cameras[camera]['detection_enabled'] == 1)
return <Td>{cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped)</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']]?.['mem'] || '- '}%</Td>
Expand Down

0 comments on commit 12d51d3

Please sign in to comment.