From 2fafe3dcb557b8460002dd43985b208e38e02a28 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Wed, 26 Jun 2024 22:40:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=97=85=E6=AF=92?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E6=A0=B7=E5=BC=8F=20(#5577)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/clam.go | 20 +++++++-------- frontend/src/lang/modules/en.ts | 2 ++ frontend/src/lang/modules/tw.ts | 2 ++ frontend/src/lang/modules/zh.ts | 2 ++ frontend/src/views/toolbox/clam/index.vue | 25 +++++++++++-------- .../src/views/toolbox/clam/status/index.vue | 6 ++--- 6 files changed, 33 insertions(+), 24 deletions(-) diff --git a/backend/app/service/clam.go b/backend/app/service/clam.go index a5bbb0c2b..3bc9646de 100644 --- a/backend/app/service/clam.go +++ b/backend/app/service/clam.go @@ -60,11 +60,11 @@ func (f *ClamService) LoadBaseInfo() (dto.ClamBaseInfo, error) { baseInfo.IsExist = true baseInfo.IsActive, _ = systemctl.IsActive(clamServiceNameCentOs) } - exist2, _ := systemctl.IsExist(clamServiceNameCentOs) + exist2, _ := systemctl.IsExist(clamServiceNameUbuntu) if exist2 { - f.serviceName = clamServiceNameCentOs + f.serviceName = clamServiceNameUbuntu baseInfo.IsExist = true - baseInfo.IsActive, _ = systemctl.IsActive(clamServiceNameCentOs) + baseInfo.IsActive, _ = systemctl.IsActive(clamServiceNameUbuntu) } if baseInfo.IsActive { @@ -246,25 +246,25 @@ func (u *ClamService) LoadFile(req dto.OperationWithName) (string, error) { filePath := "" switch req.Name { case "clamd": - if u.serviceName == clamServiceNameCentOs { + if u.serviceName == clamServiceNameUbuntu { filePath = "/etc/clamav/clamd.conf" } else { filePath = "/etc/clamd.d/scan.conf" } case "clamd-log": - if u.serviceName == clamServiceNameCentOs { + if u.serviceName == clamServiceNameUbuntu { filePath = "/var/log/clamav/clamav.log" } else { filePath = "/var/log/clamd.scan" } case "freshclam": - if u.serviceName == clamServiceNameCentOs { + if u.serviceName == clamServiceNameUbuntu { filePath = "/etc/clamav/freshclam.conf" } else { filePath = "/etc/freshclam.conf" } case "freshclam-log": - if u.serviceName == clamServiceNameCentOs { + if u.serviceName == clamServiceNameUbuntu { filePath = "/var/log/clamav/freshclam.log" } else { filePath = "/var/log/clamav/freshclam.log" @@ -287,15 +287,15 @@ func (u *ClamService) UpdateFile(req dto.UpdateByNameAndFile) error { service := "" switch req.Name { case "clamd": - if u.serviceName == clamServiceNameCentOs { - service = clamServiceNameCentOs + if u.serviceName == clamServiceNameUbuntu { + service = clamServiceNameUbuntu filePath = "/etc/clamav/clamd.conf" } else { service = clamServiceNameCentOs filePath = "/etc/clamd.d/scan.conf" } case "freshclam": - if u.serviceName == clamServiceNameCentOs { + if u.serviceName == clamServiceNameUbuntu { filePath = "/etc/clamav/freshclam.conf" } else { filePath = "/etc/freshclam.conf" diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index ac3015599..094e717fc 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1061,6 +1061,8 @@ const message = { }, clam: { clam: 'Virus Scan', + noClam: 'ClamAV service not detected, please refer to the official documentation for installation!', + notStart: 'ClamAV service is currently not running, please start it first!', clamCreate: 'Create Scan Rule', scanDate: 'Scan Date', scanTime: 'Elapsed Time', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index b35a6cd54..dc5c7b019 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1003,6 +1003,8 @@ const message = { }, clam: { clam: '病毒掃描', + noClam: '未檢測到 ClamAV 服務,請參考官方文檔進行安裝!', + notStart: '目前沒有運行 ClamAV 服務,請先啟動!', clamCreate: '創建掃描規則', scanDate: '掃描時間', scanTime: '耗時', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index b0f806f43..fef4641c5 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1005,6 +1005,8 @@ const message = { }, clam: { clam: '病毒扫描', + noClam: '未检测到 ClamAV 服务,请参考官方文档进行安装!', + notStart: '当前未 ClamAV 服务,请先开启!', clamCreate: '创建扫描规则', scanDate: '扫描时间', scanTime: '耗时', diff --git a/frontend/src/views/toolbox/clam/index.vue b/frontend/src/views/toolbox/clam/index.vue index 282a3e4ae..bc3ce2df0 100644 --- a/frontend/src/views/toolbox/clam/index.vue +++ b/frontend/src/views/toolbox/clam/index.vue @@ -9,13 +9,17 @@ v-model:mask-show="maskShow" /> -