v0.1.4-p2

main
mula.liu 2026-03-13 20:23:21 +08:00
parent 5d489d9bc4
commit 38bdcdfd63
1 changed files with 10 additions and 8 deletions

View File

@ -2925,7 +2925,7 @@ export function BotDashboardModule({
}); });
return next; return next;
}); });
await saveBotMcpConfig(nextRows); await saveBotMcpConfig(nextRows, { skipConnectivityTest: true });
}; };
const buildMcpHeaders = (row: MCPServerDraft): Record<string, string> => { const buildMcpHeaders = (row: MCPServerDraft): Record<string, string> => {
@ -2991,7 +2991,7 @@ export function BotDashboardModule({
const saveBotMcpConfig = async ( const saveBotMcpConfig = async (
rows: MCPServerDraft[] = mcpServers, rows: MCPServerDraft[] = mcpServers,
options?: { closeDraft?: boolean; expandedKey?: string }, options?: { closeDraft?: boolean; expandedKey?: string; skipConnectivityTest?: boolean },
) => { ) => {
if (!selectedBot) return; if (!selectedBot) return;
const mcp_servers: Record<string, MCPServerConfig> = {}; const mcp_servers: Record<string, MCPServerConfig> = {};
@ -3013,6 +3013,7 @@ export function BotDashboardModule({
} }
setIsSavingMcp(true); setIsSavingMcp(true);
try { try {
if (!options?.skipConnectivityTest) {
for (const item of testQueue) { for (const item of testQueue) {
const ok = await testSingleMcpServer(item.row, item.index); const ok = await testSingleMcpServer(item.row, item.index);
if (!ok) { if (!ok) {
@ -3021,6 +3022,7 @@ export function BotDashboardModule({
return; return;
} }
} }
}
await axios.put(`${APP_ENDPOINTS.apiBase}/bots/${selectedBot.id}/mcp-config`, { mcp_servers }); await axios.put(`${APP_ENDPOINTS.apiBase}/bots/${selectedBot.id}/mcp-config`, { mcp_servers });
if (options?.expandedKey) { if (options?.expandedKey) {
setExpandedMcpByKey({ [options.expandedKey]: true }); setExpandedMcpByKey({ [options.expandedKey]: true });