mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-16 17:25:56 +08:00
update styling and iteration log
This commit is contained in:
parent
b28c7b1cda
commit
3431b19f9a
@ -255,7 +255,7 @@ export const useWorkflowRun = () => {
|
|||||||
setWorkflowRunningData(produce(workflowRunningData!, (draft) => {
|
setWorkflowRunningData(produce(workflowRunningData!, (draft) => {
|
||||||
const tracing = draft.tracing!
|
const tracing = draft.tracing!
|
||||||
const iterations = tracing[tracing.length - 1]
|
const iterations = tracing[tracing.length - 1]
|
||||||
const currIteration = iterations.details![iterations.details!.length - 1]
|
const currIteration = [iterations.details![iterations.details!.length - 1]]
|
||||||
currIteration.push({
|
currIteration.push({
|
||||||
...data,
|
...data,
|
||||||
status: NodeRunningStatus.Running,
|
status: NodeRunningStatus.Running,
|
||||||
@ -320,10 +320,6 @@ export const useWorkflowRun = () => {
|
|||||||
|
|
||||||
if (iterations && iterations.details) {
|
if (iterations && iterations.details) {
|
||||||
const iterationIndex = data.execution_metadata?.iteration_index || 0
|
const iterationIndex = data.execution_metadata?.iteration_index || 0
|
||||||
// console.log(`the current iteration index is ${iterationIndex}`)
|
|
||||||
|
|
||||||
// console.log(JSON.parse(JSON.stringify(iterations.details)))
|
|
||||||
|
|
||||||
if (!iterations.details[iterationIndex])
|
if (!iterations.details[iterationIndex])
|
||||||
iterations.details[iterationIndex] = []
|
iterations.details[iterationIndex] = []
|
||||||
|
|
||||||
@ -331,10 +327,10 @@ export const useWorkflowRun = () => {
|
|||||||
const nodeIndex = currIteration.findIndex(node =>
|
const nodeIndex = currIteration.findIndex(node =>
|
||||||
node.node_id === data.node_id,
|
node.node_id === data.node_id,
|
||||||
)
|
)
|
||||||
|
if (data.status === NodeRunningStatus.Succeeded) {
|
||||||
if (nodeIndex !== -1) {
|
if (nodeIndex !== -1) {
|
||||||
currIteration[nodeIndex] = {
|
currIteration[nodeIndex] = {
|
||||||
...(currIteration[nodeIndex].extras ? { extras: currIteration[nodeIndex].extras } : {}),
|
...currIteration[nodeIndex],
|
||||||
...data,
|
...data,
|
||||||
} as any
|
} as any
|
||||||
}
|
}
|
||||||
@ -344,6 +340,7 @@ export const useWorkflowRun = () => {
|
|||||||
} as any)
|
} as any)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -99,13 +99,13 @@ const NodePanel: FC<Props> = ({
|
|||||||
hideInfo && '!text-xs',
|
hideInfo && '!text-xs',
|
||||||
)} title={nodeInfo.title}>{nodeInfo.title}</div>
|
)} title={nodeInfo.title}>{nodeInfo.title}</div>
|
||||||
{nodeInfo.status !== 'running' && !hideInfo && (
|
{nodeInfo.status !== 'running' && !hideInfo && (
|
||||||
<div className='shrink-0 text-gray-500 text-xs leading-[18px]'>{`${getTime(nodeInfo.elapsed_time || 0)} · ${getTokenCount(nodeInfo.execution_metadata?.total_tokens || 0)} tokens`}</div>
|
<div className='shrink-0 text-text-tertiary system-xs-regular'>{nodeInfo.execution_metadata?.total_tokens ? `${getTokenCount(nodeInfo.execution_metadata?.total_tokens || 0)} tokens · ` : ''}{`${getTime(nodeInfo.elapsed_time || 0)}`}</div>
|
||||||
)}
|
)}
|
||||||
{nodeInfo.status === 'succeeded' && (
|
{nodeInfo.status === 'succeeded' && (
|
||||||
<RiCheckboxCircleFill className='shrink-0 ml-2 w-3.5 h-3.5 text-text-success' />
|
<RiCheckboxCircleFill className='shrink-0 ml-2 w-3.5 h-3.5 text-text-success' />
|
||||||
)}
|
)}
|
||||||
{nodeInfo.status === 'failed' && (
|
{nodeInfo.status === 'failed' && (
|
||||||
<RiErrorWarningLine className='shrink-0 ml-2 w-3.5 h-3.5 text-[#F04438]' />
|
<RiErrorWarningLine className='shrink-0 ml-2 w-3.5 h-3.5 text-text-warning' />
|
||||||
)}
|
)}
|
||||||
{nodeInfo.status === 'stopped' && (
|
{nodeInfo.status === 'stopped' && (
|
||||||
<AlertTriangle className='shrink-0 ml-2 w-3.5 h-3.5 text-[#F79009]' />
|
<AlertTriangle className='shrink-0 ml-2 w-3.5 h-3.5 text-[#F79009]' />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user