From 3c2a78a449c77892c6cda50752ce758c6431474d Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 14 Apr 2026 16:35:19 +0800 Subject: [PATCH 1/2] fix(web): Hide error message when workflow node error message equals empty string --- .../views/Workflow/components/Chat/Runtime.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/web/src/views/Workflow/components/Chat/Runtime.tsx b/web/src/views/Workflow/components/Chat/Runtime.tsx index 68bdc452..4a5be793 100644 --- a/web/src/views/Workflow/components/Chat/Runtime.tsx +++ b/web/src/views/Workflow/components/Chat/Runtime.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-24 17:57:08 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-04-07 14:05:50 + * @Last Modified time: 2026-04-14 16:33:33 */ /* * Runtime Component @@ -161,8 +161,7 @@ const Runtime: FC<{ item: ChatItem; index: number;}> = ({ children: ( {/* Display error message for failed nodes */} - - {item.error && + {vo.content?.error && vo.content?.error !== '' && @@ -219,11 +218,11 @@ const Runtime: FC<{ item: ChatItem; index: number;}> = ({ } - /** Copy value to clipboard and show success message */ - const handleCopy = (value: string) => { - copy(value) - message.success(t('common.copySuccess')) - } + /** Copy value to clipboard and show success message */ + const handleCopy = (value: string) => { + copy(value) + message.success(t('common.copySuccess')) + } return (
= ({
) :
- {item.error && + {item.error && item.error !== '' && } {renderChild(item.subContent)} From 47c242e5135880c3a0e54ed2af2455b42f6323ff Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 14 Apr 2026 17:43:58 +0800 Subject: [PATCH 2/2] fix(web): Compatible with Windows whitespace --- .../components/Properties/HttpRequest/index.tsx | 7 +++---- web/src/views/Workflow/hooks/useWorkflowGraph.ts | 13 +++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/web/src/views/Workflow/components/Properties/HttpRequest/index.tsx b/web/src/views/Workflow/components/Properties/HttpRequest/index.tsx index b032016b..4cf7c150 100644 --- a/web/src/views/Workflow/components/Properties/HttpRequest/index.tsx +++ b/web/src/views/Workflow/components/Properties/HttpRequest/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-09 18:35:43 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-04-02 17:17:06 + * @Last Modified time: 2026-04-14 17:36:53 */ import { type FC, useMemo, useRef, useState } from "react"; import { useTranslation } from 'react-i18next' @@ -35,9 +35,8 @@ const HttpRequest: FC<{ options: Suggestion[]; selectedNode?: any; graphRef?: an form.setFieldsValue({ auth }) } - const handleChangeBodyContentType = (e: any) => { - const value = e.target.value || e.target.value - form.setFieldValue(['body', 'data'], ['form-data', 'x-www-form-urlencoded'].includes(value) ? [{}] : undefined) + const handleChangeBodyContentType = () => { + form.setFieldValue(['body', 'data'], undefined) } // Handle error handling method change and update node ports accordingly diff --git a/web/src/views/Workflow/hooks/useWorkflowGraph.ts b/web/src/views/Workflow/hooks/useWorkflowGraph.ts index 3280562a..535a4eb0 100644 --- a/web/src/views/Workflow/hooks/useWorkflowGraph.ts +++ b/web/src/views/Workflow/hooks/useWorkflowGraph.ts @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 15:17:48 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-04-14 15:05:33 + * @Last Modified time: 2026-04-14 17:43:14 */ import { Clipboard, Graph, Keyboard, MiniMap, Node, Snapline, type Edge } from '@antv/x6'; import { register } from '@antv/x6-react-shape'; @@ -1200,9 +1200,6 @@ export const useWorkflowGraph = ({ }) || []; const edges = graphRef.current?.getEdges() || [] - - console.log('config', config) - const params = { ...config, features: featuresRef.current, @@ -1262,6 +1259,14 @@ export const useWorkflowGraph = ({ itemConfig[key][vo.key] = vo.value }) } + } else if (data.type === 'http-request' && key === 'body' && data.config[key] && 'defaultValue' in data.config[key]) { + const value = data.config[key].defaultValue + itemConfig[key] = value + if (value.content_type === 'json' && value.data && value.data !== '') { + itemConfig[key].data = value.data.replace(/\u00a0/g, ' ') + } else { + itemConfig[key].data = value.data + } } else if (data.config[key] && 'defaultValue' in data.config[key] && key !== 'knowledge_retrieval') { itemConfig[key] = data.config[key].defaultValue } else if (key === 'knowledge_retrieval' && data.config[key] && 'defaultValue' in data.config[key]) {