feat(mcp): show inline duplicate ID error and block submit in add mode

- Display red hint next to title when ID exists

- Disable Add/Save button and prevent submit on duplicate

- Accept existing IDs via prop for real-time validation

- Remove overwrite confirmation dialog on add

- i18n: add duplicate-ID error strings and remove unused overwrite prompt

- files:

  - src/components/mcp/McpFormModal.tsx

  - src/components/mcp/McpPanel.tsx

  - src/i18n/locales/en.json

  - src/i18n/locales/zh.json
This commit is contained in:
Jason
2025-10-10 11:17:40 +08:00
parent eb8d9352c8
commit 7493f3f9dd
4 changed files with 32 additions and 5 deletions

View File

@@ -316,6 +316,7 @@
},
"error": {
"idRequired": "Please enter identifier",
"idExists": "Identifier already exists. Please choose another.",
"jsonInvalid": "Invalid JSON format",
"commandRequired": "Please enter command",
"singleServerObjectRequired": "Please paste a single MCP server object (do not include top-level mcpServers)",

View File

@@ -316,6 +316,7 @@
},
"error": {
"idRequired": "请填写标识",
"idExists": "该标识已存在,请更换",
"jsonInvalid": "JSON 格式错误,请检查",
"commandRequired": "请填写命令",
"singleServerObjectRequired": "此处只需单个服务器对象,请不要粘贴包含 mcpServers 的整份配置",