feat(frontend): add MCP import dialog for v3.7.0
Implement import functionality to migrate MCP servers from existing configs:
**New Component:**
- src/components/mcp/McpImportDialog.tsx: Import dialog with card-based source selection
**Features:**
- Import from Claude (~/.claude/claude.json or settings.json)
- Import from Codex (~/.codex/config.toml)
- Import from Gemini (config file)
- Card-based UI with icons and descriptions
- Loading states with spinner animation
- Auto-refresh after successful import
**Integration:**
- Add import button to UnifiedMcpPanel header
- Handle import completion with refetch
- Toast notifications for success/info/error cases
**I18n:**
- Add mcp.unifiedPanel.import namespace (zh/en)
- Import button, dialog title, descriptions
- Success/error messages with count interpolation
**UX:**
- Smart disable: other sources disabled during import
- Clear feedback: count of imported servers
- Friendly messages: "No servers found" when empty
TypeScript type check passes ✅
This commit is contained in:
@@ -455,6 +455,16 @@
|
||||
"claude": "Claude",
|
||||
"codex": "Codex",
|
||||
"gemini": "Gemini"
|
||||
},
|
||||
"import": {
|
||||
"title": "导入 MCP 服务器",
|
||||
"button": "导入",
|
||||
"description": "从已有的应用配置文件中导入 MCP 服务器。导入的服务器将自动启用对应的应用。",
|
||||
"fromClaudeDesc": "从 ~/.claude/claude.json 或 ~/.claude/settings.json 导入 MCP 服务器",
|
||||
"fromCodexDesc": "从 ~/.codex/config.toml 导入 MCP 服务器",
|
||||
"fromGeminiDesc": "从 Gemini 配置文件导入 MCP 服务器",
|
||||
"success": "成功导入 {{count}} 个服务器",
|
||||
"noServersFound": "未找到可导入的服务器"
|
||||
}
|
||||
},
|
||||
"userLevelPath": "用户级 MCP 配置路径",
|
||||
|
||||
Reference in New Issue
Block a user