mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-16 20:35:59 +08:00
chore: loop add node info
This commit is contained in:
parent
d27677e66e
commit
0cd6e55bde
@ -128,6 +128,7 @@ const useLastRun = <T>({
|
||||
showSingleRun,
|
||||
runResult,
|
||||
iterationRunResult,
|
||||
loopRunResult,
|
||||
} = oneStepRunRes
|
||||
|
||||
const {
|
||||
@ -144,6 +145,7 @@ const useLastRun = <T>({
|
||||
varSelectorsToVarInputs,
|
||||
runResult,
|
||||
iterationRunResult,
|
||||
loopRunResult,
|
||||
})
|
||||
|
||||
const callRunApi = async (data: Record<string, any>) => {
|
||||
|
@ -1,6 +1,36 @@
|
||||
const useSingleRunFormParams = () => {
|
||||
import type { NodeTracing } from '@/types/workflow'
|
||||
import { useMemo } from 'react'
|
||||
import formatTracing from '@/app/components/workflow/run/utils/format-log'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
type Params = {
|
||||
runResult: NodeTracing
|
||||
loopRunResult: NodeTracing[]
|
||||
}
|
||||
|
||||
const useSingleRunFormParams = ({
|
||||
runResult,
|
||||
loopRunResult,
|
||||
}: Params) => {
|
||||
const { t } = useTranslation()
|
||||
const nodeInfo = useMemo(() => {
|
||||
const formattedNodeInfo = formatTracing(loopRunResult, t)[0]
|
||||
|
||||
if (runResult && formattedNodeInfo) {
|
||||
return {
|
||||
...formattedNodeInfo,
|
||||
execution_metadata: {
|
||||
...runResult.execution_metadata,
|
||||
...formattedNodeInfo.execution_metadata,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return formattedNodeInfo
|
||||
}, [runResult, loopRunResult, t])
|
||||
return {
|
||||
forms: [],
|
||||
nodeInfo,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user