diff --git a/src/pages/Servers.tsx b/src/pages/Servers.tsx index 3431b8f..babe4d9 100644 --- a/src/pages/Servers.tsx +++ b/src/pages/Servers.tsx @@ -2,7 +2,7 @@ import { useState } from 'react' import { useQuery, useQueryClient } from '@tanstack/react-query' import { Card, Row, Col, Progress, Table, Tag, Typography, Button, Space, Tooltip, App } from 'antd' import { CloudServerOutlined, ReloadOutlined, CopyOutlined, GlobalOutlined } from '@ant-design/icons' -import { getServerMetrics, type ServerInfo, type ProcessInfo } from '@/services/server-api' +import { getServerMetrics, getServerHealth, type ServerInfo, type ProcessInfo, type ServerHealth } from '@/services/server-api' const { Text, Title } = Typography @@ -96,6 +96,12 @@ function ServersContent() { staleTime: 30_000, }) + const { data: health } = useQuery({ + queryKey: ['servers', 'health'], + queryFn: getServerHealth, + staleTime: 60_000, + }) + const handleRefresh = async () => { setRefreshing(true) await qc.invalidateQueries({ queryKey: ['servers', 'metrics'] }) @@ -115,6 +121,24 @@ function ServersContent() { ))} + + {/* Health Check Section */} + {health?.length ? ( +