1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

[WIP] Backup process outline

This commit is contained in:
sauls8t 2018-10-10 15:13:09 +01:00
parent 8bbb0d3e82
commit 4094677792
18 changed files with 678 additions and 220 deletions

View file

@ -17,15 +17,36 @@ export default Component.extend(Notifier, {
appMeta: service(),
browserSvc: service('browser'),
buttonLabel: 'Run Backup',
backupSpec: null,
backupFilename: '',
backupError: false,
backupSuccess: false,
didReceiveAttrs() {
this._super(...arguments);
this.set('backupSpec', {
retain: true,
org: '*'
// org: this.get('appMeta.orgId')
});
},
actions: {
onBackup() {
this.showWait();
this.set('buttonLabel', 'Please wait, backup running...');
this.set('backupFilename', '');
this.set('backupSuccess', false);
this.set('backupFailed', false);
this.get('onBackup')({}).then(() => {
this.get('onBackup')(this.get('backupSpec')).then((filename) => {
this.set('buttonLabel', 'Run Backup');
this.showDone();
this.set('backupSuccess', true);
this.set('backupFilename', filename);
}, ()=> {
this.set('buttonLabel', 'Run Backup');
this.set('backupFailed', true);
});
}
}