"use client" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Progress } from "@/components/ui/progress" import { Activity, Server, Database, Cpu, HardDrive, Wifi, CheckCircle2, AlertTriangle, XCircle, Clock } from "lucide-react" const services = [ { name: "数据接入服务", status: "healthy", uptime: "99.99%", latency: "12ms" }, { name: "标签计算引擎", status: "healthy", uptime: "99.95%", latency: "45ms" }, { name: "AI推理服务", status: "warning", uptime: "98.50%", latency: "230ms" }, { name: "API网关", status: "healthy", uptime: "99.99%", latency: "8ms" }, { name: "数据存储服务", status: "healthy", uptime: "99.99%", latency: "25ms" }, { name: "消息队列", status: "healthy", uptime: "99.98%", latency: "5ms" }, ] const metrics = [ { name: "CPU使用率", value: 45, max: 100, unit: "%", status: "normal" }, { name: "内存使用率", value: 68, max: 100, unit: "%", status: "normal" }, { name: "磁盘使用率", value: 72, max: 100, unit: "%", status: "warning" }, { name: "网络带宽", value: 35, max: 100, unit: "%", status: "normal" }, ] export default function SystemHealthPage() { const getStatusIcon = (status: string) => { switch (status) { case "healthy": return case "warning": return case "error": return default: return } } const getStatusBadge = (status: string) => { switch (status) { case "healthy": return 健康 case "warning": return 警告 case "error": return 故障 default: return 未知 } } const getProgressColor = (status: string) => { switch (status) { case "normal": return "bg-green-500" case "warning": return "bg-yellow-500" case "critical": return "bg-red-500" default: return "bg-gray-500" } } return (
{/* 页面标题 */}

系统健康

监控系统运行状态和资源使用情况

{/* 整体状态 */}

系统运行正常

所有核心服务运行正常,1个服务有轻微警告

{/* 资源监控 */}
{metrics.map((metric) => (
{metric.name} {metric.value}{metric.unit}
div]:bg-yellow-500" : "[&>div]:bg-green-500"}`} />
))}
{/* 服务状态 */} 服务状态 各微服务运行状态监控
{services.map((service) => (
{getStatusIcon(service.status)}

{service.name}

延迟: {service.latency}

{getStatusBadge(service.status)}

可用率: {service.uptime}

))}
{/* 数据库连接 */}
数据库连接
主数据库 (MySQL) 已连接
缓存 (Redis) 已连接
分析库 (ClickHouse) 已连接

活跃连接

128

查询/秒

1,250

平均延迟

8ms

服务器资源
CPU (8核) 45%
内存 (32GB) 68%
磁盘 (500GB) 72%

运行时间

45天

最后重启

12-01

) }