diff --git a/app/assets/javascripts/admin/controllers/admin-backups-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-backups-index.js.es6 index fb052e6fc..1617e6133 100644 --- a/app/assets/javascripts/admin/controllers/admin-backups-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-backups-index.js.es6 @@ -1,8 +1,6 @@ export default Ember.ArrayController.extend({ needs: ["adminBackups"], - status: Em.computed.alias("controllers.adminBackups"), - isOperationRunning: Ember.computed.alias("status.model.isOperationRunning"), - restoreDisabled: Ember.computed.alias("status.model.restoreDisabled"), + status: Ember.computed.alias("controllers.adminBackups"), uploadLabel: function() { return I18n.t("admin.backups.upload.label"); }.property(), diff --git a/app/assets/javascripts/admin/models/backup-status.js.es6 b/app/assets/javascripts/admin/models/backup-status.js.es6 new file mode 100644 index 000000000..2de301f95 --- /dev/null +++ b/app/assets/javascripts/admin/models/backup-status.js.es6 @@ -0,0 +1,12 @@ +import computed from "ember-addons/ember-computed-decorators"; + +export default Discourse.Model.extend({ + + restoreDisabled: Em.computed.not("restoreEnabled"), + + @computed("allowRestore", "isOperationRunning") + restoreEnabled(allowRestore, isOperationRunning) { + return allowRestore && !isOperationRunning; + } + +}); diff --git a/app/assets/javascripts/admin/models/backup_status.js b/app/assets/javascripts/admin/models/backup_status.js deleted file mode 100644 index e67a34bc3..000000000 --- a/app/assets/javascripts/admin/models/backup_status.js +++ /dev/null @@ -1,9 +0,0 @@ -Discourse.BackupStatus = Discourse.Model.extend({ - - restoreDisabled: Em.computed.not("restoreEnabled"), - - restoreEnabled: function() { - return this.get('allowRestore') && !this.get("isOperationRunning"); - }.property("isOperationRunning", "allowRestore") - -}); diff --git a/app/assets/javascripts/admin/templates/backups_index.hbs b/app/assets/javascripts/admin/templates/backups_index.hbs index 0b66fcaf7..09bf83bc6 100644 --- a/app/assets/javascripts/admin/templates/backups_index.hbs +++ b/app/assets/javascripts/admin/templates/backups_index.hbs @@ -6,9 +6,9 @@