From 324bd57e3dcabba8819c679472444144859f7612 Mon Sep 17 00:00:00 2001 From: jialin Date: Wed, 27 Nov 2024 21:12:49 +0800 Subject: [PATCH] fix: image chunk data broken --- src/components/speech-content/speech-item.tsx | 13 ++++++ .../components/ground-embedding.tsx | 2 +- .../playground/components/ground-images.tsx | 31 ++++++++++--- .../playground/components/ground-reranker.tsx | 2 +- src/pages/playground/config/params-config.ts | 4 +- src/utils/fetch-chunk-data.ts | 46 ++++++++++++++++++- 6 files changed, 86 insertions(+), 12 deletions(-) diff --git a/src/components/speech-content/speech-item.tsx b/src/components/speech-content/speech-item.tsx index 247a99cf..3b278044 100644 --- a/src/components/speech-content/speech-item.tsx +++ b/src/components/speech-content/speech-item.tsx @@ -28,6 +28,18 @@ const SpeechItem: React.FC = (props) => { setCollapsed(!collapsed); }; + const onDownload = () => { + const url = props.audioUrl || ''; + const filename = Date.now() + ''; + + const link = document.createElement('a'); + link.href = url; + link.download = filename; + document.body.appendChild(link); + link.click(); + link.remove(); + }; + return (
@@ -60,6 +72,7 @@ const SpeechItem: React.FC = (props) => {