mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-20 16:39:07 -05:00
initial commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import { BasePage, Breadcrumb } from "@/Components/v2/design-elements";
|
||||
import { useTheme } from "@mui/material";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useGet } from "@/Hooks/UseApi";
|
||||
|
||||
interface MonitorLookupItem {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface MonitorLookup {
|
||||
[key: string]: MonitorLookupItem;
|
||||
}
|
||||
|
||||
const Checks = () => {
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
const { monitorId } = useParams<{ monitorId?: string }>();
|
||||
|
||||
// Local state
|
||||
const [selectedMonitor, setSelectedMonitor] = useState<string>("0");
|
||||
const [filter, setFilter] = useState<boolean | undefined>(undefined);
|
||||
const [dateRange, setDateRange] = useState<string>("hour");
|
||||
|
||||
// Data fetching with SWR
|
||||
const monitorsUrl = "/monitors/team";
|
||||
const summaryUrl = `/checks/team/summary?dateRange=${dateRange}`;
|
||||
|
||||
const {
|
||||
data: monitorsResponse,
|
||||
isLoading: isLoadingMonitors,
|
||||
error: monitorsError,
|
||||
} = useGet<Monitor[]>(monitorsUrl);
|
||||
|
||||
const {
|
||||
data: summaryResponse,
|
||||
isLoading: isLoadingSummary,
|
||||
error: summaryError,
|
||||
} = useGet<ChecksSummary>(summaryUrl);
|
||||
|
||||
console.log(monitorsResponse, summaryResponse);
|
||||
|
||||
return (
|
||||
<BasePage>
|
||||
<Breadcrumb />
|
||||
</BasePage>
|
||||
);
|
||||
};
|
||||
|
||||
export default Checks;
|
||||
@@ -33,7 +33,7 @@ import InfrastructureDetails from "../Pages/Infrastructure/Details/index.jsx";
|
||||
import ServerUnreachable from "../Pages/ServerUnreachable.jsx";
|
||||
|
||||
// Checks
|
||||
import Checks from "../Pages/Checks/index.jsx";
|
||||
import Checks from "../Pages/Checks/index";
|
||||
|
||||
// Incidents
|
||||
import Incidents from "../Pages/Incidents/index.jsx";
|
||||
|
||||
Reference in New Issue
Block a user