diff --git a/src/components/mcp/UnifiedMcpPanel.tsx b/src/components/mcp/UnifiedMcpPanel.tsx index fed80ed..0de5483 100644 --- a/src/components/mcp/UnifiedMcpPanel.tsx +++ b/src/components/mcp/UnifiedMcpPanel.tsx @@ -1,6 +1,6 @@ import React, { useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; -import { Plus, Server, Check, RefreshCw } from "lucide-react"; +import { Plus, Server, Check } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -10,7 +10,7 @@ import { DialogTitle, } from "@/components/ui/dialog"; import { Checkbox } from "@/components/ui/checkbox"; -import { useAllMcpServers, useToggleMcpApp, useSyncAllMcpServers } from "@/hooks/useMcp"; +import { useAllMcpServers, useToggleMcpApp } from "@/hooks/useMcp"; import type { McpServer } from "@/types"; import type { AppId } from "@/lib/api/types"; import McpFormModal from "./McpFormModal"; @@ -48,7 +48,6 @@ const UnifiedMcpPanel: React.FC = ({ const { data: serversMap, isLoading } = useAllMcpServers(); const toggleAppMutation = useToggleMcpApp(); const deleteServerMutation = useDeleteMcpServer(); - const syncAllMutation = useSyncAllMcpServers(); // Convert serversMap to array for easier rendering const serverEntries = useMemo((): Array<[string, McpServer]> => { @@ -110,17 +109,6 @@ const UnifiedMcpPanel: React.FC = ({ }); }; - const handleSyncAll = async () => { - try { - await syncAllMutation.mutateAsync(); - toast.success(t("mcp.unifiedPanel.syncAllSuccess")); - } catch (error) { - toast.error(t("common.error"), { - description: String(error), - }); - } - }; - const handleCloseForm = () => { setIsFormOpen(false); setEditingId(null); @@ -133,25 +121,10 @@ const UnifiedMcpPanel: React.FC = ({
{t("mcp.unifiedPanel.title")} -
- - -
+
diff --git a/src/hooks/useMcp.ts b/src/hooks/useMcp.ts index 781bad1..adc29f2 100644 --- a/src/hooks/useMcp.ts +++ b/src/hooks/useMcp.ts @@ -59,12 +59,3 @@ export function useDeleteMcpServer() { }, }); } - -/** - * 同步所有启用的 MCP 服务器到各应用的 live 配置 - */ -export function useSyncAllMcpServers() { - return useMutation({ - mutationFn: () => mcpApi.syncAllServers(), - }); -} diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 2d45987..72f7d3b 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -447,8 +447,6 @@ "editServer": "Edit Server", "deleteServer": "Delete Server", "deleteConfirm": "Are you sure you want to delete server \"{{id}}\"? This action cannot be undone.", - "syncAll": "Sync All", - "syncAllSuccess": "All enabled servers have been synced to application configs", "noServers": "No servers yet", "enabledApps": "Enabled Apps", "apps": { diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 6156020..e0014ac 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -447,8 +447,6 @@ "editServer": "编辑服务器", "deleteServer": "删除服务器", "deleteConfirm": "确定要删除服务器 \"{{id}}\" 吗?此操作无法撤销。", - "syncAll": "同步全部", - "syncAllSuccess": "已同步所有启用的服务器到各应用配置", "noServers": "暂无服务器", "enabledApps": "启用的应用", "apps": {