Merge pull request #1177 from bluewave-labs/feat/infras-monitor-details-request

feat/infra monitor details request
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-11-24 18:28:14 -08:00
commit 260214808c
4 files changed
+17 -7

No files matched your search

@@ -9,6 +9,7 @@ import { useSelector } from "react-redux";
import { networkService } from "../../../main";
import PulseDot from "../../../Components/Animated/PulseDot";
import useUtils from "../../Monitors/utils";
import { logger } from "../../../Utils/Logger";
import { formatDurationRounded, formatDurationSplit } from "../../../Utils/timeUtils";
import {
TzTick,
@@ -169,7 +170,7 @@ const InfrastructureDetails = () => {
];
const [monitor, setMonitor] = useState(null);
const { authToken } = useSelector((state) => state.auth);
const [dateRange, setDateRange] = useState("day");
const [dateRange, setDateRange] = useState("all");
const { statusColor, determineState } = useUtils();
// These calculations are needed because ResponsiveContainer
// doesn't take padding of parent/siblings into account
@@ -189,19 +190,19 @@ const InfrastructureDetails = () => {
const response = await networkService.getStatsByMonitorId({
authToken: authToken,
monitorId: monitorId,
sortOrder: null,
sortOrder: "asc",
limit: null,
dateRange: dateRange,
numToDisplay: 50,
normalize: true,
normalize: false,
});
setMonitor(response.data.data);
} catch (error) {
console.error(error);
logger.error(error);
}
};
fetchData();
}, []);
}, [dateRange, monitorId, authToken]);
const statBoxConfigs = [
{
+8
View File
@@ -44,6 +44,14 @@ class Logger {
this.log = NO_OP;
return;
}
if (logLevel === "debug") {
this.error = console.error.bind(console);
this.warn = console.warn.bind(console);
this.info = console.info.bind(console);
this.log = console.log.bind(console);
return;
}
}
cleanup() {