Commit 149eb38e authored by Joel's avatar Joel

feat: tool single run

parent d777184f
...@@ -13,6 +13,7 @@ import ConfigCredential from '@/app/components/tools/setting/build-in/config-cre ...@@ -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>> = ({ ...@@ -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>> = ({ ...@@ -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) => { ...@@ -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) => { ...@@ -171,6 +172,7 @@ const useConfig = (id: string, payload: ToolNodeType) => {
runningStatus, runningStatus,
handleRun, handleRun,
handleStop, handleStop,
runResult,
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment