discourse/app/assets/javascripts/admin/controllers/modals/admin-start-backup.js.es6
2015-03-14 12:46:46 +01:00

32 lines
738 B
JavaScript

import ModalFunctionality from 'discourse/mixins/modal-functionality';
import Controller from 'discourse/controllers/controller';
export default Controller.extend(ModalFunctionality, {
needs: ["adminBackupsLogs"],
_startBackup: function (withUploads) {
var self = this;
Discourse.User.currentProp("hideReadOnlyAlert", true);
Discourse.Backup.start(withUploads).then(function() {
self.get("controllers.adminBackupsLogs").clear();
self.send("backupStarted");
});
},
actions: {
startBackup: function () {
this._startBackup();
},
startBackupWithoutUpload: function () {
this._startBackup(false);
},
cancel: function () {
this.send("closeModal");
}
}
});