- Connect to BE to get infrastructure details
This commit is contained in:
1 parent
7223ca366a
commit
90acb72f20
1 file changed
+12
-5
@@ -5,6 +5,8 @@ import { Stack, Box, Typography } from "@mui/material";
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import CustomGauge from "../../../Components/Charts/CustomGauge";
|
import CustomGauge from "../../../Components/Charts/CustomGauge";
|
||||||
import AreaChart from "../../../Components/Charts/AreaChart";
|
import AreaChart from "../../../Components/Charts/AreaChart";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import { networkService } from "../../../main";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {
|
import {
|
||||||
TzTick,
|
TzTick,
|
||||||
@@ -158,15 +160,20 @@ const InfrastructureDetails = () => {
|
|||||||
{ name: "details", path: `/infrastructure/${monitorId}` },
|
{ name: "details", path: `/infrastructure/${monitorId}` },
|
||||||
];
|
];
|
||||||
const [monitor, setMonitor] = useState(null);
|
const [monitor, setMonitor] = useState(null);
|
||||||
|
const { authToken } = useSelector((state) => state.auth);
|
||||||
|
const [dateRange, setDateRange] = useState("day");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get("http://localhost:5000/api/v1/dummy-data", {
|
const response = await networkService.getStatsByMonitorId({
|
||||||
headers: {
|
authToken: authToken,
|
||||||
"Content-Type": "application/json",
|
monitorId: monitorId,
|
||||||
"Cache-Control": "no-cache",
|
sortOrder: null,
|
||||||
},
|
limit: null,
|
||||||
|
dateRange: dateRange,
|
||||||
|
numToDisplay: 50,
|
||||||
|
normalize: true,
|
||||||
});
|
});
|
||||||
setMonitor(response.data.data);
|
setMonitor(response.data.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in new issue
Block a user