diff --git a/frontend/src/components/monitor/dashboard/GrafanaDashboard.tsx b/frontend/src/components/monitor/dashboard/GrafanaDashboard.tsx index 7f95d5e..9de4d93 100644 --- a/frontend/src/components/monitor/dashboard/GrafanaDashboard.tsx +++ b/frontend/src/components/monitor/dashboard/GrafanaDashboard.tsx @@ -107,7 +107,7 @@ const AgentTab: React.FC = () => { // 批量升级 Agent 到最新版本 const [batchUpgrading, setBatchUpgrading] = useState(false); const handleBatchUpgrade = async () => { - const online = hosts.filter((h: any) => selIds.has(h.server_id) && h.agent_status === 'online'); + const online = hosts.filter((h: any) => selIds.includes(h.server_id) && h.agent_status === 'online'); if (online.length === 0) { toast.error('所选主机中没有在线 Agent'); return; } const ids = online.map((h: any) => h.server_id); const ok = await _confirm({ title: '批量升级 Agent', description: `确定升级选中的 ${ids.length} 台在线主机的 Agent 到最新版本?升级将在后台异步执行。`, confirmText: '升级', variant: 'default' }); diff --git a/frontend/src/components/server/ServerManager.tsx b/frontend/src/components/server/ServerManager.tsx index 8eb772e..4a6ea73 100644 --- a/frontend/src/components/server/ServerManager.tsx +++ b/frontend/src/components/server/ServerManager.tsx @@ -268,6 +268,8 @@ export function ServerManager() { username: server.username || 'root', auth_type: server.auth_type || 'password', password: '', + ssh_key: '', + credential_id: null as number | null, os: server.os || '', cpu: String(server.cpu || ''), memory: server.memory ? String(Math.round(server.memory / 1024)) : '', // MB → GB