mirror of https://github.com/1Panel-dev/1Panel
fix: 解析病毒扫描内容格式处理 (#6790)
parent
f47f7c7361
commit
d287fc1186
|
@ -633,9 +633,9 @@ func handleAlert(stdout, clamName string, clamId uint) {
|
||||||
if strings.Contains(stdout, "- SCAN SUMMARY -") {
|
if strings.Contains(stdout, "- SCAN SUMMARY -") {
|
||||||
lines := strings.Split(stdout, "\n")
|
lines := strings.Split(stdout, "\n")
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
if strings.HasPrefix(line, "Infected files:") {
|
if strings.HasPrefix(line, "Infected files: ") {
|
||||||
var infectedFiles = 0
|
var infectedFiles = 0
|
||||||
infectedFiles, _ = strconv.Atoi(strings.TrimPrefix(line, "Infected files:"))
|
infectedFiles, _ = strconv.Atoi(strings.TrimPrefix(line, "Infected files: "))
|
||||||
if infectedFiles > 0 {
|
if infectedFiles > 0 {
|
||||||
pushAlert := dto.PushAlert{
|
pushAlert := dto.PushAlert{
|
||||||
TaskName: clamName,
|
TaskName: clamName,
|
||||||
|
|
|
@ -387,6 +387,10 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||||
MsgError(i18n.global.t('cronjob.cronSpecHelper'));
|
MsgError(i18n.global.t('cronjob.cronSpecHelper'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
dialogData.value.rowData.spec = spec;
|
||||||
|
|
||||||
|
if (dialogData.value.rowData!.hasAlert) {
|
||||||
dialogData.value.rowData.alertCount = dialogData.value.rowData!.hasAlert
|
dialogData.value.rowData.alertCount = dialogData.value.rowData!.hasAlert
|
||||||
? dialogData.value.rowData.alertCount
|
? dialogData.value.rowData.alertCount
|
||||||
: 0;
|
: 0;
|
||||||
|
@ -398,7 +402,6 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||||
dialogData.value.rowData.alertCount = 0;
|
dialogData.value.rowData.alertCount = 0;
|
||||||
dialogData.value.rowData.hasAlert = false;
|
dialogData.value.rowData.hasAlert = false;
|
||||||
}
|
}
|
||||||
dialogData.value.rowData.spec = spec;
|
|
||||||
|
|
||||||
if (dialogData.value.title === 'edit') {
|
if (dialogData.value.title === 'edit') {
|
||||||
await updateClam(dialogData.value.rowData)
|
await updateClam(dialogData.value.rowData)
|
||||||
|
|
Loading…
Reference in New Issue