mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-01 08:00:06 +00:00
fix(cronjob): prevent unnecessary log updates and clean log formatting (#8481)
Refs #8425
This commit is contained in:
committed by
wanghe-fit2cloud
parent
189555e16c
commit
165d2b1290
@@ -395,6 +395,7 @@ const search = async () => {
|
||||
if (!currentRecord.value) {
|
||||
currentRecord.value = records.value[0];
|
||||
} else {
|
||||
let oldRecordID = currentRecord.value.id;
|
||||
let beDelete = true;
|
||||
for (const item of records.value) {
|
||||
if (item.id === currentRecord.value.id) {
|
||||
@@ -406,6 +407,9 @@ const search = async () => {
|
||||
if (beDelete) {
|
||||
currentRecord.value = records.value[0];
|
||||
}
|
||||
if (oldRecordID === currentRecord.value.id && currentRecord.value.status !== 'Waiting') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (currentRecord.value?.records) {
|
||||
loadRecord(currentRecord.value);
|
||||
@@ -419,7 +423,7 @@ const forDetail = async (row: Cronjob.Record) => {
|
||||
const loadRecord = async (row: Cronjob.Record) => {
|
||||
if (row.records) {
|
||||
const res = await getRecordLog(row.id);
|
||||
let log = res.data.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, '');
|
||||
let log = res.data.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, '').replace(/\r/g, '');
|
||||
if (currentRecordDetail.value === log) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user