2014-08-21 00:48:56 +08:00
|
|
|
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 () {
|
2015-03-14 19:46:46 +08:00
|
|
|
this._startBackup();
|
2014-08-21 00:48:56 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
startBackupWithoutUpload: function () {
|
2015-03-14 19:46:46 +08:00
|
|
|
this._startBackup(false);
|
2014-08-21 00:48:56 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
cancel: function () {
|
|
|
|
this.send("closeModal");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|