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 (
e.stopPropagation()} >

注册新 Agent

setForm({ ...form, agent_id: e.target.value })} placeholder="例如: claude-001" style={{ width: '100%', padding: '10px 14px', background: 'rgba(0, 0, 0, 0.3)', border: '1px solid rgba(0, 240, 255, 0.2)', borderRadius: 8, color: '#fff', fontSize: 14, outline: 'none', }} />
setForm({ ...form, name: e.target.value })} placeholder="例如: Claude Code" style={{ width: '100%', padding: '10px 14px', background: 'rgba(0, 0, 0, 0.3)', border: '1px solid rgba(0, 240, 255, 0.2)', borderRadius: 8, color: '#fff', fontSize: 14, outline: 'none', }} />
setForm({ ...form, model: e.target.value })} placeholder="模型名称" style={{ width: '100%', padding: '10px 14px', background: 'rgba(0, 0, 0, 0.3)', border: '1px solid rgba(0, 240, 255, 0.2)', borderRadius: 8, color: '#fff', fontSize: 14, outline: 'none', }} />