From a33eabb4f0694c7b6609fd0555da633989fefafb Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:56:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=8A=A5=E5=91=8A=E4=B8=AD=E7=9A=84=20ANSI?= =?UTF-8?q?=20=E8=BD=AC=E4=B9=89=20(#4193)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #4097 --- frontend/src/views/container/container/log/index.vue | 2 +- frontend/src/views/cronjob/record/index.vue | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/container/container/log/index.vue b/frontend/src/views/container/container/log/index.vue index 137222ac9..c2e3ba56a 100644 --- a/frontend/src/views/container/container/log/index.vue +++ b/frontend/src/views/container/container/log/index.vue @@ -152,7 +152,7 @@ const searchLogs = async () => { `${protocol}://${host}/api/v1/containers/search/log?container=${logSearch.containerID}&since=${logSearch.mode}&tail=${logSearch.tail}&follow=${logSearch.isWatch}`, ); terminalSocket.value.onmessage = (event) => { - logInfo.value += event.data.replace(/\x1B\[[0-9;]*[mG]/g, ''); + logInfo.value += event.data.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, ''); const state = view.value.state; view.value.dispatch({ selection: { anchor: state.doc.length, head: state.doc.length }, diff --git a/frontend/src/views/cronjob/record/index.vue b/frontend/src/views/cronjob/record/index.vue index 915f3cf20..de1ff4c36 100644 --- a/frontend/src/views/cronjob/record/index.vue +++ b/frontend/src/views/cronjob/record/index.vue @@ -407,10 +407,11 @@ const forDetail = async (row: Cronjob.Record) => { const loadRecord = async (row: Cronjob.Record) => { if (row.records) { const res = await getRecordLog(row.id); - if (currentRecordDetail.value === res.data) { + let log = res.data.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, ''); + if (currentRecordDetail.value === log) { return; } - currentRecordDetail.value = res.data; + currentRecordDetail.value = log; const state = view.value.state; view.value.dispatch({ selection: { anchor: state.doc.length, head: state.doc.length },