From 90acb72f206a5ed1ebe92dc3905f395c4590af33 Mon Sep 17 00:00:00 2001 From: Shemy Gan Date: Tue, 19 Nov 2024 21:33:52 -0500 Subject: [PATCH 1/3] - Connect to BE to get infrastructure details --- .../src/Pages/Infrastructure/details/index.jsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Client/src/Pages/Infrastructure/details/index.jsx b/Client/src/Pages/Infrastructure/details/index.jsx index 40db34b80..c8f8a2220 100644 --- a/Client/src/Pages/Infrastructure/details/index.jsx +++ b/Client/src/Pages/Infrastructure/details/index.jsx @@ -5,6 +5,8 @@ import { Stack, Box, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; import CustomGauge from "../../../Components/Charts/CustomGauge"; import AreaChart from "../../../Components/Charts/AreaChart"; +import { useSelector } from "react-redux"; +import { networkService } from "../../../main"; import axios from "axios"; import { TzTick, @@ -158,15 +160,20 @@ const InfrastructureDetails = () => { { name: "details", path: `/infrastructure/${monitorId}` }, ]; const [monitor, setMonitor] = useState(null); + const { authToken } = useSelector((state) => state.auth); + const [dateRange, setDateRange] = useState("day"); useEffect(() => { const fetchData = async () => { try { - const response = await axios.get("http://localhost:5000/api/v1/dummy-data", { - headers: { - "Content-Type": "application/json", - "Cache-Control": "no-cache", - }, + const response = await networkService.getStatsByMonitorId({ + authToken: authToken, + monitorId: monitorId, + sortOrder: null, + limit: null, + dateRange: dateRange, + numToDisplay: 50, + normalize: true, }); setMonitor(response.data.data); } catch (error) { From e239a72b874420f19a091832e78d5a4bb82eb167 Mon Sep 17 00:00:00 2001 From: Shemy Gan Date: Wed, 20 Nov 2024 08:59:06 -0500 Subject: [PATCH 2/3] - cleanup --- Client/src/Pages/Infrastructure/details/index.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/Client/src/Pages/Infrastructure/details/index.jsx b/Client/src/Pages/Infrastructure/details/index.jsx index c8f8a2220..63daeddb6 100644 --- a/Client/src/Pages/Infrastructure/details/index.jsx +++ b/Client/src/Pages/Infrastructure/details/index.jsx @@ -7,7 +7,6 @@ import CustomGauge from "../../../Components/Charts/CustomGauge"; import AreaChart from "../../../Components/Charts/AreaChart"; import { useSelector } from "react-redux"; import { networkService } from "../../../main"; -import axios from "axios"; import { TzTick, PercentTick, From 3053d632c6cb5adbf5562fedf18b58b678c4213a Mon Sep 17 00:00:00 2001 From: Shemy Gan Date: Wed, 20 Nov 2024 14:20:12 -0500 Subject: [PATCH 3/3] - extend field class instead --- Client/src/Components/Inputs/Field/index.css | 7 ++----- Client/src/Components/Inputs/Field/index.jsx | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Client/src/Components/Inputs/Field/index.css b/Client/src/Components/Inputs/Field/index.css index 33196b3b9..940969c9e 100644 --- a/Client/src/Components/Inputs/Field/index.css +++ b/Client/src/Components/Inputs/Field/index.css @@ -2,12 +2,9 @@ min-width: var(--env-var-width-3); } -.field-infrastructure-alert { +.field-infrastructure-alert{ max-width: var(--env-var-width-4); -} - -.field-infrastructure-alert .MuiInputBase-root:has(input) { - height: var(--env-var-height-2); + min-width: unset; } .field h3.MuiTypography-root, diff --git a/Client/src/Components/Inputs/Field/index.jsx b/Client/src/Components/Inputs/Field/index.jsx index d1eab532d..6409321fe 100644 --- a/Client/src/Components/Inputs/Field/index.jsx +++ b/Client/src/Components/Inputs/Field/index.jsx @@ -57,7 +57,7 @@ const Field = forwardRef( return ( - { error && ( + {error && (