mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-09 15:06:37 +08:00
fix(cronjob): prevent unnecessary log updates and clean log formatting (#8481)
Some checks failed
SonarCloud Scan / SonarCloud (push) Has been cancelled
Some checks failed
SonarCloud Scan / SonarCloud (push) Has been cancelled
Refs #8425
This commit is contained in:
parent
ed9f1599e6
commit
8fa9f128d8
1 changed files with 5 additions and 1 deletions
|
@ -395,6 +395,7 @@ const search = async () => {
|
||||||
if (!currentRecord.value) {
|
if (!currentRecord.value) {
|
||||||
currentRecord.value = records.value[0];
|
currentRecord.value = records.value[0];
|
||||||
} else {
|
} else {
|
||||||
|
let oldRecordID = currentRecord.value.id;
|
||||||
let beDelete = true;
|
let beDelete = true;
|
||||||
for (const item of records.value) {
|
for (const item of records.value) {
|
||||||
if (item.id === currentRecord.value.id) {
|
if (item.id === currentRecord.value.id) {
|
||||||
|
@ -406,6 +407,9 @@ const search = async () => {
|
||||||
if (beDelete) {
|
if (beDelete) {
|
||||||
currentRecord.value = records.value[0];
|
currentRecord.value = records.value[0];
|
||||||
}
|
}
|
||||||
|
if (oldRecordID === currentRecord.value.id && currentRecord.value.status !== 'Waiting') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (currentRecord.value?.records) {
|
if (currentRecord.value?.records) {
|
||||||
loadRecord(currentRecord.value);
|
loadRecord(currentRecord.value);
|
||||||
|
@ -419,7 +423,7 @@ const forDetail = async (row: Cronjob.Record) => {
|
||||||
const loadRecord = async (row: Cronjob.Record) => {
|
const loadRecord = async (row: Cronjob.Record) => {
|
||||||
if (row.records) {
|
if (row.records) {
|
||||||
const res = await getRecordLog(row.id);
|
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) {
|
if (currentRecordDetail.value === log) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue