Merge pull request #1172 from bluewave-labs/feat/fe/infrastructure-details-connect-to-BE
Feat/fe/infrastructure details connect to be
This commit is contained in:
3 files changed
+17
-14
No files matched your search
@@ -2,12 +2,9 @@
|
|||||||
min-width: var(--env-var-width-3);
|
min-width: var(--env-var-width-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.field-infrastructure-alert {
|
.field-infrastructure-alert{
|
||||||
max-width: var(--env-var-width-4);
|
max-width: var(--env-var-width-4);
|
||||||
}
|
min-width: unset;
|
||||||
|
|
||||||
.field-infrastructure-alert .MuiInputBase-root:has(input) {
|
|
||||||
height: var(--env-var-height-2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.field h3.MuiTypography-root,
|
.field h3.MuiTypography-root,
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const Field = forwardRef(
|
|||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
className={`${className ?? `field field-${type}`}`}
|
className={`field field-${type} ${className}`}
|
||||||
sx={{
|
sx={{
|
||||||
"& fieldset": {
|
"& fieldset": {
|
||||||
borderColor: theme.palette.border.dark,
|
borderColor: theme.palette.border.dark,
|
||||||
@@ -186,11 +186,11 @@ const Field = forwardRef(
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{ error && (
|
{error && (
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
className="input-error"
|
className="input-error"
|
||||||
hidden={className? true: false}
|
hidden={className ? true : false}
|
||||||
color={theme.palette.error.main}
|
color={theme.palette.error.main}
|
||||||
mt={theme.spacing(2)}
|
mt={theme.spacing(2)}
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ 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 PulseDot from "../../../Components/Animated/PulseDot";
|
import PulseDot from "../../../Components/Animated/PulseDot";
|
||||||
import useUtils from "../../Monitors/utils";
|
import useUtils from "../../Monitors/utils";
|
||||||
import { formatDurationRounded, formatDurationSplit } from "../../../Utils/timeUtils";
|
import { formatDurationRounded, formatDurationSplit } from "../../../Utils/timeUtils";
|
||||||
import axios from "axios";
|
|
||||||
import {
|
import {
|
||||||
TzTick,
|
TzTick,
|
||||||
PercentTick,
|
PercentTick,
|
||||||
@@ -167,6 +168,8 @@ 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");
|
||||||
const { statusColor, determineState } = useUtils();
|
const { statusColor, determineState } = useUtils();
|
||||||
// These calculations are needed because ResponsiveContainer
|
// These calculations are needed because ResponsiveContainer
|
||||||
// doesn't take padding of parent/siblings into account
|
// doesn't take padding of parent/siblings into account
|
||||||
@@ -183,11 +186,14 @@ const InfrastructureDetails = () => {
|
|||||||
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