From 12d51d3c735eb5cc26f513e2a9f7ef9979ad72f7 Mon Sep 17 00:00:00 2001
From: James L <24962424+leccelecce@users.noreply.github.com>
Date: Thu, 19 Jan 2023 00:05:18 +0000
Subject: [PATCH] System page: fix 0 FPS for disabled camera (#5155)
---
web/src/routes/System.jsx | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/web/src/routes/System.jsx b/web/src/routes/System.jsx
index 6f51a5397..fdabed335 100644
--- a/web/src/routes/System.jsx
+++ b/web/src/routes/System.jsx
@@ -246,11 +246,14 @@ export default function System() {
Detect |
{cameras[camera]['pid'] || '- '} |
- {cameras[camera]['detection_enabled'] == 1 ? (
- {cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped) |
- ) : (
- disabled |
- )}
+ {(() => {
+ if (cameras[camera]['pid'] && cameras[camera]['detection_enabled'] == 1)
+ return {cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped) |
+ else if (cameras[camera]['pid'] && cameras[camera]['detection_enabled'] == 0)
+ return disabled |
+
+ return - |
+ })()}
{cpu_usages[cameras[camera]['pid']]?.['cpu'] || '- '}% |
{cpu_usages[cameras[camera]['pid']]?.['mem'] || '- '}% |