chore: child node can not single run

pull/21369/head
Joel 12 months ago
parent fa38cd4a90
commit 9bad1d6630

@ -36,6 +36,7 @@ const NodeControl: FC<NodeControlProps> = ({
setOpen(newOpen)
}, [])
const isChildNode = !!(data.isInIteration || data.isInLoop)
return (
<div
className={`
@ -49,7 +50,7 @@ const NodeControl: FC<NodeControlProps> = ({
onClick={e => e.stopPropagation()}
>
{
canRunBySingle(data.type) && (
canRunBySingle(data.type, isChildNode) && (
<div
className='flex h-5 w-5 cursor-pointer items-center justify-center rounded-md hover:bg-state-base-hover'
onClick={() => {

@ -83,14 +83,16 @@ const PanelOperatorPopup = ({
const link = useNodeHelpLink(data.type)
const isChildNode = !!(data.isInIteration || data.isInLoop)
return (
<div className='w-[240px] rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-xl'>
{
(showChangeBlock || canRunBySingle(data.type)) && (
(showChangeBlock || canRunBySingle(data.type, isChildNode)) && (
<>
<div className='p-1'>
{
canRunBySingle(data.type) && (
canRunBySingle(data.type, isChildNode) && (
<div
className={`
flex h-8 cursor-pointer items-center rounded-lg px-3 text-sm text-text-secondary

@ -142,7 +142,8 @@ const BasePanel: FC<BasePanelProps> = ({
saveStateToHistory(WorkflowHistoryEvent.NodeDescriptionChange)
}, [handleNodeDataUpdateWithSyncDraft, id, saveStateToHistory])
const isSupportSingleRun = canRunBySingle(data.type)
const isChildNode = !!(data.isInIteration || data.isInLoop)
const isSupportSingleRun = canRunBySingle(data.type, isChildNode)
const appDetail = useAppStore(state => state.appDetail)
const {

@ -29,7 +29,6 @@ const useSingleRunFormParams = ({
&& item.operation !== WriteMode.removeFirst && item.operation !== WriteMode.removeLast
&& !writeModeTypesNum.includes(item.operation)
}).map(item => item.value as ValueSelector)
console.log(vars)
const forms = useMemo(() => {
const varInputs = varSelectorsToVarInputs(vars)

@ -19,7 +19,10 @@ import {
import type { IterationNodeType } from '../nodes/iteration/types'
import type { LoopNodeType } from '../nodes/loop/types'
export const canRunBySingle = (nodeType: BlockEnum) => {
export const canRunBySingle = (nodeType: BlockEnum, isChildNode: boolean) => {
// child node means in iteration or loop. Set value to iteration(or loop) may cause variable not exit problem in backend.
if(isChildNode && nodeType === BlockEnum.Assigner)
return false
return nodeType === BlockEnum.LLM
|| nodeType === BlockEnum.KnowledgeRetrieval
|| nodeType === BlockEnum.Code

Loading…
Cancel
Save