1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 优化缓存清理界面样式 (#3733)

![image](https://github.com/1Panel-dev/1Panel/assets/73214554/30426b21-0bf8-4e3f-b59b-2016ae4b55b9)
This commit is contained in:
ssongliu 2024-01-29 10:28:49 +08:00 committed by GitHub
parent aa8429a836
commit 0ee942cbef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 36 additions and 23 deletions

View File

@ -85,11 +85,12 @@ func (u *SnapshotService) SnapshotImport(req dto.SnapshotImport) error {
snap = strings.ReplaceAll(snap, ".tar.gz", "")
}
itemSnap := model.Snapshot{
Name: snap,
From: req.From,
Version: nameItems[1],
Description: req.Description,
Status: constant.StatusSuccess,
Name: snap,
From: req.From,
DefaultDownload: req.From,
Version: nameItems[1],
Description: req.Description,
Status: constant.StatusSuccess,
BaseModel: model.BaseModel{
CreatedAt: formatTime,
UpdatedAt: formatTime,

View File

@ -90,6 +90,7 @@ export namespace Setting {
export interface SnapshotCreate {
id: number;
from: string;
fromAccounts: Array<string>;
defaultDownload: string;
description: string;
}

View File

@ -823,7 +823,7 @@ const message = {
retainCopies: 'Retain copies',
retainCopiesHelper: 'Number of copies to retain for execution records and logs',
retainCopiesHelper1: 'Number of copies to retain for backup files',
retainCopiesUnit: ' copies',
retainCopiesUnit: ' copies (View)',
cronSpecRule: 'Please enter a correct lifecycle',
perMonth: 'Every monthly',
perWeek: 'Every week',
@ -1441,6 +1441,7 @@ const message = {
},
clean: {
scan: 'Start Scanning',
scanHelper: 'Easily tidy up junk files accumulated during 1Panel runtime',
clean: 'Clean Now',
reScan: 'Rescan',
cleanHelper:

View File

@ -784,7 +784,7 @@ const message = {
retainCopies: '保留份數',
retainCopiesHelper: '執行記錄及日誌保留份数',
retainCopiesHelper1: '備份文件保留份数',
retainCopiesUnit: ' ',
retainCopiesUnit: ' (查看)',
cronSpecRule: '請輸入正確的執行周期',
perMonth: '每月',
perWeek: '每周',
@ -1348,6 +1348,7 @@ const message = {
},
clean: {
scan: '開始掃描',
scanHelper: '輕鬆梳理 1Panel 運行期間積累的垃圾文件',
clean: '立即清理',
reScan: '重新掃描',
cleanHelper: '已勾選文件及目錄清理後無法回滾系統緩存文件清理需要重啟服務是否繼續',

View File

@ -785,7 +785,7 @@ const message = {
retainCopies: '保留份数',
retainCopiesHelper: '执行记录及日志保留份数',
retainCopiesHelper1: '备份文件保留份数',
retainCopiesUnit: ' ',
retainCopiesUnit: ' (查看)',
cronSpecRule: '请输入正确的执行周期',
perMonth: '每月',
perWeek: '每周',
@ -1349,6 +1349,7 @@ const message = {
},
clean: {
scan: '开始扫描',
scanHelper: '轻松梳理 1Panel 运行期间积累的垃圾文件',
clean: '立即清理',
reScan: '重新扫描',
cleanHelper: '已勾选文件及目录清理后无法回滚系统缓存文件清理需要重启服务是否继续',

View File

@ -143,8 +143,8 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('cronjob.default_download_path')" prop="default_download">
<el-select v-model="snapInfo.default_download" clearable>
<el-form-item :label="$t('cronjob.default_download_path')" prop="defaultDownload">
<el-select v-model="snapInfo.defaultDownload" clearable>
<el-option
v-for="item in accountOptions"
:key="item.label"
@ -217,13 +217,13 @@ type FormInstance = InstanceType<typeof ElForm>;
const snapRef = ref<FormInstance>();
const rules = reactive({
fromAccounts: [Rules.requiredSelect],
default_download: [Rules.requiredSelect],
defaultDownload: [Rules.requiredSelect],
});
let snapInfo = reactive<Setting.SnapshotCreate>({
id: 0,
from: '',
default_download: '',
defaultDownload: '',
fromAccounts: [],
description: '',
});

View File

@ -16,17 +16,25 @@
<el-col :xs="24" :sm="20" :md="20" :lg="10" :xl="10">
<div v-if="scanStatus !== 'scanned'">
<div v-if="scanStatus === 'beforeScan'">
<el-text class="clean_title">
{{ $t('clean.lastCleanTime', [form.lastCleanTime || '-']) }}
</el-text>
<div class="mt-4">
<el-text>
{{
$t('clean.lastCleanHelper', [
form.lastCleanData || '-',
form.lastCleanSize ? computeSize(Number(form.lastCleanSize)) : '-',
])
}}
<div v-if="form.lastCleanTime">
<el-text class="clean_title">
{{ $t('clean.lastCleanTime', [form.lastCleanTime || '-']) }}
</el-text>
<div class="mt-4">
<el-text>
{{
$t('clean.lastCleanHelper', [
form.lastCleanData || '-',
form.lastCleanSize ? computeSize(Number(form.lastCleanSize)) : '-',
])
}}
</el-text>
</div>
</div>
<div else>
<el-text class="clean_title">
<el-icon><MagicStick /></el-icon>
{{ $t('clean.scanHelper') }}
</el-text>
</div>
<div class="app-card">