import React from 'react'; import { Button } from 'antd'; import { CopyOutlined, ReloadOutlined } from '@ant-design/icons'; import type { AIMCPClientInstallStatus } from '../../types'; import { buildRemoteMCPClientQuickStart, isRemoteMCPClientStatus, } from '../../utils/mcpClientInstallStatus'; import type { OverlayWorkbenchTheme } from '../../utils/overlayWorkbenchTheme'; import AIMCPRemoteQuickStartPanel from './AIMCPRemoteQuickStartPanel'; import { getMCPClientStatusSummary, getMCPClientStatusTone, getSelectedMCPClientStateLine, resolveMCPClientCommandName, } from './mcpClientInstallPanelState'; interface AIMCPClientStatusPanelProps { selectedStatus?: AIMCPClientInstallStatus; selectedCommandText: string; darkMode: boolean; overlayTheme: OverlayWorkbenchTheme; cardBorder: string; statusLoading: boolean; onRefreshStatus: () => void; onCopyConfigPath: () => void; onCopyLaunchCommand: () => void; } const AIMCPClientStatusPanel: React.FC = ({ selectedStatus, selectedCommandText, darkMode, overlayTheme, cardBorder, statusLoading, onRefreshStatus, onCopyConfigPath, onCopyLaunchCommand, }) => { const selectedIsRemoteClient = isRemoteMCPClientStatus(selectedStatus); const remoteQuickStart = selectedIsRemoteClient ? buildRemoteMCPClientQuickStart(selectedStatus) : null; return (
已选客户端状态
当前目标客户端:{selectedStatus?.displayName || '未选择客户端'}
{getMCPClientStatusSummary(selectedStatus)}
{selectedStatus && (
{getMCPClientStatusTone(selectedStatus, darkMode).label}
)}
当前状态:{getSelectedMCPClientStateLine(selectedStatus)}
{selectedIsRemoteClient && (
远程接入边界:数据库连接信息和密码仍保存在 Windows GoNavi;云端 Agent 默认通过 schema-only MCP 工具读取连接摘要、库表和 DDL,不注册 execute_sql。跨机器接入请使用 GoNavi Streamable HTTP 模式,并配合 token、隧道或反向代理。
)} {remoteQuickStart && ( )}
CLI 检测:{selectedIsRemoteClient ? `远程 Agent 不需要检测本机 ${resolveMCPClientCommandName(selectedStatus)} 命令` : selectedStatus?.clientDetected ? `已检测到 ${resolveMCPClientCommandName(selectedStatus)}` : `未检测到 ${resolveMCPClientCommandName(selectedStatus)},仍可先写配置`}
{selectedStatus?.clientPath && (
命令路径:{selectedStatus.clientPath}
)}
检测结果:{selectedStatus?.message || '未检测到接入状态'}
{selectedStatus?.configPath && (
配置文件:{selectedStatus.configPath}
)} {selectedCommandText && (
启动命令:{selectedCommandText}
)}
); }; export default AIMCPClientStatusPanel;