From faef8b6aea7e59548a0a8b3cd68fff7caae490db Mon Sep 17 00:00:00 2001 From: sp mac bookpro 2605 Date: Thu, 11 Jun 2026 13:50:08 +0800 Subject: [PATCH] fix: stabilize build and improve mobile chat layout --- .../McpPanel/components/McpPanelH5.tsx | 113 ++++-------- .../McpPanel/components/McpPanelWeb.tsx | 96 ++++------- .../components/MarketplacePageH5.tsx | 2 +- .../PointsMallPage/PointsMallPageLogic.ts | 41 ++++- .../components/PointsMallPageH5.tsx | 10 +- .../components/PointsMallPageWeb.tsx | 10 +- src/pages/TeamsPage/TeamsPageLogic.ts | 2 + .../TeamsPage/components/TeamsPageH5.tsx | 2 +- .../TeamsPage/components/TeamsPageWeb.tsx | 5 +- src/pages/chat/ChatPage.tsx | 6 +- src/pages/chat/ChatPageLogic.ts | 32 +++- src/pages/chat/components/ChatPageH5.tsx | 163 ++++++++++++------ src/pages/chat/components/ChatPageWeb.tsx | 74 ++++---- src/styles.css | 58 +++++++ 14 files changed, 364 insertions(+), 250 deletions(-) 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
-
-
- -