From 6ff509d263c0182645b4692c10b5fedb192db964 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 4 Jun 2025 23:18:40 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=A2=9E=E5=8A=A0=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pipeline/component/task-view/index.vue | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-view/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-view/index.vue index 6a3d4c15..f77fb3bf 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-view/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-view/index.vue @@ -23,14 +23,11 @@ @@ -41,6 +38,7 @@ import { RunHistory } from "../../type"; import PiStatusShow from "/@/views/certd/pipeline/pipeline/component/status-show.vue"; import { usePreferences } from "/@/vben/preferences"; import { useSettingStore } from "/@/store/settings/index"; +import { notification } from "ant-design-vue"; export default { name: "PiTaskView", components: { PiStatusShow }, @@ -56,6 +54,22 @@ export default { onAiChat() { onAiChat(); }, + onDownloadLogs() { + const logs = currentHistory.value?.logs[activeKey.value]; + if (!logs || logs.length === 0) { + notification.warning({ + message: "没有日志", + }); + return; + } + const logText = logs.join(""); + const blob = new Blob([logText], { type: "text/plain;charset=utf-8" }); + const a = document.createElement("a"); + a.href = URL.createObjectURL(blob); + a.download = "certd-task-log.txt"; + a.click(); + URL.revokeObjectURL(a.href); + }, cancelText: "关闭", }); const { isMobile } = usePreferences();