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

29 lines
647 B
JavaScript

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