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