diff --git a/frontend/src/components/backup/index.vue b/frontend/src/components/backup/index.vue index 73deceb1f..175b8ea6b 100644 --- a/frontend/src/components/backup/index.vue +++ b/frontend/src/components/backup/index.vue @@ -122,40 +122,58 @@ const search = async () => { }; const onBackup = async () => { - let params = { - type: type.value, - name: name.value, - detailName: detailName.value, - }; - loading.value = true; - await handleBackup(params) - .then(() => { - loading.value = false; - MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); - search(); - }) - .catch(() => { - loading.value = false; - }); + ElMessageBox.confirm( + i18n.global.t('commons.msg.backupHelper', [name.value + '( ' + detailName.value + ' )']), + i18n.global.t('commons.button.backup'), + { + confirmButtonText: i18n.global.t('commons.button.confirm'), + cancelButtonText: i18n.global.t('commons.button.cancel'), + }, + ).then(async () => { + let params = { + type: type.value, + name: name.value, + detailName: detailName.value, + }; + loading.value = true; + await handleBackup(params) + .then(() => { + loading.value = false; + MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); + search(); + }) + .catch(() => { + loading.value = false; + }); + }); }; const onRecover = async (row: Backup.RecordInfo) => { - let params = { - source: row.source, - type: type.value, - name: name.value, - detailName: detailName.value, - file: row.fileDir + '/' + row.fileName, - }; - loading.value = true; - await handleRecover(params) - .then(() => { - loading.value = false; - MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); - }) - .catch(() => { - loading.value = false; - }); + ElMessageBox.confirm( + i18n.global.t('commons.msg.recoverHelper', [row.fileName]), + i18n.global.t('commons.button.recover'), + { + confirmButtonText: i18n.global.t('commons.button.confirm'), + cancelButtonText: i18n.global.t('commons.button.cancel'), + }, + ).then(async () => { + let params = { + source: row.source, + type: type.value, + name: name.value, + detailName: detailName.value, + file: row.fileDir + '/' + row.fileName, + }; + loading.value = true; + await handleRecover(params) + .then(() => { + loading.value = false; + MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); + }) + .catch(() => { + loading.value = false; + }); + }); }; const onDownload = async (row: Backup.RecordInfo) => { diff --git a/frontend/src/components/upload/index.vue b/frontend/src/components/upload/index.vue index b6fb0cbb9..3c7f866a3 100644 --- a/frontend/src/components/upload/index.vue +++ b/frontend/src/components/upload/index.vue @@ -169,18 +169,21 @@ const search = async () => { }; const onRecover = async (row: File.File) => { - let params = { - source: 'LOCAL', - type: type.value, - name: name.value, - detailName: detailName.value, - file: baseDir.value + row.name, - }; - ElMessageBox.confirm(i18n.global.t('commons.msg.recoverHelper'), i18n.global.t('commons.button.recover'), { - confirmButtonText: i18n.global.t('commons.button.confirm'), - cancelButtonText: i18n.global.t('commons.button.cancel'), - type: 'info', - }).then(async () => { + ElMessageBox.confirm( + i18n.global.t('commons.msg.recoverHelper', [row.name]), + i18n.global.t('commons.button.recover'), + { + confirmButtonText: i18n.global.t('commons.button.confirm'), + cancelButtonText: i18n.global.t('commons.button.cancel'), + }, + ).then(async () => { + let params = { + source: 'LOCAL', + type: type.value, + name: name.value, + detailName: detailName.value, + file: baseDir.value + row.name, + }; loading.value = true; await handleRecoverByUpload(params) .then(() => { diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 3db26e76f..2b68f46e8 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -125,7 +125,8 @@ const message = { confirmNoNull: 'Make sure the value {0} is not empty', errPort: 'Incorrect port information, please confirm!', remove: 'Remove', - recoverHelper: 'The current data will be overwritten. Do you want to continue?', + backupHelper: 'The current operation will back up {0}. Do you want to proceed?', + recoverHelper: 'Restoring from {0} file. This operation is irreversible. Do you want to continue?', }, login: { username: 'UserName', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index eb6342421..d94c5fcde 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -91,7 +91,7 @@ const message = { loadingText: { Upgrading: '系統升級中,請稍候...', Restarting: '系統重啟中,請稍候...', - Recovering: '從快照恢復中,請稍候...', + Recovering: '快照恢復中,請稍候...', Rollbacking: '快照回滾中,請稍候...', }, msg: { @@ -126,7 +126,8 @@ const message = { confirmNoNull: '請確認 {0} 值不為空', errPort: '錯誤的端口信息,請確認!', remove: '移出', - recoverHelper: '當前數據將被覆蓋,是否繼續?', + backupHelper: '當前操作將對 {0} 進行備份,是否繼續?', + recoverHelper: '將從 {0} 文件進行恢復,該操作不可回滾,是否繼續?', }, login: { username: '用戶名', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index fdf475d60..265dbe991 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -91,7 +91,7 @@ const message = { loadingText: { Upgrading: '系统升级中,请稍候...', Restarting: '系统重启中,请稍候...', - Recovering: '从快照恢复中,请稍候...', + Recovering: '快照恢复中,请稍候...', Rollbacking: '快照回滚中,请稍候...', }, msg: { @@ -126,7 +126,8 @@ const message = { confirmNoNull: '请确认 {0} 值不为空', errPort: '错误的端口信息,请确认!', remove: '移出', - recoverHelper: '当前数据将被覆盖,是否继续?', + backupHelper: '当前操作将对 {0} 进行备份,是否继续?', + recoverHelper: '将从 {0} 文件进行恢复,该操作不可回滚,是否继续?', }, login: { username: '用户名',