diff --git a/src/components/McpPanel/components/McpPanelH5.tsx b/src/components/McpPanel/components/McpPanelH5.tsx index ff16172..cedef7a 100644 --- a/src/components/McpPanel/components/McpPanelH5.tsx +++ b/src/components/McpPanel/components/McpPanelH5.tsx @@ -1,5 +1,5 @@ -import { useEffect } from 'react'; -import { Button, Card, List, Modal, App as AntApp, Space, Alert, Tag, Popconfirm, Tooltip } from 'antd'; +import { useEffect, useState } from 'react'; +import { Button, Card, List, Modal, App as AntApp, Space, Alert, Tag, Popconfirm, Tooltip, Form, Input, Select } from 'antd'; import type { McpServer } from '../../../api'; import type { McpPanelLogicOutput } from '../McpPanelLogic'; @@ -230,8 +230,7 @@ function McpFormH5({ onSubmit: (values: any) => void; onCancel: () => void; }) { - const { useForm } = AntApp; - const [form] = useForm(); + const [form] = Form.useForm(); const [transport, setTransport] = useState<'stdio' | 'sse' | 'http'>(initial?.transport ?? 'stdio'); useEffect(() => { @@ -247,92 +246,50 @@ function McpFormH5({ }, [initial, form]); return ( -
{ - e.preventDefault(); - onSubmit(form.getFieldsValue()); - }}> -
- - -
-
- - + + + + -
+ onChange={(v) => { + setTransport(v as any); + form.setFieldValue('transport', v); + }} + options={[ + { value: 'stdio', label: 'stdio (本机进程)' }, + { value: 'sse', label: 'SSE (远程)' }, + { value: 'http', label: 'HTTP (Streamable)' }, + ]} + /> + {transport === 'stdio' ? ( <> -
- - -
如 npx / node / python
-
-
- -