mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-05 12:07:52 +02:00
Add files via upload
This commit is contained in:
@@ -1158,6 +1158,14 @@ function loadExternalMCPExample() {
|
||||
],
|
||||
description: "示例描述",
|
||||
timeout: 300
|
||||
},
|
||||
"cyberstrike-ai-http": {
|
||||
transport: "http",
|
||||
url: "http://127.0.0.1:8081/mcp"
|
||||
},
|
||||
"cyberstrike-ai-sse": {
|
||||
transport: "sse",
|
||||
url: "http://127.0.0.1:8081/mcp/sse"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1231,7 +1239,7 @@ async function saveExternalMCP() {
|
||||
// 验证配置内容
|
||||
const transport = config.transport || (config.command ? 'stdio' : config.url ? 'http' : '');
|
||||
if (!transport) {
|
||||
errorDiv.textContent = `配置错误: "${name}" 需要指定command(stdio模式)或url(http模式)`;
|
||||
errorDiv.textContent = `配置错误: "${name}" 需要指定command(stdio模式)或url(http/sse模式)`;
|
||||
errorDiv.style.display = 'block';
|
||||
jsonTextarea.classList.add('error');
|
||||
return;
|
||||
@@ -1250,6 +1258,13 @@ async function saveExternalMCP() {
|
||||
jsonTextarea.classList.add('error');
|
||||
return;
|
||||
}
|
||||
|
||||
if (transport === 'sse' && !config.url) {
|
||||
errorDiv.textContent = `配置错误: "${name}" sse模式需要url字段`;
|
||||
errorDiv.style.display = 'block';
|
||||
jsonTextarea.classList.add('error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 清除错误提示
|
||||
|
||||
@@ -854,6 +854,13 @@
|
||||
"transport": "http",
|
||||
"url": "http://127.0.0.1:8081/mcp"
|
||||
}
|
||||
}</code>
|
||||
<strong>SSE模式:</strong><br>
|
||||
<code style="display: block; margin: 8px 0; padding: 8px; background: var(--bg-secondary); border-radius: 4px; white-space: pre-wrap;">{
|
||||
"cyberstrike-ai-sse": {
|
||||
"transport": "sse",
|
||||
"url": "http://127.0.0.1:8081/mcp/sse"
|
||||
}
|
||||
}</code>
|
||||
</div>
|
||||
<div id="external-mcp-json-error" class="error-message" style="display: none; margin-top: 8px; padding: 8px; background: rgba(220, 53, 69, 0.1); border: 1px solid rgba(220, 53, 69, 0.3); border-radius: 4px; color: var(--error-color); font-size: 0.875rem;"></div>
|
||||
|
||||
Reference in New Issue
Block a user