From 559d014b294ad9719a16ddd93d4780ee633aa65b Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 19 Aug 2025 14:18:41 +0800 Subject: [PATCH] chore: use api return truncate --- .../components/workflow/panel/workflow-preview.tsx | 3 +++ web/app/components/workflow/run/index.tsx | 3 +++ web/app/components/workflow/run/result-panel.tsx | 12 ++++++++++-- web/app/components/workflow/types.ts | 5 +++++ web/models/log.ts | 5 +++++ web/types/workflow.ts | 5 +++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/panel/workflow-preview.tsx b/web/app/components/workflow/panel/workflow-preview.tsx index 2c797e05d6..3ca221243c 100644 --- a/web/app/components/workflow/panel/workflow-preview.tsx +++ b/web/app/components/workflow/panel/workflow-preview.tsx @@ -184,7 +184,10 @@ const WorkflowPreview = () => { {currentTab === 'DETAIL' && ( = ({ hideResult, activeTab = 'RESULT', runID, getRe {!loading && currentTab === 'DETAIL' && runDetail && ( + outputs_truncated?: boolean + outputs_full_content?: { + download_url: string + } status: string error?: string elapsed_time?: number @@ -43,8 +48,11 @@ export type ResultPanelProps = { const ResultPanel: FC = ({ nodeInfo, inputs, + inputs_truncated, process_data, outputs, + outputs_truncated, + outputs_full_content, status, error, elapsed_time, @@ -119,7 +127,7 @@ const ResultPanel: FC = ({ language={CodeLanguage.json} value={inputs} isJSONStringifyBeauty - footer={} + footer={inputs_truncated && } /> {process_data && ( = ({ value={outputs} isJSONStringifyBeauty tip={} - footer={} + footer={outputs_truncated && } /> )} diff --git a/web/app/components/workflow/types.ts b/web/app/components/workflow/types.ts index 371352771d..7d27f59665 100644 --- a/web/app/components/workflow/types.ts +++ b/web/app/components/workflow/types.ts @@ -375,8 +375,13 @@ export type WorkflowRunningData = { result: { workflow_id?: string inputs?: string + inputs_truncated: boolean process_data?: string outputs?: string + outputs_truncated: boolean + outputs_full_content?: { + download_url: string + } status: string error?: string elapsed_time?: number diff --git a/web/models/log.ts b/web/models/log.ts index 31bcaa727c..eff46372d0 100644 --- a/web/models/log.ts +++ b/web/models/log.ts @@ -285,8 +285,13 @@ export type WorkflowRunDetailResponse = { viewport?: Viewport } inputs: string + inputs_truncated: boolean status: 'running' | 'succeeded' | 'failed' | 'stopped' outputs?: string + outputs_truncated: boolean + outputs_full_content?: { + download_url: string + } error?: string elapsed_time?: number total_tokens?: number diff --git a/web/types/workflow.ts b/web/types/workflow.ts index d1d59374d1..795c8af7bf 100644 --- a/web/types/workflow.ts +++ b/web/types/workflow.ts @@ -37,8 +37,13 @@ export type NodeTracing = { node_type: BlockEnum title: string inputs: any + inputs_truncated: boolean process_data: any outputs?: Record + outputs_truncated: boolean + outputs_full_content?: { + download_url: string + } status: string parallel_run_id?: string error?: string