From a54d24325b7e26463b6b7d42f4039a7c92e6a60e Mon Sep 17 00:00:00 2001 From: wb-lh513319 Date: Wed, 14 Aug 2024 10:11:10 +0800 Subject: [PATCH 1/2] feat: Session list amend --- web_new/ant-components/chat/sider/ChatSider.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web_new/ant-components/chat/sider/ChatSider.tsx b/web_new/ant-components/chat/sider/ChatSider.tsx index 54d4d84a9..aaa37c55e 100644 --- a/web_new/ant-components/chat/sider/ChatSider.tsx +++ b/web_new/ant-components/chat/sider/ChatSider.tsx @@ -153,9 +153,11 @@ const ChatSider: React.FC<{ listLoading: boolean; order: React.MutableRefObject; }> = ({ dialogueList = [], refresh, historyLoading, listLoading, order }) => { + const searchParams = useSearchParams(); + const scene = searchParams?.get('scene') ?? ''; const { t } = useTranslation(); const { mode } = useContext(ChatContext); - const [collapsed, setCollapsed] = useState(true); + const [collapsed, setCollapsed] = useState(scene === 'chat_dashboard'); // 展开或收起列表按钮样式 const triggerStyle: React.CSSProperties = useMemo(() => { @@ -207,7 +209,7 @@ const ChatSider: React.FC<{ item={{ label: t('assistant'), key: 'default', - icon: default, + icon: default, default: true, }} order={order} From cb5908fb9b40d7965336dfabe0a9852cff37156c Mon Sep 17 00:00:00 2001 From: wb-lh513319 Date: Wed, 14 Aug 2024 10:33:22 +0800 Subject: [PATCH 2/2] feat: flow state amend --- web_new/pages/construct/flow/canvas/index.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/web_new/pages/construct/flow/canvas/index.tsx b/web_new/pages/construct/flow/canvas/index.tsx index dd8f7452a..4abf6e4e1 100644 --- a/web_new/pages/construct/flow/canvas/index.tsx +++ b/web_new/pages/construct/flow/canvas/index.tsx @@ -177,10 +177,18 @@ const Canvas: React.FC = () => { } async function handleSaveFlow() { - const { name, label, description = '', editable = false } = form.getFieldsValue(); + const { name, label, description = '', editable = false, deploy = false } = form.getFieldsValue(); const reactFlowObject = mapHumpToUnderline(reactFlow.toObject() as IFlowData); if (id) { - const [, , res] = await apiInterceptors(updateFlowById(id, { name, label, description, editable, uid: id, flow_data: reactFlowObject })); + const [, , res] = await apiInterceptors(updateFlowById(id, { + name, + label, + description, + editable, + uid: id, + flow_data: reactFlowObject, + state: deploy ? 'deployed' : 'developing', + })); setIsModalVisible(false); if (res?.success) { message.success('编辑成功'); @@ -190,7 +198,7 @@ const Canvas: React.FC = () => { message.error(res?.err_msg); } } else { - const [_, res] = await apiInterceptors(addFlow({ name, label, description, editable, flow_data: reactFlowObject })); + const [_, res] = await apiInterceptors(addFlow({ name, label, description, editable, flow_data: reactFlowObject, state: deploy ? 'deployed' : 'developing' })); setIsModalVisible(false); replace('/construct/flow'); message.success('创建成功'); @@ -274,7 +282,7 @@ const Canvas: React.FC = () => { - +