mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 19:19:15 +08:00
feat: 增加备份恢复确认框 (#3711)
This commit is contained in:
parent
a6891711b7
commit
527c8143a1
@ -122,40 +122,58 @@ const search = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onBackup = async () => {
|
const onBackup = async () => {
|
||||||
let params = {
|
ElMessageBox.confirm(
|
||||||
type: type.value,
|
i18n.global.t('commons.msg.backupHelper', [name.value + '( ' + detailName.value + ' )']),
|
||||||
name: name.value,
|
i18n.global.t('commons.button.backup'),
|
||||||
detailName: detailName.value,
|
{
|
||||||
};
|
confirmButtonText: i18n.global.t('commons.button.confirm'),
|
||||||
loading.value = true;
|
cancelButtonText: i18n.global.t('commons.button.cancel'),
|
||||||
await handleBackup(params)
|
},
|
||||||
.then(() => {
|
).then(async () => {
|
||||||
loading.value = false;
|
let params = {
|
||||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
type: type.value,
|
||||||
search();
|
name: name.value,
|
||||||
})
|
detailName: detailName.value,
|
||||||
.catch(() => {
|
};
|
||||||
loading.value = false;
|
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) => {
|
const onRecover = async (row: Backup.RecordInfo) => {
|
||||||
let params = {
|
ElMessageBox.confirm(
|
||||||
source: row.source,
|
i18n.global.t('commons.msg.recoverHelper', [row.fileName]),
|
||||||
type: type.value,
|
i18n.global.t('commons.button.recover'),
|
||||||
name: name.value,
|
{
|
||||||
detailName: detailName.value,
|
confirmButtonText: i18n.global.t('commons.button.confirm'),
|
||||||
file: row.fileDir + '/' + row.fileName,
|
cancelButtonText: i18n.global.t('commons.button.cancel'),
|
||||||
};
|
},
|
||||||
loading.value = true;
|
).then(async () => {
|
||||||
await handleRecover(params)
|
let params = {
|
||||||
.then(() => {
|
source: row.source,
|
||||||
loading.value = false;
|
type: type.value,
|
||||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
name: name.value,
|
||||||
})
|
detailName: detailName.value,
|
||||||
.catch(() => {
|
file: row.fileDir + '/' + row.fileName,
|
||||||
loading.value = false;
|
};
|
||||||
});
|
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) => {
|
const onDownload = async (row: Backup.RecordInfo) => {
|
||||||
|
@ -169,18 +169,21 @@ const search = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onRecover = async (row: File.File) => {
|
const onRecover = async (row: File.File) => {
|
||||||
let params = {
|
ElMessageBox.confirm(
|
||||||
source: 'LOCAL',
|
i18n.global.t('commons.msg.recoverHelper', [row.name]),
|
||||||
type: type.value,
|
i18n.global.t('commons.button.recover'),
|
||||||
name: name.value,
|
{
|
||||||
detailName: detailName.value,
|
confirmButtonText: i18n.global.t('commons.button.confirm'),
|
||||||
file: baseDir.value + row.name,
|
cancelButtonText: i18n.global.t('commons.button.cancel'),
|
||||||
};
|
},
|
||||||
ElMessageBox.confirm(i18n.global.t('commons.msg.recoverHelper'), i18n.global.t('commons.button.recover'), {
|
).then(async () => {
|
||||||
confirmButtonText: i18n.global.t('commons.button.confirm'),
|
let params = {
|
||||||
cancelButtonText: i18n.global.t('commons.button.cancel'),
|
source: 'LOCAL',
|
||||||
type: 'info',
|
type: type.value,
|
||||||
}).then(async () => {
|
name: name.value,
|
||||||
|
detailName: detailName.value,
|
||||||
|
file: baseDir.value + row.name,
|
||||||
|
};
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await handleRecoverByUpload(params)
|
await handleRecoverByUpload(params)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
@ -125,7 +125,8 @@ const message = {
|
|||||||
confirmNoNull: 'Make sure the value {0} is not empty',
|
confirmNoNull: 'Make sure the value {0} is not empty',
|
||||||
errPort: 'Incorrect port information, please confirm!',
|
errPort: 'Incorrect port information, please confirm!',
|
||||||
remove: 'Remove',
|
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: {
|
login: {
|
||||||
username: 'UserName',
|
username: 'UserName',
|
||||||
|
@ -91,7 +91,7 @@ const message = {
|
|||||||
loadingText: {
|
loadingText: {
|
||||||
Upgrading: '系統升級中,請稍候...',
|
Upgrading: '系統升級中,請稍候...',
|
||||||
Restarting: '系統重啟中,請稍候...',
|
Restarting: '系統重啟中,請稍候...',
|
||||||
Recovering: '從快照恢復中,請稍候...',
|
Recovering: '快照恢復中,請稍候...',
|
||||||
Rollbacking: '快照回滾中,請稍候...',
|
Rollbacking: '快照回滾中,請稍候...',
|
||||||
},
|
},
|
||||||
msg: {
|
msg: {
|
||||||
@ -126,7 +126,8 @@ const message = {
|
|||||||
confirmNoNull: '請確認 {0} 值不為空',
|
confirmNoNull: '請確認 {0} 值不為空',
|
||||||
errPort: '錯誤的端口信息,請確認!',
|
errPort: '錯誤的端口信息,請確認!',
|
||||||
remove: '移出',
|
remove: '移出',
|
||||||
recoverHelper: '當前數據將被覆蓋,是否繼續?',
|
backupHelper: '當前操作將對 {0} 進行備份,是否繼續?',
|
||||||
|
recoverHelper: '將從 {0} 文件進行恢復,該操作不可回滾,是否繼續?',
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
username: '用戶名',
|
username: '用戶名',
|
||||||
|
@ -91,7 +91,7 @@ const message = {
|
|||||||
loadingText: {
|
loadingText: {
|
||||||
Upgrading: '系统升级中,请稍候...',
|
Upgrading: '系统升级中,请稍候...',
|
||||||
Restarting: '系统重启中,请稍候...',
|
Restarting: '系统重启中,请稍候...',
|
||||||
Recovering: '从快照恢复中,请稍候...',
|
Recovering: '快照恢复中,请稍候...',
|
||||||
Rollbacking: '快照回滚中,请稍候...',
|
Rollbacking: '快照回滚中,请稍候...',
|
||||||
},
|
},
|
||||||
msg: {
|
msg: {
|
||||||
@ -126,7 +126,8 @@ const message = {
|
|||||||
confirmNoNull: '请确认 {0} 值不为空',
|
confirmNoNull: '请确认 {0} 值不为空',
|
||||||
errPort: '错误的端口信息,请确认!',
|
errPort: '错误的端口信息,请确认!',
|
||||||
remove: '移出',
|
remove: '移出',
|
||||||
recoverHelper: '当前数据将被覆盖,是否继续?',
|
backupHelper: '当前操作将对 {0} 进行备份,是否继续?',
|
||||||
|
recoverHelper: '将从 {0} 文件进行恢复,该操作不可回滚,是否继续?',
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
username: '用户名',
|
username: '用户名',
|
||||||
|
Loading…
Reference in New Issue
Block a user