mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-09 15:30:08 +08:00
fix: 优化病毒扫描样式 (#5577)
This commit is contained in:
parent
eded682ecc
commit
2fafe3dcb5
@ -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"
|
||||
|
@ -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',
|
||||
|
@ -1003,6 +1003,8 @@ const message = {
|
||||
},
|
||||
clam: {
|
||||
clam: '病毒掃描',
|
||||
noClam: '未檢測到 ClamAV 服務,請參考官方文檔進行安裝!',
|
||||
notStart: '目前沒有運行 ClamAV 服務,請先啟動!',
|
||||
clamCreate: '創建掃描規則',
|
||||
scanDate: '掃描時間',
|
||||
scanTime: '耗時',
|
||||
|
@ -1005,6 +1005,8 @@ const message = {
|
||||
},
|
||||
clam: {
|
||||
clam: '病毒扫描',
|
||||
noClam: '未检测到 ClamAV 服务,请参考官方文档进行安装!',
|
||||
notStart: '当前未 ClamAV 服务,请先开启!',
|
||||
clamCreate: '创建扫描规则',
|
||||
scanDate: '扫描时间',
|
||||
scanTime: '耗时',
|
||||
|
@ -9,13 +9,17 @@
|
||||
v-model:mask-show="maskShow"
|
||||
/>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<template #toolbar v-if="clamStatus.isExist">
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="16" :md="16" :lg="16" :xl="16">
|
||||
<el-button type="primary" :disabled="!form.isActive" @click="onOpenDialog('add')">
|
||||
<el-button type="primary" :disabled="!clamStatus.isRunning" @click="onOpenDialog('add')">
|
||||
{{ $t('toolbox.clam.clamCreate') }}
|
||||
</el-button>
|
||||
<el-button plain :disabled="selects.length === 0 || !form.isActive" @click="onDelete(null)">
|
||||
<el-button
|
||||
plain
|
||||
:disabled="selects.length === 0 || !clamStatus.isRunning"
|
||||
@click="onDelete(null)"
|
||||
>
|
||||
{{ $t('commons.button.delete') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
@ -24,8 +28,12 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<template #main>
|
||||
<el-card v-if="!clamStatus.isRunning && maskShow" class="mask-prompt">
|
||||
<span>{{ $t('toolbox.clam.notStart') }}</span>
|
||||
</el-card>
|
||||
<template #main v-if="clamStatus.isExist">
|
||||
<ComplexTable
|
||||
:class="{ mask: !clamStatus.isRunning }"
|
||||
v-if="!isSettingShow"
|
||||
:pagination-config="paginationConfig"
|
||||
v-model:selects="selects"
|
||||
@ -100,11 +108,6 @@ const paginationConfig = reactive({
|
||||
});
|
||||
const searchName = ref();
|
||||
|
||||
const form = reactive({
|
||||
isActive: true,
|
||||
isExist: true,
|
||||
});
|
||||
|
||||
const opRef = ref();
|
||||
const dialogRef = ref();
|
||||
const operateIDs = ref();
|
||||
@ -115,8 +118,7 @@ const isSettingShow = ref();
|
||||
const maskShow = ref(true);
|
||||
const clamStatus = ref({
|
||||
isExist: false,
|
||||
version: false,
|
||||
isActive: true,
|
||||
isRunning: true,
|
||||
});
|
||||
|
||||
const search = async () => {
|
||||
@ -142,6 +144,7 @@ const setting = () => {
|
||||
};
|
||||
const getStatus = (status: any) => {
|
||||
clamStatus.value = status;
|
||||
console.log(clamStatus.value);
|
||||
search();
|
||||
};
|
||||
|
||||
|
@ -30,11 +30,11 @@
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<LayoutContent :title="$t('tool.supervisor.list')" :divider="true" v-if="!data.isExist" v-loading="loading">
|
||||
<LayoutContent :title="$t('toolbox.clam.clam')" :divider="true" v-if="!data.isExist" v-loading="loading">
|
||||
<template #main>
|
||||
<div class="app-warn">
|
||||
<div>
|
||||
<span v-if="!data.isExist">{{ $t('tool.supervisor.notSupport') }}</span>
|
||||
<span v-if="!data.isExist">{{ $t('toolbox.clam.noClam') }}</span>
|
||||
<span @click="toDoc()" v-if="!data.isExist">
|
||||
<el-icon class="ml-2"><Position /></el-icon>
|
||||
{{ $t('firewall.quickJump') }}
|
||||
@ -69,7 +69,7 @@ const setting = () => {
|
||||
};
|
||||
|
||||
const toDoc = async () => {
|
||||
window.open('https://1panel.cn/docs/user_manual/toolbox/supervisor/', '_blank', 'noopener,noreferrer');
|
||||
window.open('https://1panel.cn/docs/user_manual/toolbox/clam/', '_blank', 'noopener,noreferrer');
|
||||
};
|
||||
|
||||
const onOperate = async (operation: string) => {
|
||||
|
Loading…
Reference in New Issue
Block a user