From d287fc11862595a98e21bc9f8332c1867257ef0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:06:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E6=9E=90=E7=97=85=E6=AF=92?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E5=86=85=E5=AE=B9=E6=A0=BC=E5=BC=8F=E5=A4=84?= =?UTF-8?q?=E7=90=86=20(#6790)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/clam.go | 4 ++-- frontend/src/views/toolbox/clam/operate/index.vue | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/app/service/clam.go b/backend/app/service/clam.go index 5453c8c83..885156d01 100644 --- a/backend/app/service/clam.go +++ b/backend/app/service/clam.go @@ -633,9 +633,9 @@ func handleAlert(stdout, clamName string, clamId uint) { if strings.Contains(stdout, "- SCAN SUMMARY -") { lines := strings.Split(stdout, "\n") for _, line := range lines { - if strings.HasPrefix(line, "Infected files:") { + if strings.HasPrefix(line, "Infected files: ") { var infectedFiles = 0 - infectedFiles, _ = strconv.Atoi(strings.TrimPrefix(line, "Infected files:")) + infectedFiles, _ = strconv.Atoi(strings.TrimPrefix(line, "Infected files: ")) if infectedFiles > 0 { pushAlert := dto.PushAlert{ TaskName: clamName, diff --git a/frontend/src/views/toolbox/clam/operate/index.vue b/frontend/src/views/toolbox/clam/operate/index.vue index b4178492f..6e7a78a69 100644 --- a/frontend/src/views/toolbox/clam/operate/index.vue +++ b/frontend/src/views/toolbox/clam/operate/index.vue @@ -387,6 +387,10 @@ const onSubmit = async (formEl: FormInstance | undefined) => { MsgError(i18n.global.t('cronjob.cronSpecHelper')); return; } + } + dialogData.value.rowData.spec = spec; + + if (dialogData.value.rowData!.hasAlert) { dialogData.value.rowData.alertCount = dialogData.value.rowData!.hasAlert ? dialogData.value.rowData.alertCount : 0; @@ -398,7 +402,6 @@ const onSubmit = async (formEl: FormInstance | undefined) => { dialogData.value.rowData.alertCount = 0; dialogData.value.rowData.hasAlert = false; } - dialogData.value.rowData.spec = spec; if (dialogData.value.title === 'edit') { await updateClam(dialogData.value.rowData)