From 88a8ac9921df21f46b5409486f25ed46cac4de7e Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Tue, 21 Apr 2026 14:44:14 +0800 Subject: [PATCH] feat: Support node disabling and enabling --- apps/application/flow/workflow_manage.py | 3 +-- ui/src/locales/lang/en-US/workflow.ts | 4 +++- ui/src/locales/lang/zh-CN/workflow.ts | 9 ++++---- ui/src/locales/lang/zh-Hant/workflow.ts | 4 +++- ui/src/workflow/common/NodeContainer.vue | 29 ++++++++++++++++++++++++ 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/apps/application/flow/workflow_manage.py b/apps/application/flow/workflow_manage.py index 3d5ebdd7ec6..a020d7a2dec 100644 --- a/apps/application/flow/workflow_manage.py +++ b/apps/application/flow/workflow_manage.py @@ -699,8 +699,7 @@ def get_next_node_list(self, current_node, current_node_result): node_list.append( self.get_node_cls_by_id(edge.targetNodeId, [*current_node.up_node_id_list, current_node.node.id])) - - return node_list + return [node for node in node_list if not node.node.properties.get('disabled')] def get_reference_field(self, node_id: str, fields: List[str]): """ diff --git a/ui/src/locales/lang/en-US/workflow.ts b/ui/src/locales/lang/en-US/workflow.ts index f87956b3f7a..434024f313d 100644 --- a/ui/src/locales/lang/en-US/workflow.ts +++ b/ui/src/locales/lang/en-US/workflow.ts @@ -41,6 +41,7 @@ export default { paramErrorMessage: 'Parameter already exists: ', saveMessage: 'Current changes have not been saved. Save before exiting?', searchPlaceholder: 'Please enter node name', + disabled: 'The node has been disabled', }, delete: { confirmTitle: 'Confirm to delete this node?', @@ -507,7 +508,8 @@ You are a master of problem optimization, adept at accurately inferring user int expression: { label: 'Expression', placeholder: 'Please enter expression', - tooltip: 'Please use JSON Path expressions to split variables, e.g.: $.store.book Click for details ➜ pypi.org', + tooltip: + 'Please use JSON Path expressions to split variables, e.g.: $.store.book Click for details ➜ pypi.org', }, }, parameterExtractionNode: { diff --git a/ui/src/locales/lang/zh-CN/workflow.ts b/ui/src/locales/lang/zh-CN/workflow.ts index 3e9a5d8a7d8..6ed79e52fc9 100644 --- a/ui/src/locales/lang/zh-CN/workflow.ts +++ b/ui/src/locales/lang/zh-CN/workflow.ts @@ -39,7 +39,8 @@ export default { copyError: '已复制节点', paramErrorMessage: '参数已存在: ', saveMessage: '当前的更改尚未保存,是否保存后退出?', - searchPlaceholder: '请输入节点名称' + searchPlaceholder: '请输入节点名称', + disabled: '该节点已被禁用', }, delete: { confirmTitle: '确定删除该节点?', @@ -498,7 +499,8 @@ export default { expression: { label: '表达式', placeholder: '请输入表达式', - tooltip: '请使用 JSON Path 表达式拆分变量,例如:$.store.book 点击查看详情 ➜ pypi.org', + tooltip: + '请使用 JSON Path 表达式拆分变量,例如:$.store.book 点击查看详情 ➜ pypi.org', }, }, parameterExtractionNode: { @@ -535,6 +537,5 @@ export default { SystemPromptPlaceholder: '系统提示词,可以引用系统中的变量:如', UserPromptPlaceholder: '用户提示词,可以引用系统中的变量:如', initiator: '发起人', - abnormalInformation: '异常信息' - + abnormalInformation: '异常信息', } diff --git a/ui/src/locales/lang/zh-Hant/workflow.ts b/ui/src/locales/lang/zh-Hant/workflow.ts index 8d482d1f2b6..0513ea1c0e4 100644 --- a/ui/src/locales/lang/zh-Hant/workflow.ts +++ b/ui/src/locales/lang/zh-Hant/workflow.ts @@ -40,6 +40,7 @@ export default { paramErrorMessage: '參數已存在: ', saveMessage: '當前修改未保存,是否保存後退出?', searchPlaceholder: '請輸入節點名稱', + disabled: '该节点已被禁用', }, delete: { confirmTitle: '確定刪除該節點?', @@ -492,7 +493,8 @@ export default { expression: { label: '表達式', placeholder: '請輸入表達式', - tooltip: '請使用 JSON Path 表達式拆分變量,例如:$.store.book 點擊查看詳情 ➜ pypi.org', + tooltip: + '請使用 JSON Path 表達式拆分變量,例如:$.store.book 點擊查看詳情 ➜ pypi.org', }, }, parameterExtractionNode: { diff --git a/ui/src/workflow/common/NodeContainer.vue b/ui/src/workflow/common/NodeContainer.vue index 86cf69a6df6..f5b13a52176 100644 --- a/ui/src/workflow/common/NodeContainer.vue +++ b/ui/src/workflow/common/NodeContainer.vue @@ -70,6 +70,12 @@ {{ $t('common.copy') }} + {{ + $t('common.status.enable') + }} + {{ + $t('common.status.disable') + }} {{ $t('common.delete') }} @@ -80,6 +86,14 @@
+ { : '0px', } }) +const disable = () => { + nodeDisabled.value = true +} +const enable = () => { + nodeDisabled.value = false +} + +const nodeDisabled = computed({ + get: () => { + return props.nodeModel.properties.disabled || false + }, + set: (v: boolean) => { + set(props.nodeModel.properties, 'disabled', v) + }, +}) const titleFormRef = ref() const nodeNameDialogVisible = ref(false) const form = ref({