check details base
This commit is contained in:
1 parent
d139e0b643
commit
66c406151a
9 files changed
+112
-47
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { BasePage } from "@/components/design-elements";
|
||||
|
||||
import { useParams } from "react-router";
|
||||
import { useGet } from "@/hooks/UseApi";
|
||||
import type { ICheck } from "@/types/check";
|
||||
import type { ApiResponse } from "@/types/api";
|
||||
const CheckDetails = () => {
|
||||
const { id } = useParams();
|
||||
const { response, loading, error } = useGet<ApiResponse<ICheck>>(
|
||||
`/checks/${id}`
|
||||
);
|
||||
|
||||
const check = response?.data;
|
||||
return (
|
||||
<BasePage loading={loading} error={error}>
|
||||
{JSON.stringify(check)}
|
||||
</BasePage>
|
||||
);
|
||||
};
|
||||
|
||||
export default CheckDetails;
|
||||
@@ -6,6 +6,7 @@ import type { ICheck, IChecksWithCount } from "@/types/check";
|
||||
import type { ApiResponse } from "@/types/api";
|
||||
import type { MonitorStatus } from "@/types/monitor";
|
||||
|
||||
import { useNavigate } from "react-router";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useGet } from "@/hooks/UseApi";
|
||||
@@ -51,6 +52,7 @@ const getHeaders = (t: Function, uiTimezone: string) => {
|
||||
};
|
||||
|
||||
export const CheckTable = ({ monitorId }: { monitorId: string }) => {
|
||||
const navigate = useNavigate();
|
||||
const [page, setPage] = useState(0);
|
||||
const [rowsPerPage, setRowsPerPage] = useState(5);
|
||||
const { t } = useTranslation();
|
||||
@@ -87,7 +89,13 @@ export const CheckTable = ({ monitorId }: { monitorId: string }) => {
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<Table headers={headers} data={checks} />
|
||||
<Table
|
||||
headers={headers}
|
||||
data={checks}
|
||||
onRowClick={(row) => {
|
||||
navigate(`/checks/${row._id}`);
|
||||
}}
|
||||
/>
|
||||
<Pagination
|
||||
component="div"
|
||||
count={count}
|
||||
|
||||
@@ -119,7 +119,7 @@ const UptimeMonitors = () => {
|
||||
|
||||
return (
|
||||
<MonitorBasePageWithStates
|
||||
loading={loading}
|
||||
loading={true}
|
||||
error={error}
|
||||
items={monitorItems}
|
||||
page="uptime"
|
||||
|
||||
Reference in new issue
Block a user