From 6a18bc817a14da33a8686d4c6b0fe783acf0d722 Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Mon, 14 Aug 2023 11:29:04 +0300 Subject: [PATCH] Fix Network error handling --- src/components/DeviceMemoryHealth.tsx | 2 +- src/components/DeviceNetworkHealth.tsx | 21 +++++++++++++++---- .../DeviceHealthCheck/DeviceHealthCheck.tsx | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/components/DeviceMemoryHealth.tsx b/src/components/DeviceMemoryHealth.tsx index b7012b22..449331d3 100644 --- a/src/components/DeviceMemoryHealth.tsx +++ b/src/components/DeviceMemoryHealth.tsx @@ -35,7 +35,7 @@ const DeviceMemory = ({ currentMemory, maxMemory }: DeviceMemoryProps) => { const currentLoad = chartData[0].data.length > 0 ? chartData[0].data[chartData[0].data.length - 1].y : 0 - const message = currentLoad < 80 ? 'Good' : 'Poor' + const message = currentLoad < maxMemory ? 'Good' : 'Poor' return ( 0 ? chartData[0].data[chartData[0].data.length - 1].y : 0 - const message = currentLoad < 80 ? 'Good' : 'Poor' + const message = currentLoad > 60 ? 'Good' : 'Poor' return ( - + {message} - {/* This is additional text */} + {message === 'Poor' && ( + + {((currentLoad / 60) * 100).toFixed(0)}% Uttilization + + )} diff --git a/src/pages/DeviceHealthCheck/DeviceHealthCheck.tsx b/src/pages/DeviceHealthCheck/DeviceHealthCheck.tsx index 1b4debd9..a1d7131f 100644 --- a/src/pages/DeviceHealthCheck/DeviceHealthCheck.tsx +++ b/src/pages/DeviceHealthCheck/DeviceHealthCheck.tsx @@ -44,7 +44,7 @@ const DeviceHeanlthCheckContent = () => { - +