From c8649c8f8722abcfa4f649421d3d0586eb8712d2 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 25 Nov 2024 10:49:16 +0800 Subject: [PATCH] Add domains to percentage graphs --- Client/src/Pages/Infrastructure/Details/index.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Client/src/Pages/Infrastructure/Details/index.jsx b/Client/src/Pages/Infrastructure/Details/index.jsx index 9fbaae81a..238a15c57 100644 --- a/Client/src/Pages/Infrastructure/Details/index.jsx +++ b/Client/src/Pages/Infrastructure/Details/index.jsx @@ -221,13 +221,12 @@ const InfrastructureDetails = () => { setMonitor(response.data.data); } catch (error) { navigate("/not-found", { replace: true }); - logger.error(error); + logger.error(error); } }; fetchData(); }, [authToken, monitorId, dateRange]); - const statBoxConfigs = [ { id: 0, @@ -290,6 +289,7 @@ const InfrastructureDetails = () => { heading: "Memory usage", strokeColor: theme.palette.primary.main, yLabel: "Memory Usage", + yDomain: [0, 1], }, { type: "cpu", @@ -297,6 +297,7 @@ const InfrastructureDetails = () => { heading: "CPU usage", strokeColor: theme.palette.success.main, yLabel: "CPU Usage", + yDomain: [0, 1], }, ...(monitor?.checks?.[0]?.disk?.map((disk, idx) => ({ type: "disk", @@ -305,6 +306,7 @@ const InfrastructureDetails = () => { heading: `Disk${idx} usage`, strokeColor: theme.palette.warning.main, yLabel: "Disk Usage", + yDomain: [0, 1], })) || []), ]; @@ -394,6 +396,7 @@ const InfrastructureDetails = () => { dataKey={config.dataKey} xKey="createdAt" yKey={config.dataKey} + yDomain={config.yDomain} customTooltip={({ active, payload, label }) => (