Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/application/flow/workflow_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]):
"""
Expand Down
4 changes: 3 additions & 1 deletion ui/src/locales/lang/en-US/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?',
Expand Down Expand Up @@ -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 <a href="https://pypi.org/project/jsonpath-ng/1.8.0/" target="_blank" class="expression_tip">Click for details ➜ pypi.org</a>',
tooltip:
'Please use JSON Path expressions to split variables, e.g.: $.store.book <a href="https://pypi.org/project/jsonpath-ng/1.8.0/" target="_blank" class="expression_tip">Click for details ➜ pypi.org</a>',
},
},
parameterExtractionNode: {
Expand Down
9 changes: 5 additions & 4 deletions ui/src/locales/lang/zh-CN/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default {
copyError: '已复制节点',
paramErrorMessage: '参数已存在: ',
saveMessage: '当前的更改尚未保存,是否保存后退出?',
searchPlaceholder: '请输入节点名称'
searchPlaceholder: '请输入节点名称',
disabled: '该节点已被禁用',
},
delete: {
confirmTitle: '确定删除该节点?',
Expand Down Expand Up @@ -498,7 +499,8 @@ export default {
expression: {
label: '表达式',
placeholder: '请输入表达式',
tooltip: '请使用 JSON Path 表达式拆分变量,例如:$.store.book <a href="https://pypi.org/project/jsonpath-ng/1.8.0/" target="_blank" class="expression_tip">点击查看详情 ➜ pypi.org</a>',
tooltip:
'请使用 JSON Path 表达式拆分变量,例如:$.store.book <a href="https://pypi.org/project/jsonpath-ng/1.8.0/" target="_blank" class="expression_tip">点击查看详情 ➜ pypi.org</a>',
},
},
parameterExtractionNode: {
Expand Down Expand Up @@ -535,6 +537,5 @@ export default {
SystemPromptPlaceholder: '系统提示词,可以引用系统中的变量:如',
UserPromptPlaceholder: '用户提示词,可以引用系统中的变量:如',
initiator: '发起人',
abnormalInformation: '异常信息'

abnormalInformation: '异常信息',
}
4 changes: 3 additions & 1 deletion ui/src/locales/lang/zh-Hant/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default {
paramErrorMessage: '參數已存在: ',
saveMessage: '當前修改未保存,是否保存後退出?',
searchPlaceholder: '請輸入節點名稱',
disabled: '该节点已被禁用',
},
delete: {
confirmTitle: '確定刪除該節點?',
Expand Down Expand Up @@ -492,7 +493,8 @@ export default {
expression: {
label: '表達式',
placeholder: '請輸入表達式',
tooltip: '請使用 JSON Path 表達式拆分變量,例如:$.store.book <a href="https://pypi.org/project/jsonpath-ng/1.8.0/" target="_blank" class="expression_tip">點擊查看詳情 ➜ pypi.org</a>',
tooltip:
'請使用 JSON Path 表達式拆分變量,例如:$.store.book <a href="https://pypi.org/project/jsonpath-ng/1.8.0/" target="_blank" class="expression_tip">點擊查看詳情 ➜ pypi.org</a>',
},
},
parameterExtractionNode: {
Expand Down
29 changes: 29 additions & 0 deletions ui/src/workflow/common/NodeContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
<el-dropdown-item @click="copyNode" class="p-8">{{
$t('common.copy')
}}</el-dropdown-item>
<el-dropdown-item v-if="nodeDisabled" @click="enable()" class="p-8">{{
$t('common.status.enable')
}}</el-dropdown-item>
<el-dropdown-item v-else @click="disable()" class="p-8">{{
$t('common.status.disable')
}}</el-dropdown-item>
<el-dropdown-item @click="deleteNode" class="border-t p-8">{{
$t('common.delete')
}}</el-dropdown-item>
Expand All @@ -80,6 +86,14 @@
</div>
<el-collapse-transition>
<div @mousedown.stop @keydown.stop @click.stop v-show="showNode" class="mt-16">
<el-alert
v-if="nodeDisabled"
class="mb-16"
:title="$t('workflow.tip.disabled')"
type="error"
show-icon
:closable="false"
/>
<el-alert
v-if="node_status != 200"
class="mb-16"
Expand Down Expand Up @@ -239,6 +253,21 @@ const dropdownMenuStyle = computed(() => {
: '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<boolean>(false)
const form = ref<any>({
Expand Down
Loading