From 1291e98e821c5b1810aab7f0aebe3f5f5cd44a20 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Tue, 22 Oct 2024 19:13:47 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pipeline/component/task-view/index.vue | 39 +++++++++++++++++-- 1 file changed, 36 insertions(+), 3 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 d49003137..54b13b17b 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 @@ -8,7 +8,11 @@ -
+
+ +
@@ -57,7 +61,20 @@ export default { if (currentHistory?.value?.logs != null) { node.logs = computed(() => { if (currentHistory?.value?.logs && currentHistory.value?.logs[node.node.id] != null) { - return currentHistory.value?.logs[node.node.id]; + const logs = currentHistory.value?.logs[node.node.id]; + const list = []; + for (let log of logs) { + const index = log.indexOf("]", 27) + 1; + const time = log.substring(0, index); + const content = log.substring(index); + const color = time.includes("ERROR") ? "red" : time.includes("WARN") ? "yellow" : "green"; + list.push({ + time, + content, + color + }); + } + return list; } return []; }); @@ -92,6 +109,7 @@ export default { .pi-task-view { .tab-title { display: flex; + .tab-title-text { display: inline-block; width: 180px; @@ -104,11 +122,26 @@ export default { .pi-task-view-logs { background-color: #000c17; - color: #fafafa; + color: #e9e9e9; + font-family: monospace; + padding: 5px; min-height: 300px; max-height: 580px; white-space: pre-wrap; word-wrap: break-word; + > div { + padding: 0; + margin: 0; + } + .green { + color: rgba(0, 255, 0, 0.8); + } + .yellow { + color: yellow; + } + .red { + color: red; + } } }