* fix: mcp session cannot be enabled

* fix: error message

* perf: ui

* perf: ui

---------

Co-authored-by: Junyan Qin <rockchinq@gmail.com>
This commit is contained in:
Guanchao Wang
2025-11-04 22:02:40 +08:00
committed by GitHub
parent 9853eccd89
commit 1adaa93034
8 changed files with 117 additions and 34 deletions

View File

@@ -134,7 +134,7 @@ export default function MCPCardComponent({
<div className="flex flex-row items-center gap-[0.4rem]">
<AlertCircle className="w-4 h-4 text-red-500 dark:text-red-400" />
<div className="text-sm text-red-500 dark:text-red-400 font-medium">
{t('mcp.connectionFailed')}
{t('mcp.connectionFailedStatus')}
</div>
</div>
)}

View File

@@ -132,11 +132,11 @@ function StatusDisplay({
</svg>
<span className="font-medium">{t('mcp.connectionFailed')}</span>
</div>
{runtimeInfo.error_message && (
{/* {runtimeInfo.error_message && (
<div className="text-sm text-red-500 pl-7">
{runtimeInfo.error_message}
</div>
)}
)} */}
</div>
);
}
@@ -465,7 +465,7 @@ export default function MCPFormDialog({
</DialogHeader>
{isEditMode && runtimeInfo && (
<div className="mb-4 space-y-3">
<div className="mb-0 space-y-3">
{/* 测试中或连接失败时显示状态 */}
{(mcpTesting ||
runtimeInfo.status !== MCPSessionStatus.CONNECTED) && (
@@ -482,7 +482,14 @@ export default function MCPFormDialog({
{!mcpTesting &&
runtimeInfo.status === MCPSessionStatus.CONNECTED &&
runtimeInfo.tools?.length > 0 && (
<ToolsList tools={runtimeInfo.tools} />
<>
<div className="text-sm font-medium">
{t('mcp.toolCount', {
count: runtimeInfo.tools?.length || 0,
})}
</div>
<ToolsList tools={runtimeInfo.tools} />
</>
)}
</div>
)}

View File

@@ -342,7 +342,8 @@ const enUS = {
refreshSuccess: 'Refresh successful',
refreshFailed: 'Refresh failed: ',
connectionSuccess: 'Connection successful',
connectionFailed: 'Connection failed',
connectionFailed: 'Connection failed, please check URL',
connectionFailedStatus: 'Connection Failed',
toolsFound: 'tools',
unknownError: 'Unknown error',
noToolsFound: 'No tools found',

View File

@@ -343,7 +343,8 @@ const jaJP = {
refreshSuccess: '刷新に成功しました',
refreshFailed: '刷新に失敗しました:',
connectionSuccess: '接続に成功しました',
connectionFailed: '接続に失敗しました',
connectionFailed: '接続に失敗しましたURLを確認してください',
connectionFailedStatus: '接続失敗',
toolsFound: '個のツール',
unknownError: '不明なエラー',
noToolsFound: 'ツールが見つかりません',

View File

@@ -328,7 +328,8 @@ const zhHans = {
refreshSuccess: '刷新成功',
refreshFailed: '刷新失败:',
connectionSuccess: '连接成功',
connectionFailed: '连接失败',
connectionFailed: '连接失败请检查URL',
connectionFailedStatus: '连接失败',
toolsFound: '个工具',
unknownError: '未知错误',
noToolsFound: '未找到任何工具',

View File

@@ -326,7 +326,8 @@ const zhHant = {
refreshSuccess: '刷新成功',
refreshFailed: '刷新失敗:',
connectionSuccess: '連接成功',
connectionFailed: '連接失敗',
connectionFailed: '連接失敗請檢查URL',
connectionFailedStatus: '連接失敗',
toolsFound: '個工具',
unknownError: '未知錯誤',
noToolsFound: '未找到任何工具',