feat: tool single run

This commit is contained in:
Joel 2024-03-13 18:43:43 +08:00
parent d777184fd5
commit 149eb38e84
2 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import ConfigCredential from '@/app/components/tools/setting/build-in/config-cre
import Loading from '@/app/components/base/loading'
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 ResultPanel from '@/app/components/workflow/run/result-panel'
const i18nPrefix = 'workflow.nodes.tool'
@ -43,8 +44,11 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
runningStatus,
handleRun,
handleStop,
runResult,
} = useConfig(id, data)
// console.log(inputs)
if (isLoading) {
return <div className='flex h-[200px] items-center justify-center'>
<Loading />
@ -158,6 +162,7 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
runningStatus={runningStatus}
onRun={handleRun}
onStop={handleStop}
result={<ResultPanel {...runResult} showSteps={false} />}
/>
)}
</div>

View File

@ -114,6 +114,7 @@ const useConfig = (id: string, payload: ToolNodeType) => {
setRunInputData,
handleRun,
handleStop,
runResult,
} = useOneStepRun<ToolNodeType>({
id,
data: inputs,
@ -171,6 +172,7 @@ const useConfig = (id: string, payload: ToolNodeType) => {
runningStatus,
handleRun,
handleStop,
runResult,
}
}