mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 11:09:16 +08:00
feat: 增加备份恢复确认框 (#3711)
This commit is contained in:
parent
a6891711b7
commit
527c8143a1
@ -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) => {
|
||||
|
@ -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(() => {
|
||||
|
@ -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',
|
||||
|
@ -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: '用戶名',
|
||||
|
@ -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: '用户名',
|
||||
|
Loading…
Reference in New Issue
Block a user