2014-08-20 18:48:56 +02:00
|
|
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
2015-11-21 12:27:06 +11:00
|
|
|
import Backup from 'admin/models/backup';
|
2014-08-20 18:48:56 +02:00
|
|
|
|
2015-08-11 12:27:07 -04:00
|
|
|
export default Ember.Controller.extend(ModalFunctionality, {
|
2016-10-21 14:09:52 -04:00
|
|
|
adminBackupsLogs: Ember.inject.controller(),
|
2014-08-20 18:48:56 +02:00
|
|
|
|
2016-10-21 14:09:52 -04:00
|
|
|
_startBackup(withUploads) {
|
|
|
|
this.currentUser.set('hideReadOnlyAlert', true);
|
|
|
|
Backup.start(withUploads).then(() => {
|
|
|
|
this.get("adminBackupsLogs.logs").clear();
|
|
|
|
this.send("backupStarted");
|
2014-08-20 18:48:56 +02:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
2016-10-21 14:09:52 -04:00
|
|
|
startBackup() {
|
2015-03-14 12:46:46 +01:00
|
|
|
this._startBackup();
|
2014-08-20 18:48:56 +02:00
|
|
|
},
|
|
|
|
|
2016-10-21 14:09:52 -04:00
|
|
|
startBackupWithoutUpload() {
|
2015-03-14 12:46:46 +01:00
|
|
|
this._startBackup(false);
|
2014-08-20 18:48:56 +02:00
|
|
|
},
|
|
|
|
|
2016-10-21 14:09:52 -04:00
|
|
|
cancel() {
|
2014-08-20 18:48:56 +02:00
|
|
|
this.send("closeModal");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|