import { useState, useEffect } from 'react'; import { Plus, Users, Activity, Cpu, RefreshCw, Play, Square, Power } from 'lucide-react'; import { api } from '../lib/api'; import type { Agent, AgentState } from '../types'; // 注册 Agent 模态框 function RegisterModal({ isOpen, onClose, onSubmit, }: { isOpen: boolean; onClose: () => void; onSubmit: (data: { agent_id: string; name: string; role: string; model: string; description: string; }) => void; }) { const [form, setForm] = useState({ agent_id: '', name: '', role: 'developer', model: 'claude-opus-4.6', description: '', }); if (!isOpen) return null; return (
{agent.agent_id}
{agent.model}
{state.current_task || '无'}
{state.progress}%
{new Date(state.last_update).toLocaleString()}
管理系统中的所有智能体
{agent.agent_id}
模型: {agent.model}
{/* 运行状态指示 */} {runningAgents[agent.agent_id] ? ( 运行中 ) : ( 已停止 )}创建于: {new Date(agent.created_at).toLocaleDateString()}
{/* 启动/停止按钮 */}运行时长: {Math.floor(runningAgents[agent.agent_id].uptime! / 60)} 分钟
)}暂无 Agent
点击"注册 Agent"创建