mirror of https://github.com/langgenius/dify.git
fix sequence number and tokens in result panel
This commit is contained in:
parent
68fa81ec82
commit
1728513634
|
|
@ -116,10 +116,10 @@ export const useWorkflowRun = () => {
|
|||
body: params,
|
||||
},
|
||||
{
|
||||
onWorkflowStarted: ({ task_id, workflow_run_id, sequence_number }) => {
|
||||
onWorkflowStarted: ({ task_id, workflow_run_id, data }) => {
|
||||
useStore.setState({ runningStatus: WorkflowRunningStatus.Running })
|
||||
useStore.setState({ taskId: task_id })
|
||||
useStore.setState({ currentSequenceNumber: sequence_number })
|
||||
useStore.setState({ currentSequenceNumber: data.sequence_number })
|
||||
useStore.setState({ workflowRunId: workflow_run_id })
|
||||
const newNodes = produce(getNodes(), (draft) => {
|
||||
draft.forEach((node) => {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ const MetaData: FC<Props> = ({
|
|||
<div className='my-[5px] w-[48px] h-2 rounded-sm bg-[rgba(0,0,0,0.05)]'/>
|
||||
)}
|
||||
{status !== 'running' && (
|
||||
<span>{`${tokens} Tokens`}</span>
|
||||
<span>{`${tokens || 0} Tokens`}</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ const StatusPanel: FC<ResultProps> = ({
|
|||
<div className='w-20 h-2 rounded-sm bg-[rgba(0,0,0,0.05)]'/>
|
||||
)}
|
||||
{status !== 'running' && (
|
||||
<span>{`${tokens} Tokens`}</span>
|
||||
<span>{`${tokens || 0} Tokens`}</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@ export type NodeTracingListResponse = {
|
|||
export type WorkflowStartedResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
sequence_number: number
|
||||
event: string
|
||||
data: {
|
||||
id: string
|
||||
workflow_id: string
|
||||
sequence_number: number
|
||||
created_at: number
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue