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;