mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-18 23:48:43 -05:00
infra
This commit is contained in:
@@ -13,7 +13,11 @@ import { useTheme } from "@emotion/react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useIsAdmin } from "@/Hooks/useIsAdmin.js";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useFetchMonitorsByTeamId } from "../../../Hooks/monitorHooks.js";
|
||||
import {
|
||||
useFetchMonitorsByTeamId,
|
||||
useFetchMonitorsWithChecks,
|
||||
} from "@/Hooks/monitorHooks.js";
|
||||
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { setRowsPerPage } from "../../../Features/UI/uiSlice.js";
|
||||
// Constants
|
||||
@@ -70,14 +74,14 @@ const InfrastructureMonitors = () => {
|
||||
|
||||
const field = toFilterStatus !== undefined ? "status" : undefined;
|
||||
|
||||
const [monitors, summary, isLoading, networkError] = useFetchMonitorsByTeamId({
|
||||
limit: 1,
|
||||
const [monitors, count, isLoading, networkError] = useFetchMonitorsWithChecks({
|
||||
types: TYPES,
|
||||
page,
|
||||
limit: 1,
|
||||
page: page,
|
||||
field: field,
|
||||
filter: toFilterStatus ?? search,
|
||||
rowsPerPage,
|
||||
updateTrigger,
|
||||
rowsPerPage: rowsPerPage,
|
||||
monitorUpdateTrigger: updateTrigger,
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -99,7 +103,7 @@ const InfrastructureMonitors = () => {
|
||||
<Stack direction={"row"}>
|
||||
<MonitorCountHeader
|
||||
isLoading={isLoading}
|
||||
monitorCount={summary?.totalMonitors ?? 0}
|
||||
monitorCount={count || 0}
|
||||
/>
|
||||
<Filter
|
||||
selectedStatus={selectedStatus}
|
||||
@@ -122,7 +126,7 @@ const InfrastructureMonitors = () => {
|
||||
isSearching={isSearching}
|
||||
/>
|
||||
<Pagination
|
||||
itemCount={summary?.totalMonitors}
|
||||
itemCount={count || 0}
|
||||
paginationLabel={t("monitors")}
|
||||
page={page}
|
||||
rowsPerPage={rowsPerPage}
|
||||
|
||||
@@ -29,7 +29,7 @@ import PropTypes from "prop-types";
|
||||
import {
|
||||
useFetchMonitorsWithSummary,
|
||||
useFetchMonitorsWithChecks,
|
||||
} from "../../../Hooks/monitorHooks.js";
|
||||
} from "@/Hooks/monitorHooks.js";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const TYPES = ["http", "ping", "docker", "port", "game"];
|
||||
|
||||
Reference in New Issue
Block a user