mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-28 05:15:04 +08:00
feat: 缓存清理增加上传下载检查项 (#2415)
This commit is contained in:
parent
11c5558334
commit
dc86cbc1ee
@ -88,12 +88,10 @@ func (u *SettingService) SystemScan() dto.CleanData {
|
||||
})
|
||||
SystemClean.SystemClean = treeData
|
||||
|
||||
uploadPath := path.Join(global.CONF.System.BaseDir, "1panel/uploads")
|
||||
uploadTreeData := loadTreeWithAllFile(true, uploadPath, "upload", uploadPath, fileOp)
|
||||
uploadTreeData := loadUploadTree(fileOp)
|
||||
SystemClean.UploadClean = append(SystemClean.UploadClean, uploadTreeData...)
|
||||
|
||||
downloadPath := path.Join(global.CONF.System.BaseDir, "1panel/download")
|
||||
downloadTreeData := loadTreeWithAllFile(true, downloadPath, "download", downloadPath, fileOp)
|
||||
downloadTreeData := loadDownloadTree(fileOp)
|
||||
SystemClean.DownloadClean = append(SystemClean.DownloadClean, downloadTreeData...)
|
||||
|
||||
logTree := loadLogTree(fileOp)
|
||||
@ -153,8 +151,24 @@ func (u *SettingService) SystemClean(req []dto.Clean) {
|
||||
|
||||
case "upload":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/uploads", item.Name))
|
||||
case "upload_app":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/uploads/app", item.Name))
|
||||
case "upload_database":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/uploads/database", item.Name))
|
||||
case "upload_website":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/uploads/website", item.Name))
|
||||
case "upload_directory":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/uploads/directory", item.Name))
|
||||
case "download":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/download", item.Name))
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/downloads", item.Name))
|
||||
case "download_app":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/downloads/app", item.Name))
|
||||
case "download_database":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/downloads/database", item.Name))
|
||||
case "download_website":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/downloads/website", item.Name))
|
||||
case "download_directory":
|
||||
dropFileOrDir(path.Join(global.CONF.System.BaseDir, "1panel/downloads/directory", item.Name))
|
||||
|
||||
case "system_log":
|
||||
if len(item.Name) == 0 {
|
||||
@ -248,6 +262,64 @@ func loadUnusedFile(fileOp fileUtils.FileOp) []dto.CleanTree {
|
||||
return treeData
|
||||
}
|
||||
|
||||
func loadUploadTree(fileOp fileUtils.FileOp) []dto.CleanTree {
|
||||
var treeData []dto.CleanTree
|
||||
path1 := path.Join(global.CONF.System.BaseDir, "1panel/upload/app")
|
||||
list1 := loadTreeWithAllFile(true, path1, "upload_app", path1, fileOp)
|
||||
size1, _ := fileOp.GetDirSize(path1)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "upload_app", Size: uint64(size1), Children: list1, Type: "upload_app", IsRecommend: true})
|
||||
|
||||
path2 := path.Join(global.CONF.System.BaseDir, "1panel/upload/website")
|
||||
list2 := loadTreeWithAllFile(true, path2, "upload_website", path2, fileOp)
|
||||
size2, _ := fileOp.GetDirSize(path2)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "upload_website", Size: uint64(size2), Children: list2, Type: "upload_website", IsRecommend: true})
|
||||
|
||||
path3 := path.Join(global.CONF.System.BaseDir, "1panel/upload/database")
|
||||
list3 := loadTreeWithAllFile(true, path3, "upload_app", path3, fileOp)
|
||||
size3, _ := fileOp.GetDirSize(path3)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "upload_database", Size: uint64(size3), Children: list3, Type: "upload_database", IsRecommend: true})
|
||||
|
||||
path4 := path.Join(global.CONF.System.BaseDir, "1panel/upload/directory")
|
||||
list4 := loadTreeWithAllFile(true, path4, "upload_app", path4, fileOp)
|
||||
size4, _ := fileOp.GetDirSize(path4)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "upload_directory", Size: uint64(size4), Children: list4, Type: "upload_directory", IsRecommend: true})
|
||||
|
||||
path5 := path.Join(global.CONF.System.BaseDir, "1panel/uploads")
|
||||
uploadTreeData := loadTreeWithAllFile(true, path5, "upload", path5, fileOp)
|
||||
treeData = append(treeData, uploadTreeData...)
|
||||
|
||||
return treeData
|
||||
}
|
||||
|
||||
func loadDownloadTree(fileOp fileUtils.FileOp) []dto.CleanTree {
|
||||
var treeData []dto.CleanTree
|
||||
path1 := path.Join(global.CONF.System.BaseDir, "1panel/download/app")
|
||||
list1 := loadTreeWithAllFile(true, path1, "download_app", path1, fileOp)
|
||||
size1, _ := fileOp.GetDirSize(path1)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "download_app", Size: uint64(size1), Children: list1, Type: "download_app", IsRecommend: true})
|
||||
|
||||
path2 := path.Join(global.CONF.System.BaseDir, "1panel/download/website")
|
||||
list2 := loadTreeWithAllFile(true, path2, "download_website", path2, fileOp)
|
||||
size2, _ := fileOp.GetDirSize(path2)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "download_website", Size: uint64(size2), Children: list2, Type: "download_website", IsRecommend: true})
|
||||
|
||||
path3 := path.Join(global.CONF.System.BaseDir, "1panel/download/database")
|
||||
list3 := loadTreeWithAllFile(true, path3, "download_app", path3, fileOp)
|
||||
size3, _ := fileOp.GetDirSize(path3)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "download_database", Size: uint64(size3), Children: list3, Type: "download_database", IsRecommend: true})
|
||||
|
||||
path4 := path.Join(global.CONF.System.BaseDir, "1panel/download/directory")
|
||||
list4 := loadTreeWithAllFile(true, path4, "download_app", path4, fileOp)
|
||||
size4, _ := fileOp.GetDirSize(path4)
|
||||
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "download_directory", Size: uint64(size4), Children: list4, Type: "download_directory", IsRecommend: true})
|
||||
|
||||
path5 := path.Join(global.CONF.System.BaseDir, "1panel/download")
|
||||
uploadTreeData := loadTreeWithAllFile(true, path5, "download", path5, fileOp)
|
||||
treeData = append(treeData, uploadTreeData...)
|
||||
|
||||
return treeData
|
||||
}
|
||||
|
||||
func loadLogTree(fileOp fileUtils.FileOp) []dto.CleanTree {
|
||||
var treeData []dto.CleanTree
|
||||
path1 := path.Join(global.CONF.System.BaseDir, "1panel/log")
|
||||
@ -318,6 +390,9 @@ func loadTreeWithAllFile(isCheck bool, originalPath, treeType, pathItem string,
|
||||
if treeType == "system_log" && file.Name() == "1Panel.log" {
|
||||
continue
|
||||
}
|
||||
if (treeType == "upload" || treeType == "download") && file.IsDir() && (file.Name() == "app" || file.Name() == "database" || file.Name() == "website" || file.Name() == "directory") {
|
||||
continue
|
||||
}
|
||||
size := uint64(0)
|
||||
name := strings.TrimPrefix(path.Join(pathItem, file.Name()), originalPath+"/")
|
||||
if file.IsDir() {
|
||||
|
@ -1038,6 +1038,7 @@ const message = {
|
||||
newPassword: 'New password',
|
||||
retryPassword: 'Confirm password',
|
||||
duplicatePassword: 'The new password cannot be the same as the original password, please re-enter!',
|
||||
diskClean: 'Cache Clean',
|
||||
|
||||
thirdParty: 'Third-party account',
|
||||
createBackupAccount: 'Add {0}',
|
||||
@ -1224,7 +1225,7 @@ const message = {
|
||||
|
||||
system: 'System Junk',
|
||||
systemHelper:
|
||||
'Scan system junk (specifically includes temporary files generated during snapshots, upgrades, and obsolete file contents during version iterations)',
|
||||
'Temporary files generated during snapshots, upgrades, and obsolete file contents during version iterations',
|
||||
panelOriginal: 'System snapshot recovery backup files',
|
||||
upgrade: 'System upgrade backup files',
|
||||
cache: 'System cache files',
|
||||
@ -1237,11 +1238,9 @@ const message = {
|
||||
oldAppsBak: 'Unused application backup directories',
|
||||
|
||||
upload: 'Temporary upload files',
|
||||
uploadHelper:
|
||||
'Scan temporary upload directory (specifically includes temporary files uploaded from the system backup list)',
|
||||
uploadHelper: 'Temporary files uploaded from the system backup list',
|
||||
download: 'Temporary Download Files',
|
||||
downloadHelper:
|
||||
'Scan temporary download directory (specifically includes temporary files downloaded from third-party backup accounts by the system)',
|
||||
downloadHelper: 'Temporary files downloaded from third-party backup accounts by the system',
|
||||
website: 'Website',
|
||||
app: 'Application',
|
||||
database: 'Database',
|
||||
@ -1249,7 +1248,7 @@ const message = {
|
||||
|
||||
systemLog: 'System Log Files',
|
||||
systemLogHelper:
|
||||
'Scan system junk (specifically includes system log information, container build or image pull log information, and log files generated in scheduled tasks)',
|
||||
'System log information, container build or image pull log information, and log files generated in scheduled tasks',
|
||||
dockerLog: 'Container operation log files',
|
||||
taskLog: 'Scheduled task execution log files',
|
||||
shell: 'Shell script scheduled tasks',
|
||||
|
@ -995,6 +995,7 @@ const message = {
|
||||
newPassword: '新密碼',
|
||||
retryPassword: '確認密碼',
|
||||
duplicatePassword: '新密碼不能與原始密碼一致,請重新輸入!',
|
||||
diskClean: '缓存清理',
|
||||
|
||||
thirdParty: '第三方賬號',
|
||||
createBackupAccount: '添加 {0}',
|
||||
@ -1162,7 +1163,7 @@ const message = {
|
||||
selectScan: '已選中垃圾文件共計: ',
|
||||
|
||||
system: '系統垃圾',
|
||||
systemHelper: '掃描系統垃圾(具體包括:快照、升級等過程中產生的臨時文件以及版本叠代過程中廢棄的文件內容)',
|
||||
systemHelper: '快照、升級等過程中產生的臨時文件以及版本叠代過程中廢棄的文件內容',
|
||||
panelOriginal: '系統快照恢復前備份文件',
|
||||
upgrade: '系統升級備份文件',
|
||||
cache: '系統緩存文件',
|
||||
@ -1175,17 +1176,16 @@ const message = {
|
||||
oldAppsBak: '廢棄應用備份目錄',
|
||||
|
||||
upload: '臨時上傳文件',
|
||||
uploadHelper: '掃描臨時上傳目錄(具體包括:系統上傳備份列表中上傳的臨時文件)',
|
||||
uploadHelper: '系統上傳備份列表中上傳的臨時文件',
|
||||
download: '臨時下載文件',
|
||||
downloadHelper: '掃描臨時下載目錄(具體包括:系統從第三方備份賬號下載的臨時文件)',
|
||||
downloadHelper: '系統從第三方備份賬號下載的臨時文件',
|
||||
website: '網站',
|
||||
app: '應用',
|
||||
database: '數據庫',
|
||||
directory: '應用',
|
||||
|
||||
systemLog: '系統日誌文件',
|
||||
systemLogHelper:
|
||||
'掃描系統垃圾(具體包括:系統日誌信息、容器構建或鏡像拉取等日誌信息以及計劃任務中產生的日誌文件)',
|
||||
systemLogHelper: '系統日誌信息、容器構建或鏡像拉取等日誌信息以及計劃任務中產生的日誌文件',
|
||||
dockerLog: '容器操作日誌文件',
|
||||
taskLog: '計劃任務執行日誌文件',
|
||||
shell: 'Shell 腳本計劃任務',
|
||||
|
@ -995,7 +995,7 @@ const message = {
|
||||
newPassword: '新密码',
|
||||
retryPassword: '确认密码',
|
||||
duplicatePassword: '新密码不能与原始密码一致,请重新输入!',
|
||||
diskClean: '磁盘清理',
|
||||
diskClean: '缓存清理',
|
||||
|
||||
thirdParty: '第三方账号',
|
||||
createBackupAccount: '添加 {0}',
|
||||
@ -1162,7 +1162,7 @@ const message = {
|
||||
selectScan: '已选中垃圾文件共计: ',
|
||||
|
||||
system: '系统垃圾',
|
||||
systemHelper: '扫描系统垃圾(具体包括:快照、升级等过程中产生的临时文件以及版本迭代过程中废弃的文件内容)',
|
||||
systemHelper: '快照、升级等过程中产生的临时文件以及版本迭代过程中废弃的文件内容',
|
||||
panelOriginal: '系统快照恢复前备份文件',
|
||||
upgrade: '系统升级备份文件',
|
||||
cache: '系统缓存文件',
|
||||
@ -1175,17 +1175,16 @@ const message = {
|
||||
oldAppsBak: '废弃应用备份目录',
|
||||
|
||||
upload: '临时上传文件',
|
||||
uploadHelper: '扫描临时上传目录(具体包括:系统上传备份列表中上传的临时文件)',
|
||||
uploadHelper: '系统上传备份列表中上传的临时文件',
|
||||
download: '临时下载文件',
|
||||
downloadHelper: '扫描临时下载目录(具体包括:系统从第三方备份账号下载的临时文件)',
|
||||
downloadHelper: '系统从第三方备份账号下载的临时文件',
|
||||
website: '网站',
|
||||
app: '应用',
|
||||
database: '数据库',
|
||||
directory: '应用',
|
||||
|
||||
systemLog: '系统日志文件',
|
||||
systemLogHelper:
|
||||
'扫描系统垃圾(具体包括:系统日志信息、容器构建或镜像拉取等日志信息以及计划任务中产生的日志文件)',
|
||||
systemLogHelper: '系统日志信息、容器构建或镜像拉取等日志信息以及计划任务中产生的日志文件',
|
||||
dockerLog: '容器操作日志文件',
|
||||
taskLog: '计划任务执行日志文件',
|
||||
shell: 'Shell 脚本计划任务',
|
||||
|
@ -5,223 +5,225 @@
|
||||
<DrawerHeader :header="$t('setting.diskClean')" :back="handleClose" />
|
||||
</template>
|
||||
<div v-loading="loading">
|
||||
<div v-if="scanStatus !== 'scanned'">
|
||||
<div v-if="scanStatus === 'beforeScan'">
|
||||
<el-text class="clean_title" type="success">
|
||||
{{ $t('clean.lastCleanTime', [form.lastCleanTime || '-']) }}
|
||||
</el-text>
|
||||
<div class="mt-4">
|
||||
<el-text type="success">
|
||||
{{
|
||||
$t('clean.lastCleanHelper', [
|
||||
form.lastCleanData || '-',
|
||||
form.lastCleanSize ? computeSize(Number(form.lastCleanSize)) : '-',
|
||||
])
|
||||
}}
|
||||
</el-text>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-col :span="22">
|
||||
<div v-if="scanStatus !== 'scanned'">
|
||||
<div v-if="scanStatus === 'beforeScan'">
|
||||
<el-text class="clean_title" type="success">
|
||||
{{ $t('clean.lastCleanTime', [form.lastCleanTime || '-']) }}
|
||||
</el-text>
|
||||
<div class="mt-4">
|
||||
<el-text type="success">
|
||||
{{
|
||||
$t('clean.lastCleanHelper', [
|
||||
form.lastCleanData || '-',
|
||||
form.lastCleanSize ? computeSize(Number(form.lastCleanSize)) : '-',
|
||||
])
|
||||
}}
|
||||
</el-text>
|
||||
</div>
|
||||
<div class="large_button">
|
||||
<el-button type="primary" size="large" @click="scanData">
|
||||
{{ $t('clean.scan') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="scanStatus === 'afterScan'">
|
||||
<el-text class="clean_title" type="success">{{ $t('clean.cleanSuccessful') }}</el-text>
|
||||
<div class="mt-4">
|
||||
<el-text type="success">
|
||||
{{
|
||||
$t('clean.currentCleanHelper', [
|
||||
form.lastCleanData,
|
||||
computeSize(Number(form.lastCleanSize)),
|
||||
])
|
||||
}}
|
||||
</el-text>
|
||||
</div>
|
||||
<div class="large_button">
|
||||
<el-button type="success" size="large" @click="scanData">
|
||||
{{ $t('clean.reScan') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="app-card">
|
||||
<el-card class="e-card">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-button icon="Setting" link class="card_icon" />
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<div>
|
||||
<el-text class="mx-1 card_title" type="primary">
|
||||
{{ $t('clean.system') }}
|
||||
</el-text>
|
||||
</div>
|
||||
<span class="input-help">{{ $t('clean.systemHelper') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card class="e-card">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-button icon="Upload" link class="card_icon" />
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<div>
|
||||
<el-text class="mx-1 card_title" type="primary">
|
||||
{{ $t('clean.upload') }}
|
||||
</el-text>
|
||||
</div>
|
||||
<span class="input-help">{{ $t('clean.uploadHelper') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card class="e-card">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-button icon="Download" link class="card_icon" />
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<div>
|
||||
<el-text class="mx-1 card_title" type="primary">
|
||||
{{ $t('clean.download') }}
|
||||
</el-text>
|
||||
</div>
|
||||
<span class="input-help">{{ $t('clean.downloadHelper') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card class="e-card">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-button icon="Document" link class="card_icon" />
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<div>
|
||||
<el-text class="mx-1 card_title" type="primary">
|
||||
{{ $t('clean.systemLog') }}
|
||||
</el-text>
|
||||
</div>
|
||||
<span class="input-help">
|
||||
{{ $t('clean.systemLogHelper') }}
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large_button">
|
||||
<el-button type="primary" size="large" @click="scanData">{{ $t('clean.scan') }}</el-button>
|
||||
<div v-if="scanStatus === 'scanned'">
|
||||
<div>
|
||||
<el-text class="clean_title" type="primary">
|
||||
{{ $t('clean.totalScan') }} {{ computeSize(totalSize) }}
|
||||
</el-text>
|
||||
<div class="mt-4">
|
||||
<el-text type="info">
|
||||
{{ $t('clean.selectScan') }} {{ computeSize(selectSize) }}
|
||||
</el-text>
|
||||
</div>
|
||||
<div class="large_button">
|
||||
<el-button type="primary" size="large" @click="onSubmitClean">
|
||||
{{ $t('clean.clean') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-collapse class="mt-12" v-model="activeNames">
|
||||
<el-collapse-item :title="$t('clean.system')" name="system">
|
||||
<el-tree
|
||||
ref="systemRef"
|
||||
:data="cleanData.systemClean"
|
||||
node-key="id"
|
||||
:default-checked-keys="systemDefaultCheck"
|
||||
show-checkbox
|
||||
:props="defaultProps"
|
||||
@check-change="onChange"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="float-left">
|
||||
<span>{{ load18n(data.label) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span v-if="data.size">{{ computeSize(data.size) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span>{{ loadTag(node, data) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('clean.upload')" name="upload">
|
||||
<el-tree
|
||||
ref="uploadRef"
|
||||
:data="cleanData.uploadClean"
|
||||
node-key="id"
|
||||
:default-checked-keys="uploadDefaultCheck"
|
||||
show-checkbox
|
||||
:props="defaultProps"
|
||||
@check-change="onChange"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="float-left">
|
||||
<span>{{ load18n(data.label) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span v-if="data.size">{{ computeSize(data.size) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span>{{ loadTag(node, data) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('clean.download')" name="download">
|
||||
<el-tree
|
||||
ref="downloadRef"
|
||||
:data="cleanData.downloadClean"
|
||||
node-key="id"
|
||||
:default-checked-keys="downloadDefaultCheck"
|
||||
show-checkbox
|
||||
:props="defaultProps"
|
||||
@check-change="onChange"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="float-left">
|
||||
<span>{{ load18n(data.label) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span v-if="data.size">{{ computeSize(data.size) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span>{{ loadTag(node, data) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('clean.systemLog')" name="system_log">
|
||||
<el-tree
|
||||
ref="systemLogRef"
|
||||
:data="cleanData.systemLogClean"
|
||||
node-key="id"
|
||||
:default-checked-keys="systemLogDefaultCheck"
|
||||
show-checkbox
|
||||
:props="defaultProps"
|
||||
@check-change="onChange"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="float-left">
|
||||
<span>{{ load18n(data.label) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span v-if="data.size">{{ computeSize(data.size) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span>{{ loadTag(node, data) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="scanStatus === 'afterScan'">
|
||||
<el-text class="clean_title" type="success">{{ $t('clean.cleanSuccessful') }}</el-text>
|
||||
<div class="mt-4">
|
||||
<el-text type="success">
|
||||
{{
|
||||
$t('clean.currentCleanHelper', [
|
||||
form.lastCleanData,
|
||||
computeSize(Number(form.lastCleanSize)),
|
||||
])
|
||||
}}
|
||||
</el-text>
|
||||
</div>
|
||||
<div class="large_button">
|
||||
<el-button type="primary" size="large" @click="scanData">
|
||||
{{ $t('clean.reScan') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="app-card">
|
||||
<el-card class="e-card">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-button icon="Setting" link class="card_icon" />
|
||||
</el-col>
|
||||
<el-col :span="21">
|
||||
<div>
|
||||
<el-text class="mx-1 card_title" type="primary">
|
||||
{{ $t('clean.system') }}
|
||||
</el-text>
|
||||
</div>
|
||||
<span>{{ $t('clean.systemHelper') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card class="e-card">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-button icon="Upload" link class="card_icon" />
|
||||
</el-col>
|
||||
<el-col :span="21">
|
||||
<div>
|
||||
<el-text class="mx-1 card_title" type="primary">
|
||||
{{ $t('clean.upload') }}
|
||||
</el-text>
|
||||
</div>
|
||||
<span>{{ $t('clean.uploadHelper') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card class="e-card">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-button icon="Download" link class="card_icon" />
|
||||
</el-col>
|
||||
<el-col :span="21">
|
||||
<div>
|
||||
<el-text class="mx-1 card_title" type="primary">
|
||||
{{ $t('clean.download') }}
|
||||
</el-text>
|
||||
</div>
|
||||
<span>{{ $t('clean.downloadHelper') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card class="e-card">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-button icon="Document" link class="card_icon" />
|
||||
</el-col>
|
||||
<el-col :span="21">
|
||||
<div>
|
||||
<el-text class="mx-1 card_title" type="primary">
|
||||
{{ $t('clean.systemLog') }}
|
||||
</el-text>
|
||||
</div>
|
||||
<span>
|
||||
{{ $t('clean.systemLogHelper') }}
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="scanStatus === 'scanned'">
|
||||
<div>
|
||||
<el-text class="clean_title" type="primary">
|
||||
{{ $t('clean.totalScan') }} {{ computeSize(totalSize) }}
|
||||
</el-text>
|
||||
<div class="mt-4">
|
||||
<el-text type="info">{{ $t('clean.selectScan') }} {{ computeSize(selectSize) }}</el-text>
|
||||
</div>
|
||||
<div class="large_button">
|
||||
<el-button type="primary" size="large" @click="onSubmitClean">
|
||||
{{ $t('clean.clean') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-collapse class="mt-4" v-model="activeNames">
|
||||
<el-collapse-item :title="$t('clean.system')" name="system">
|
||||
<el-tree
|
||||
ref="systemRef"
|
||||
:data="cleanData.systemClean"
|
||||
node-key="id"
|
||||
:default-checked-keys="systemDefaultCheck"
|
||||
show-checkbox
|
||||
:props="defaultProps"
|
||||
@check-change="onChange"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="float-left">
|
||||
<span>{{ load18n(data.label) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span v-if="data.size">{{ computeSize(data.size) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span>{{ loadTag(node, data) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('clean.upload')" name="upload">
|
||||
<el-tree
|
||||
ref="uploadRef"
|
||||
:data="cleanData.uploadClean"
|
||||
node-key="id"
|
||||
:default-checked-keys="uploadDefaultCheck"
|
||||
show-checkbox
|
||||
:props="defaultProps"
|
||||
@check-change="onChange"
|
||||
>
|
||||
<template #empty>
|
||||
<el-empty :image-size="60" :description="$t('clean.statusEmpty')" />
|
||||
</template>
|
||||
<template #default="{ node, data }">
|
||||
<div class="float-left">
|
||||
<span>{{ load18n(data.label) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span v-if="data.size">{{ computeSize(data.size) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span>{{ loadTag(node, data) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('clean.download')" name="download">
|
||||
<el-tree
|
||||
ref="downloadRef"
|
||||
:data="cleanData.downloadClean"
|
||||
node-key="id"
|
||||
:default-checked-keys="downloadDefaultCheck"
|
||||
show-checkbox
|
||||
:props="defaultProps"
|
||||
@check-change="onChange"
|
||||
>
|
||||
<template #empty>
|
||||
<el-empty :image-size="60" :description="$t('clean.statusEmpty')" />
|
||||
</template>
|
||||
<template #default="{ node, data }">
|
||||
<div class="float-left">
|
||||
<span>{{ load18n(data.label) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span v-if="data.size">{{ computeSize(data.size) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span>{{ loadTag(node, data) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('clean.systemLog')" name="system_log">
|
||||
<el-tree
|
||||
ref="systemLogRef"
|
||||
:data="cleanData.systemLogClean"
|
||||
node-key="id"
|
||||
:default-checked-keys="systemLogDefaultCheck"
|
||||
show-checkbox
|
||||
:props="defaultProps"
|
||||
@check-change="onChange"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="float-left">
|
||||
<span>{{ load18n(data.label) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span v-if="data.size">{{ computeSize(data.size) }}</span>
|
||||
</div>
|
||||
<div class="ml-4 float-left">
|
||||
<span>{{ loadTag(node, data) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
@ -464,13 +466,17 @@ function load18n(label: string) {
|
||||
return i18n.global.t('clean.upload');
|
||||
case 'download':
|
||||
return i18n.global.t('clean.download');
|
||||
case 'website':
|
||||
case 'upload_website':
|
||||
case 'download_website':
|
||||
return i18n.global.t('clean.website');
|
||||
case 'app':
|
||||
case 'upload_app':
|
||||
case 'download_app':
|
||||
return i18n.global.t('clean.app');
|
||||
case 'database':
|
||||
case 'upload_database':
|
||||
case 'download_database':
|
||||
return i18n.global.t('clean.database');
|
||||
case 'directory':
|
||||
case 'upload_directory':
|
||||
case 'download_directory':
|
||||
return i18n.global.t('clean.directory');
|
||||
case 'system_log':
|
||||
return i18n.global.t('clean.systemLog');
|
||||
|
@ -74,6 +74,25 @@
|
||||
</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('setting.defaultNetwork')">
|
||||
<el-input disabled v-model="form.defaultNetworkVal">
|
||||
<template #append>
|
||||
<el-button v-show="!show" @click="onChangeNetwork" icon="Setting">
|
||||
{{ $t('commons.button.set') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('setting.diskClean')">
|
||||
<el-input disabled v-model="form.lastCleanTime">
|
||||
<template #append>
|
||||
<el-button v-show="!show" @click="onClean" icon="Setting">
|
||||
{{ $t('commons.button.set') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('setting.timeZone')" prop="timeZone">
|
||||
<el-input disabled v-model.number="form.timeZone">
|
||||
<template #append>
|
||||
@ -108,24 +127,6 @@
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('setting.defaultNetwork')">
|
||||
<el-input disabled v-model="form.defaultNetworkVal">
|
||||
<template #append>
|
||||
<el-button v-show="!show" @click="onChangeNetwork" icon="Setting">
|
||||
{{ $t('commons.button.set') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('setting.diskClean')">
|
||||
<el-input disabled v-model="form.lastCleanTime">
|
||||
<template #append>
|
||||
<el-button v-show="!show" @click="onClean" icon="Setting">
|
||||
{{ $t('commons.button.set') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
Loading…
Reference in New Issue
Block a user