From 172851363464a92483c777740d3afa139e7721dd Mon Sep 17 00:00:00 2001 From: JzoNg Date: Wed, 13 Mar 2024 18:13:16 +0800 Subject: [PATCH] fix sequence number and tokens in result panel --- web/app/components/workflow/hooks/use-workflow-run.ts | 4 ++-- web/app/components/workflow/run/meta.tsx | 2 +- web/app/components/workflow/run/status.tsx | 2 +- web/types/workflow.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/app/components/workflow/hooks/use-workflow-run.ts b/web/app/components/workflow/hooks/use-workflow-run.ts index 0fa04d43b9..76c568c067 100644 --- a/web/app/components/workflow/hooks/use-workflow-run.ts +++ b/web/app/components/workflow/hooks/use-workflow-run.ts @@ -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) => { diff --git a/web/app/components/workflow/run/meta.tsx b/web/app/components/workflow/run/meta.tsx index c4b5343aa9..d129b12ee4 100644 --- a/web/app/components/workflow/run/meta.tsx +++ b/web/app/components/workflow/run/meta.tsx @@ -86,7 +86,7 @@ const MetaData: FC = ({
)} {status !== 'running' && ( - {`${tokens} Tokens`} + {`${tokens || 0} Tokens`} )}
diff --git a/web/app/components/workflow/run/status.tsx b/web/app/components/workflow/run/status.tsx index 019c9cf424..51566657ae 100644 --- a/web/app/components/workflow/run/status.tsx +++ b/web/app/components/workflow/run/status.tsx @@ -82,7 +82,7 @@ const StatusPanel: FC = ({
)} {status !== 'running' && ( - {`${tokens} Tokens`} + {`${tokens || 0} Tokens`} )}
diff --git a/web/types/workflow.ts b/web/types/workflow.ts index c67d819b4e..93d13cbb8d 100644 --- a/web/types/workflow.ts +++ b/web/types/workflow.ts @@ -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 } }