From a4a0aedd3bb82be5c0d457c7818eeed6343a0e33 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Thu, 25 May 2023 15:35:14 -0600 Subject: [PATCH] Don't show network bandwidth in system stats page if not enabled --- web/src/routes/System.jsx | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/web/src/routes/System.jsx b/web/src/routes/System.jsx index bf4c57c45..21dac7190 100644 --- a/web/src/routes/System.jsx +++ b/web/src/routes/System.jsx @@ -96,7 +96,8 @@ export default function System() { System {service.version} {config && ( - go2rtc {go2rtc && ( `${go2rtc.version} ` ) } + + go2rtc {go2rtc && `${go2rtc.version} `} Inference Speed CPU % Memory % - Network Bandwidth + {config.telemetry.network_bandwidth && Network Bandwidth} @@ -248,7 +249,9 @@ export default function System() { {detectors[detector]['inference_speed']} ms {cpu_usages[detectors[detector]['pid']]?.['cpu'] || '- '}% {cpu_usages[detectors[detector]['pid']]?.['mem'] || '- '}% - {bandwidth_usages[detectors[detector]['pid']]?.['bandwidth'] || '- '}KB/s + {config.telemetry.network_bandwidth && ( + {bandwidth_usages[detectors[detector]['pid']]?.['bandwidth'] || '- '}KB/s + )} @@ -346,25 +349,30 @@ export default function System() { FPS CPU % Memory % - Network Bandwidth + {config.telemetry.network_bandwidth && Network Bandwidth} - ffmpeg + + ffmpeg + > + + {cameras[camera]['ffmpeg_pid'] || '- '} {cameras[camera]['camera_fps'] || '- '} {cpu_usages[cameras[camera]['ffmpeg_pid']]?.['cpu'] || '- '}% {cpu_usages[cameras[camera]['ffmpeg_pid']]?.['mem'] || '- '}% - {bandwidth_usages[cameras[camera]['ffmpeg_pid']]?.['bandwidth'] || '- '}KB/s + {config.telemetry.network_bandwidth && ( + {bandwidth_usages[cameras[camera]['ffmpeg_pid']]?.['bandwidth'] || '- '}KB/s + )} Capture @@ -430,7 +438,7 @@ export default function System() { CPU % Avg CPU % Memory % - Network Bandwidth + {config.telemetry.network_bandwidth && Network Bandwidth} @@ -439,7 +447,9 @@ export default function System() { {cpu_usages[processes[process]['pid']]?.['cpu'] || '- '}% {cpu_usages[processes[process]['pid']]?.['cpu_average'] || '- '}% {cpu_usages[processes[process]['pid']]?.['mem'] || '- '}% - {bandwidth_usages[processes[process]['pid']]?.['bandwidth'] || '- '}KB/s + {config.telemetry.network_bandwidth && ( + {bandwidth_usages[processes[process]['pid']]?.['bandwidth'] || '- '}KB/s + )}