mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 11:04:27 +08:00
feat: tool single run
This commit is contained in:
parent
d777184fd5
commit
149eb38e84
@ -13,6 +13,7 @@ import ConfigCredential from '@/app/components/tools/setting/build-in/config-cre
|
|||||||
import Loading from '@/app/components/base/loading'
|
import Loading from '@/app/components/base/loading'
|
||||||
import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form'
|
import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form'
|
||||||
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
|
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
|
||||||
|
import ResultPanel from '@/app/components/workflow/run/result-panel'
|
||||||
|
|
||||||
const i18nPrefix = 'workflow.nodes.tool'
|
const i18nPrefix = 'workflow.nodes.tool'
|
||||||
|
|
||||||
@ -43,8 +44,11 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
|
|||||||
runningStatus,
|
runningStatus,
|
||||||
handleRun,
|
handleRun,
|
||||||
handleStop,
|
handleStop,
|
||||||
|
runResult,
|
||||||
} = useConfig(id, data)
|
} = useConfig(id, data)
|
||||||
|
|
||||||
|
// console.log(inputs)
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <div className='flex h-[200px] items-center justify-center'>
|
return <div className='flex h-[200px] items-center justify-center'>
|
||||||
<Loading />
|
<Loading />
|
||||||
@ -158,6 +162,7 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
|
|||||||
runningStatus={runningStatus}
|
runningStatus={runningStatus}
|
||||||
onRun={handleRun}
|
onRun={handleRun}
|
||||||
onStop={handleStop}
|
onStop={handleStop}
|
||||||
|
result={<ResultPanel {...runResult} showSteps={false} />}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -114,6 +114,7 @@ const useConfig = (id: string, payload: ToolNodeType) => {
|
|||||||
setRunInputData,
|
setRunInputData,
|
||||||
handleRun,
|
handleRun,
|
||||||
handleStop,
|
handleStop,
|
||||||
|
runResult,
|
||||||
} = useOneStepRun<ToolNodeType>({
|
} = useOneStepRun<ToolNodeType>({
|
||||||
id,
|
id,
|
||||||
data: inputs,
|
data: inputs,
|
||||||
@ -171,6 +172,7 @@ const useConfig = (id: string, payload: ToolNodeType) => {
|
|||||||
runningStatus,
|
runningStatus,
|
||||||
handleRun,
|
handleRun,
|
||||||
handleStop,
|
handleStop,
|
||||||
|
runResult,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user