mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
1c87bb7fe9
1. Use `this.` instead of `{{action}}` where applicable 2. Use `{{fn}}` instead of `@actionParam` where applicable 3. Use non-`@` versions of class/type/tabindex/aria-controls/aria-expanded 4. Remove `btn` class (it's added automatically to all DButtons) 5. Remove `type="button"` (it's the default) 6. Use `concat-class` helper
102 lines
3.3 KiB
Handlebars
102 lines
3.3 KiB
Handlebars
<div class="backup-options">
|
|
{{#if this.localBackupStorage}}
|
|
<UppyBackupUploader
|
|
@done={{route-action "uploadSuccess"}}
|
|
@localBackupStorage={{this.localBackupStorage}}
|
|
/>
|
|
{{else}}
|
|
<UppyBackupUploader @done={{route-action "remoteUploadSuccess"}} />
|
|
{{/if}}
|
|
|
|
{{#if this.site.isReadOnly}}
|
|
<DButton
|
|
@icon="far-eye"
|
|
@action={{this.toggleReadOnlyMode}}
|
|
@disabled={{this.status.isOperationRunning}}
|
|
@title="admin.backups.read_only.disable.title"
|
|
@label="admin.backups.read_only.disable.label"
|
|
class="btn-default"
|
|
/>
|
|
{{else}}
|
|
<DButton
|
|
@icon="far-eye"
|
|
@action={{this.toggleReadOnlyMode}}
|
|
@disabled={{this.status.isOperationRunning}}
|
|
@title="admin.backups.read_only.enable.title"
|
|
@label="admin.backups.read_only.enable.label"
|
|
class="btn-default"
|
|
/>
|
|
{{/if}}
|
|
<div class="backup-message">
|
|
{{#if this.status.restoreDisabled}}
|
|
<a href="site_settings/category/all_results?filter=allow_restore">{{d-icon
|
|
"info-circle"
|
|
}}
|
|
{{i18n "admin.backups.operations.restore.is_disabled"}}</a>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
<table class="grid">
|
|
<thead>
|
|
<th width="55%">{{i18n "admin.backups.columns.filename"}}</th>
|
|
<th width="10%">{{i18n "admin.backups.columns.size"}}</th>
|
|
<th></th>
|
|
</thead>
|
|
<tbody>
|
|
{{#each this.model as |backup|}}
|
|
<tr>
|
|
<td class="backup-filename">{{backup.filename}}</td>
|
|
<td class="backup-size">{{human-size backup.size}}</td>
|
|
<td class="backup-controls">
|
|
<div>
|
|
<DButton
|
|
@action={{fn this.download backup}}
|
|
@icon="download"
|
|
@title="admin.backups.operations.download.title"
|
|
@label="admin.backups.operations.download.label"
|
|
class="btn-default download"
|
|
/>
|
|
{{#if this.status.isOperationRunning}}
|
|
<DButton
|
|
@icon="far-trash-alt"
|
|
@action={{fn (route-action "destroyBackup") backup}}
|
|
@disabled="true"
|
|
@title="admin.backups.operations.is_running"
|
|
class="btn-danger"
|
|
/>
|
|
<DButton
|
|
@icon="play"
|
|
@action={{fn (route-action "startRestore") backup}}
|
|
@disabled={{this.status.restoreDisabled}}
|
|
@title={{this.restoreTitle}}
|
|
@label="admin.backups.operations.restore.label"
|
|
class="btn-default"
|
|
/>
|
|
{{else}}
|
|
<DButton
|
|
@icon="far-trash-alt"
|
|
@action={{fn (route-action "destroyBackup") backup}}
|
|
@title="admin.backups.operations.destroy.title"
|
|
class="btn-danger"
|
|
/>
|
|
<DButton
|
|
@icon="play"
|
|
@action={{fn (route-action "startRestore") backup}}
|
|
@disabled={{this.status.restoreDisabled}}
|
|
@title={{this.restoreTitle}}
|
|
@label="admin.backups.operations.restore.label"
|
|
class="btn-default btn-restore"
|
|
/>
|
|
{{/if}}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr>
|
|
<td>{{i18n "admin.backups.none"}}</td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
{{/each}}
|
|
</tbody>
|
|
</table> |