mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-02 11:34:24 +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) {
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue