fix: statusPageMonitor removal of infrastructureMonitors[]
This commit is contained in:
1 parent
115fcc67f6
commit
5a12105c3d
3 files changed
+9
-11
No files matched your search
@@ -35,6 +35,14 @@ import { useNavigate, useParams } from "react-router-dom";
|
||||
import axios from "axios";
|
||||
import { HeaderConfigStatusControls } from "./Components/HeaderConfigStatusControls";
|
||||
|
||||
const monitorsUrl = (() => {
|
||||
const params = new URLSearchParams();
|
||||
["http", "ping", "port", "docker", "game", "grpc", "websocket", "hardware"].forEach(
|
||||
(type) => params.append("type", type)
|
||||
);
|
||||
return `/monitors/team?${params.toString()}`;
|
||||
})();
|
||||
|
||||
interface TimezoneOption {
|
||||
_id: string;
|
||||
name: string;
|
||||
@@ -54,14 +62,6 @@ const CreateStatusPage = () => {
|
||||
isCreate ? null : `/status-page/${url}?type=uptime&type=infrastructure`
|
||||
);
|
||||
|
||||
const monitorsUrl = useMemo(() => {
|
||||
const params = new URLSearchParams();
|
||||
["http", "ping", "port", "docker", "game", "grpc", "websocket", "hardware"].forEach(
|
||||
(type) => params.append("type", type)
|
||||
);
|
||||
return `/monitors/team?${params.toString()}`;
|
||||
}, []);
|
||||
|
||||
const { data: monitorsResponse } = useGet<Monitor[]>(monitorsUrl);
|
||||
const monitors = monitorsResponse ?? [];
|
||||
|
||||
|
||||
@@ -29,11 +29,10 @@ const StatusPageView = () => {
|
||||
|
||||
const statusPage = data?.statusPage;
|
||||
const monitors = data?.monitors ?? [];
|
||||
const infrastructureMonitors = data?.infrastructureMonitors ?? [];
|
||||
|
||||
if (!statusPage) return null;
|
||||
|
||||
if (monitors?.length === 0 && infrastructureMonitors?.length === 0) {
|
||||
if (monitors.length === 0) {
|
||||
return (
|
||||
<BasePage
|
||||
loading={isLoading}
|
||||
|
||||
@@ -50,5 +50,4 @@ export interface StatusPage {
|
||||
export interface StatusPageResponse {
|
||||
statusPage: StatusPage;
|
||||
monitors: Monitor[];
|
||||
infrastructureMonitors: Monitor[];
|
||||
}
|
||||
Reference in new issue
Block a user