feat(mcp): show wizard button only in custom mode
- Hide 'Use Configuration Wizard' button when preset MCP is selected - Show wizard button only in custom mode or edit mode - Prevents user confusion by avoiding wizard access when preset configs are loaded
This commit is contained in:
@@ -259,7 +259,6 @@ const McpFormModal: React.FC<McpFormModalProps> = ({
|
|||||||
<div className="flex-1 overflow-y-auto p-6 space-y-4">
|
<div className="flex-1 overflow-y-auto p-6 space-y-4">
|
||||||
{/* 预设选择(仅新增时展示) */}
|
{/* 预设选择(仅新增时展示) */}
|
||||||
{!isEditing && (
|
{!isEditing && (
|
||||||
<div className="space-y-4">
|
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-gray-900 dark:text-gray-100 mb-3">
|
<label className="block text-sm font-medium text-gray-900 dark:text-gray-100 mb-3">
|
||||||
{t("mcp.presets.title")}
|
{t("mcp.presets.title")}
|
||||||
@@ -293,17 +292,6 @@ const McpFormModal: React.FC<McpFormModalProps> = ({
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{selectedPreset === -1 && (
|
|
||||||
<div className="text-sm text-gray-500 dark:text-gray-400">
|
|
||||||
{t("presetSelector.customDescription")}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{selectedPreset !== null && selectedPreset >= 0 && (
|
|
||||||
<div className="text-sm text-gray-500 dark:text-gray-400">
|
|
||||||
{t("presetSelector.presetDescription")}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
{/* ID (标题) */}
|
{/* ID (标题) */}
|
||||||
<div>
|
<div>
|
||||||
@@ -345,6 +333,7 @@ const McpFormModal: React.FC<McpFormModalProps> = ({
|
|||||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||||
{t("mcp.form.jsonConfig")}
|
{t("mcp.form.jsonConfig")}
|
||||||
</label>
|
</label>
|
||||||
|
{(isEditing || selectedPreset === -1) && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setIsWizardOpen(true)}
|
onClick={() => setIsWizardOpen(true)}
|
||||||
@@ -352,6 +341,7 @@ const McpFormModal: React.FC<McpFormModalProps> = ({
|
|||||||
>
|
>
|
||||||
{t("mcp.form.useWizard")}
|
{t("mcp.form.useWizard")}
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<textarea
|
<textarea
|
||||||
className={`${inputStyles.text} h-48 resize-none font-mono text-xs`}
|
className={`${inputStyles.text} h-48 resize-none font-mono text-xs`}
|
||||||
|
|||||||
@@ -345,7 +345,7 @@
|
|||||||
"deleteMessage": "Are you sure you want to delete MCP server \"{{id}}\"? This action cannot be undone."
|
"deleteMessage": "Are you sure you want to delete MCP server \"{{id}}\"? This action cannot be undone."
|
||||||
},
|
},
|
||||||
"presets": {
|
"presets": {
|
||||||
"title": "Presets",
|
"title": "Select MCP Type",
|
||||||
"enable": "Enable",
|
"enable": "Enable",
|
||||||
"enabled": "Enabled",
|
"enabled": "Enabled",
|
||||||
"installed": "Installed",
|
"installed": "Installed",
|
||||||
|
|||||||
@@ -345,7 +345,7 @@
|
|||||||
"deleteMessage": "确定要删除 MCP 服务器 \"{{id}}\" 吗?此操作无法撤销。"
|
"deleteMessage": "确定要删除 MCP 服务器 \"{{id}}\" 吗?此操作无法撤销。"
|
||||||
},
|
},
|
||||||
"presets": {
|
"presets": {
|
||||||
"title": "预设库",
|
"title": "选择 MCP 类型",
|
||||||
"enable": "启用",
|
"enable": "启用",
|
||||||
"enabled": "已启用",
|
"enabled": "已启用",
|
||||||
"installed": "已安装",
|
"installed": "已安装",
|
||||||
|
|||||||
Reference in New Issue
Block a user