discourse/app/assets/javascripts/admin/controllers/modals/admin-start-backup.js.es6

29 lines
647 B
Plaintext
Raw Normal View History

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