From 0ee942cbefb2179ef5b3f9c7dfc18063d091229c Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:28:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=B8=85=E7=90=86=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F=20(#3733?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ![image](https://github.com/1Panel-dev/1Panel/assets/73214554/30426b21-0bf8-4e3f-b59b-2016ae4b55b9) --- backend/app/service/snapshot.go | 11 +++---- frontend/src/api/interface/setting.ts | 1 + frontend/src/lang/modules/en.ts | 3 +- frontend/src/lang/modules/tw.ts | 3 +- frontend/src/lang/modules/zh.ts | 3 +- frontend/src/views/setting/snapshot/index.vue | 8 ++--- frontend/src/views/toolbox/clean/index.vue | 30 ++++++++++++------- 7 files changed, 36 insertions(+), 23 deletions(-) diff --git a/backend/app/service/snapshot.go b/backend/app/service/snapshot.go index 1129d21cd..3116f919e 100644 --- a/backend/app/service/snapshot.go +++ b/backend/app/service/snapshot.go @@ -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, diff --git a/frontend/src/api/interface/setting.ts b/frontend/src/api/interface/setting.ts index 7f02628bc..34adcf7b3 100644 --- a/frontend/src/api/interface/setting.ts +++ b/frontend/src/api/interface/setting.ts @@ -90,6 +90,7 @@ export namespace Setting { export interface SnapshotCreate { id: number; from: string; + fromAccounts: Array; defaultDownload: string; description: string; } diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index dc6762847..b46bcc59a 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -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: diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index b69d19b97..9788e36c2 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -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: '已勾選文件及目錄清理後無法回滾(系統緩存文件清理需要重啟服務),是否繼續?', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index bb1341188..ad117bc87 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -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: '已勾选文件及目录清理后无法回滚(系统缓存文件清理需要重启服务),是否继续?', diff --git a/frontend/src/views/setting/snapshot/index.vue b/frontend/src/views/setting/snapshot/index.vue index 20994c3df..2cc1781e9 100644 --- a/frontend/src/views/setting/snapshot/index.vue +++ b/frontend/src/views/setting/snapshot/index.vue @@ -143,8 +143,8 @@ /> - - + + ; const snapRef = ref(); const rules = reactive({ fromAccounts: [Rules.requiredSelect], - default_download: [Rules.requiredSelect], + defaultDownload: [Rules.requiredSelect], }); let snapInfo = reactive({ id: 0, from: '', - default_download: '', + defaultDownload: '', fromAccounts: [], description: '', }); diff --git a/frontend/src/views/toolbox/clean/index.vue b/frontend/src/views/toolbox/clean/index.vue index 140310c8e..ca7454589 100644 --- a/frontend/src/views/toolbox/clean/index.vue +++ b/frontend/src/views/toolbox/clean/index.vue @@ -16,17 +16,25 @@
- - {{ $t('clean.lastCleanTime', [form.lastCleanTime || '-']) }} - -
- - {{ - $t('clean.lastCleanHelper', [ - form.lastCleanData || '-', - form.lastCleanSize ? computeSize(Number(form.lastCleanSize)) : '-', - ]) - }} +
+ + {{ $t('clean.lastCleanTime', [form.lastCleanTime || '-']) }} + +
+ + {{ + $t('clean.lastCleanHelper', [ + form.lastCleanData || '-', + form.lastCleanSize ? computeSize(Number(form.lastCleanSize)) : '-', + ]) + }} + +
+
+
+ + + {{ $t('clean.scanHelper') }}