fix: 移除计划任务报告中的 ANSI 转义 (#4193)

Refs #4097
This commit is contained in:
ssongliu 2024-03-15 11:56:07 +08:00 committed by GitHub
parent 34a6587ebc
commit a33eabb4f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -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 },

View file

@ -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 },