mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 10:54:22 +08:00
FIX: backups index template wasn't properly bound
This commit is contained in:
parent
58c9ca6132
commit
73e4c6ae4d
|
@ -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(),
|
||||
|
||||
|
|
12
app/assets/javascripts/admin/models/backup-status.js.es6
Normal file
12
app/assets/javascripts/admin/models/backup-status.js.es6
Normal file
|
@ -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;
|
||||
}
|
||||
|
||||
});
|
|
@ -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")
|
||||
|
||||
});
|
|
@ -6,9 +6,9 @@
|
|||
<div class="pull-right">
|
||||
{{resumable-upload target="/admin/backups/upload" success="uploadSuccess" error="uploadError" uploadText=uploadLabel title="admin.backups.upload.title"}}
|
||||
{{#if site.isReadOnly}}
|
||||
{{d-button icon="eye" action="toggleReadOnlyMode" disabled=model.isOperationRunning title="admin.backups.read_only.disable.title" label="admin.backups.read_only.disable.label"}}
|
||||
{{d-button icon="eye" action="toggleReadOnlyMode" disabled=status.model.isOperationRunning title="admin.backups.read_only.disable.title" label="admin.backups.read_only.disable.label"}}
|
||||
{{else}}
|
||||
{{d-button icon="eye" action="toggleReadOnlyMode" disabled=model.isOperationRunning title="admin.backups.read_only.enable.title" label="admin.backups.read_only.enable.label"}}
|
||||
{{d-button icon="eye" action="toggleReadOnlyMode" disabled=status.model.isOperationRunning title="admin.backups.read_only.enable.title" label="admin.backups.read_only.enable.label"}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</th>
|
||||
|
@ -20,12 +20,12 @@
|
|||
<td>
|
||||
<div class="pull-right">
|
||||
<a {{bind-attr href="backup.link"}} class="btn download" title="{{i18n 'admin.backups.operations.download.title'}}">{{fa-icon "download"}}{{i18n 'admin.backups.operations.download.label'}}</a>
|
||||
{{#if model.isOperationRunning}}
|
||||
{{#if status.model.isOperationRunning}}
|
||||
{{d-button icon="trash-o" action="destroyBackup" actionParam=backup class="btn-danger" disabled="true" title="admin.backups.operations.is_running"}}
|
||||
{{d-button icon="play" action="startRestore" actionParam=backup disabled=model.restoreDisabled title=restoreTitle label="admin.backups.operations.restore.label"}}
|
||||
{{d-button icon="play" action="startRestore" actionParam=backup disabled=status.model.restoreDisabled title=restoreTitle label="admin.backups.operations.restore.label"}}
|
||||
{{else}}
|
||||
{{d-button icon="trash-o" action="destroyBackup" actionParam=backup class="btn-danger" title="admin.backups.operations.destroy.title"}}
|
||||
{{d-button icon="play" action="startRestore" actionParam=backup disabled=model.restoreDisabled title=restoreTitle label="admin.backups.operations.restore.label"}}
|
||||
{{d-button icon="play" action="startRestore" actionParam=backup disabled=status.model.restoreDisabled title=restoreTitle label="admin.backups.operations.restore.label"}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue
Block a user