Skip to content

Commit 3cff130

Browse files
authored
♻️ add healthcheck bottom in mcp modal
2 parents c7eb303 + 7508378 commit 3cff130

File tree

3 files changed

+41
-29
lines changed

3 files changed

+41
-29
lines changed

frontend/app/[locale]/setup/agentSetup/components/McpConfigModal.tsx

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,9 @@ export default function McpConfigModal({ visible, onCancel }: McpConfigModalProp
235235
display: 'flex',
236236
alignItems: 'center',
237237
justifyContent: 'center',
238-
cursor: healthCheckLoading[key] ? 'not-allowed' : 'pointer',
239238
border: '1px solid #d9d9d9',
240239
boxShadow: '0 0 2px #ccc',
241240
}}
242-
title={t('mcpConfig.serverList.statusCheckHint')}
243-
onClick={() => !healthCheckLoading[key] && handleCheckHealth(record)}
244241
>
245242
{healthCheckLoading[key] ? <LoadingOutlined style={{ color: record.status ? '#52c41a' : '#ff4d4f' }} /> : null}
246243
</div>
@@ -253,49 +250,62 @@ export default function McpConfigModal({ visible, onCancel }: McpConfigModalProp
253250
title: t('mcpConfig.serverList.column.url'),
254251
dataIndex: 'mcp_url',
255252
key: 'mcp_url',
256-
width: '45%',
253+
width: '40%',
257254
ellipsis: true,
258255
},
259256
{
260257
title: t('mcpConfig.serverList.column.action'),
261258
key: 'action',
262-
width: '30%',
263-
render: (_: any, record: McpServer) => (
264-
<Space size="small">
265-
{record.status ? (
259+
width: '35%',
260+
render: (_: any, record: McpServer) => {
261+
const key = `${record.service_name}__${record.mcp_url}`
262+
return (
263+
<Space size="small">
266264
<Button
267265
type="link"
268-
icon={<EyeOutlined />}
269-
onClick={() => handleViewTools(record)}
266+
icon={<RedoOutlined />}
267+
onClick={() => handleCheckHealth(record)}
270268
size="small"
269+
loading={healthCheckLoading[key]}
271270
disabled={updatingTools}
272271
>
273-
{t('mcpConfig.serverList.button.viewTools')}
272+
{t('mcpConfig.serverList.button.healthCheck')}
274273
</Button>
275-
) : (
276-
<Tooltip title={t('mcpConfig.serverList.button.viewToolsDisabledHint')} placement="top">
274+
{record.status ? (
277275
<Button
278276
type="link"
279277
icon={<EyeOutlined />}
278+
onClick={() => handleViewTools(record)}
280279
size="small"
281-
disabled
280+
disabled={updatingTools}
282281
>
283282
{t('mcpConfig.serverList.button.viewTools')}
284283
</Button>
285-
</Tooltip>
286-
)}
287-
<Button
288-
type="link"
289-
danger
290-
icon={<DeleteOutlined />}
291-
onClick={() => handleDeleteServer(record)}
292-
size="small"
293-
disabled={updatingTools}
294-
>
295-
{t('mcpConfig.serverList.button.delete')}
296-
</Button>
297-
</Space>
298-
),
284+
) : (
285+
<Tooltip title={t('mcpConfig.serverList.button.viewToolsDisabledHint')} placement="top">
286+
<Button
287+
type="link"
288+
icon={<EyeOutlined />}
289+
size="small"
290+
disabled
291+
>
292+
{t('mcpConfig.serverList.button.viewTools')}
293+
</Button>
294+
</Tooltip>
295+
)}
296+
<Button
297+
type="link"
298+
danger
299+
icon={<DeleteOutlined />}
300+
onClick={() => handleDeleteServer(record)}
301+
size="small"
302+
disabled={updatingTools}
303+
>
304+
{t('mcpConfig.serverList.button.delete')}
305+
</Button>
306+
</Space>
307+
)
308+
},
299309
},
300310
]
301311

@@ -354,7 +364,7 @@ export default function McpConfigModal({ visible, onCancel }: McpConfigModalProp
354364
title={t('mcpConfig.modal.title')}
355365
open={visible}
356366
onCancel={updatingTools ? undefined : onCancel}
357-
width={800}
367+
width={1000}
358368
closable={!updatingTools}
359369
maskClosable={!updatingTools}
360370
footer={[

frontend/public/locales/en/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,7 @@
988988
"mcpConfig.serverList.column.url": "URL",
989989
"mcpConfig.serverList.column.action": "Actions",
990990
"mcpConfig.serverList.button.viewTools": "View Tools",
991+
"mcpConfig.serverList.button.healthCheck": "Health Check",
991992
"mcpConfig.serverList.button.delete": "Delete",
992993
"mcpConfig.serverList.statusCheckHint": "Click to check server connectivity",
993994
"mcpConfig.serverList.statusCheckSuccess": "Server connectivity check succeeded",

frontend/public/locales/zh/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@
984984
"mcpConfig.serverList.column.url": "URL",
985985
"mcpConfig.serverList.column.action": "操作",
986986
"mcpConfig.serverList.button.viewTools": "查看工具",
987+
"mcpConfig.serverList.button.healthCheck": "连通性校验",
987988
"mcpConfig.serverList.button.delete": "删除",
988989
"mcpConfig.serverList.statusCheckHint": "点击检测服务器连通性",
989990
"mcpConfig.serverList.statusCheckSuccess": "mcp服务器连接成功",

0 commit comments

Comments
 (0)