'use client'; import React, { useEffect, useState } from 'react'; import { CheckCircle2, XCircle, AlertCircle, RefreshCw, Server, Cpu, Radio, Key, Loader2, } from 'lucide-react'; import { getStatus } from '@/lib/api'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Separator } from '@/components/ui/separator'; import type { SystemStatus } from '@/types'; export default function StatusPage() { const [status, setStatus] = useState(null); const [error, setError] = useState(null); const [loading, setLoading] = useState(true); const loadStatus = async () => { setLoading(true); setError(null); try { const data = await getStatus(); setStatus(data); } catch (err: any) { setError(err.message || '连接后端失败'); } finally { setLoading(false); } }; useEffect(() => { loadStatus(); }, []); if (loading) { return (
); } if (error) { return (

无法连接到 Boardware Agent Sandbox 后端

{error}

请确认后端已启动:nanobot web

); } if (!status) return null; return (

系统状态

{/* System Info */} 系统信息 {/* Model Config */} 智能体配置 {/* Providers */} 提供商
{status.providers.map((p) => (
{p.has_key ? ( ) : ( )} {p.name} {p.detail && ( {p.detail} )}
))}
{/* Channels */} 通道
{status.channels.map((ch) => (
{ch.enabled ? '开启' : '关闭'} {ch.name}
))}
{/* Cron Summary */} 调度器
); } function InfoRow({ label, value, ok, }: { label: string; value: string; ok?: boolean; }) { return (
{label}
{value} {ok !== undefined && (ok ? ( ) : ( ))}
); }