feat: http run

This commit is contained in:
Joel 2024-03-13 18:33:08 +08:00
parent 1653e5eebe
commit d777184fd5
2 changed files with 8 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/compo
import { Settings01 } from '@/app/components/base/icons/src/vender/line/general'
import type { NodePanelProps } from '@/app/components/workflow/types'
import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form'
import ResultPanel from '@/app/components/workflow/run/result-panel'
const i18nPrefix = 'workflow.nodes.http'
@ -55,8 +56,11 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
varInputs,
inputVarValues,
setInputVarValues,
runResult,
} = useConfig(id, data)
// console.log(inputs)
return (
<div className='mt-2'>
<div className='px-4 pb-4 space-y-4'>
@ -67,6 +71,7 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
}
>
<VarList
nodeId={id}
readonly={readOnly}
list={inputs.variables}
onChange={handleVarListChange}
@ -173,6 +178,7 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
runningStatus={runningStatus}
onRun={handleRun}
onStop={handleStop}
result={<ResultPanel {...runResult} showSteps={false} />}
/>
)}
</div >

View File

@ -75,6 +75,7 @@ const useConfig = (id: string, payload: HttpNodeType) => {
handleStop,
runInputData,
setRunInputData,
runResult,
} = useOneStepRun<HttpNodeType>({
id,
data: inputs,
@ -129,6 +130,7 @@ const useConfig = (id: string, payload: HttpNodeType) => {
varInputs,
inputVarValues,
setInputVarValues,
runResult,
}
}