From 8c95cf359e24f506929bfec18478712f3d4da36a Mon Sep 17 00:00:00 2001 From: jZonG Date: Thu, 19 Jun 2025 11:51:51 +0800 Subject: [PATCH] add warning of MCP editing --- web/app/components/tools/mcp/modal.tsx | 8 +++++++- web/i18n/en-US/tools.ts | 2 ++ web/i18n/zh-Hans/tools.ts | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/web/app/components/tools/mcp/modal.tsx b/web/app/components/tools/mcp/modal.tsx index 4e8e38959c..ff28c23550 100644 --- a/web/app/components/tools/mcp/modal.tsx +++ b/web/app/components/tools/mcp/modal.tsx @@ -51,6 +51,7 @@ const MCPModal = ({ }: DuplicateAppModalProps) => { const { t } = useTranslation() + const originalServerUrl = data?.server_url const [name, setName] = React.useState(data?.name || '') const [appIcon, setAppIcon] = useState(getIcon(data)) const [url, setUrl] = React.useState(data?.server_url || '') @@ -77,7 +78,7 @@ const MCPModal = ({
-
{t('tools.mcp.modal.title')}
+
{data ? t('tools.mcp.modal.editTitle') : t('tools.mcp.modal.title')}
@@ -110,6 +111,11 @@ const MCPModal = ({ onChange={e => setUrl(e.target.value)} placeholder={t('tools.mcp.modal.serverUrlPlaceholder')} /> + {originalServerUrl && originalServerUrl !== url && ( +
+ {t('tools.mcp.modal.warning')} +
+ )}
diff --git a/web/i18n/en-US/tools.ts b/web/i18n/en-US/tools.ts index bc8c0b2d1c..86892cc880 100644 --- a/web/i18n/en-US/tools.ts +++ b/web/i18n/en-US/tools.ts @@ -164,10 +164,12 @@ const translation = { noTools: 'No tools available', modal: { title: 'Add MCP Server (HTTP)', + editTitle: 'Edit MCP Server (HTTP)', name: 'Name & Icon', namePlaceholder: 'Name your MCP server', serverUrl: 'Server URL', serverUrlPlaceholder: 'URL to server endpiont', + warning: 'Updating the server address may affect applications currently using this MCP', cancel: 'Cancel', save: 'Save', confirm: 'Add & Authorize', diff --git a/web/i18n/zh-Hans/tools.ts b/web/i18n/zh-Hans/tools.ts index 5aecc01f1a..56ef356c13 100644 --- a/web/i18n/zh-Hans/tools.ts +++ b/web/i18n/zh-Hans/tools.ts @@ -164,10 +164,12 @@ const translation = { noTools: '没有可用的工具', modal: { title: '添加 MCP 服务 (HTTP)', + editTitle: '修改 MCP 服务 (HTTP)', name: '名称和图标', namePlaceholder: '命名你的 MCP 服务', serverUrl: '服务端点 URL', serverUrlPlaceholder: '服务端点的 URL', + warning: '修改服务端点 URL 可能会影响使用当前 MCP 的应用。', cancel: '取消', save: '保存', confirm: '添加并授权',