From 11d3e981555dedff813b99c2451f6ebaa8761c39 Mon Sep 17 00:00:00 2001
From: ssongliu <73214554+ssongliu@users.noreply.github.com>
Date: Wed, 12 Apr 2023 18:56:33 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=A1=E5=88=92=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA=E6=A0=B7=E5=BC=8F=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=20(#600)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/lang/modules/en.ts | 6 ++---
frontend/src/lang/modules/zh.ts | 5 ++--
frontend/src/views/cronjob/record/index.vue | 26 +++++++++++++++++++--
3 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index c84575564..d96a5f2ee 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -78,7 +78,8 @@ const message = {
Rollbacking: 'Rollbacking from snapshot, please wait...',
},
msg: {
- delete: 'This operation cannot be rolled back. Do you want to continue',
+ delete: 'This operation delete cannot be rolled back. Do you want to continue?',
+ clean: 'This operation clean cannot be rolled back. Do you want to continue?',
deleteTitle: 'Delete',
deleteSuccess: 'Delete Success',
loginSuccess: 'Login Success',
@@ -628,8 +629,7 @@ const message = {
errHandle: 'Task execution failure',
noRecord: 'The execution did not generate any logs',
cleanData: 'Clean data',
- cleanDataHelper:
- 'Clean data will remove all data generated by this scheduled task, including backup files, execution records, and log files.',
+ cleanDataHelper: 'Delete the backup file generated during this task.',
noLogs: 'No task output yet...',
errPath: 'Backup path [{0}] error, cannot download!',
},
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index ef70ded4d..a1ea96f06 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -81,6 +81,7 @@ const message = {
},
msg: {
delete: '删除 操作不可回滚,是否继续',
+ clean: '清空 操作不可回滚,是否继续',
deleteTitle: '删除',
deleteSuccess: '删除成功',
loginSuccess: '登录成功',
@@ -628,8 +629,8 @@ const message = {
errRecord: '错误的日志记录',
errHandle: '任务执行失败',
noRecord: '当前计划任务暂未产生记录',
- cleanData: '删除数据',
- cleanDataHelper: '删除数据,将删除该计划任务产生的所有数据,包括备份文件、执行记录以及日志文件',
+ cleanData: '删除备份文件',
+ cleanDataHelper: '删除该任务执行过程中产生的备份文件',
noLogs: '暂无任务输出...',
errPath: '备份路径 [{0}] 错误,无法下载!',
},
diff --git a/frontend/src/views/cronjob/record/index.vue b/frontend/src/views/cronjob/record/index.vue
index e3fd6272e..fbdcacc4e 100644
--- a/frontend/src/views/cronjob/record/index.vue
+++ b/frontend/src/views/cronjob/record/index.vue
@@ -70,7 +70,7 @@
{{ $t('commons.button.enable') }}
-
+
{{ $t('commons.button.clean') }}
@@ -576,9 +576,31 @@ const loadRecord = async (row: Cronjob.Record) => {
currentRecordDetail.value = res.data;
}
};
+
+const onClean = async () => {
+ if (dialogData.value.rowData.type === 'shell' || dialogData.value.rowData.type === 'curl') {
+ ElMessageBox.confirm(i18n.global.t('commons.msg.clean'), i18n.global.t('commons.msg.deleteTitle'), {
+ confirmButtonText: i18n.global.t('commons.button.confirm'),
+ cancelButtonText: i18n.global.t('commons.button.cancel'),
+ type: 'warning',
+ }).then(async () => {
+ await cleanRecords(dialogData.value.rowData.id, cleanData.value)
+ .then(() => {
+ delLoading.value = false;
+ MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
+ search(true);
+ })
+ .catch(() => {
+ delLoading.value = false;
+ });
+ });
+ } else {
+ deleteVisiable.value = true;
+ }
+};
+
const cleanRecord = async () => {
delLoading.value = true;
- console.log(dialogData.value.rowData);
await cleanRecords(dialogData.value.rowData.id, cleanData.value)
.then(() => {
delLoading.value = false;