discourse/app/assets/javascripts/admin/addon/templates/backups-index.hbs
Martin Brennan 1446596089
UX: Apply admin interface guidelines to Backups page (#28051)
This commit converts the Backups page in the admin interface
to follow our new admin interface guidelines.

As part of this work, I've also made `AdminPageHeader` and `AdminPageSubheader`
components that can be reused on any admin page for consistency, that handle
the title and action buttons and also breadcrumbs.

Also renamed `AdminPluginFilteredSiteSettings` to `AdminFilteredSiteSettings` since
it can be used generally to show a subset of filtered site settings, not only
settings for a plugin. Not sure if it's ideal to have to define a new route for this
for every config area, but not sure how else to do it right now.
2024-08-20 09:59:43 +10:00

84 lines
2.8 KiB
Handlebars

<AdminPageSubheader @titleLabel="admin.backups.files_title">
<:actions>
{{#if this.localBackupStorage}}
<UppyBackupUploader
@done={{route-action "uploadSuccess"}}
@localBackupStorage={{this.localBackupStorage}}
/>
{{else}}
<UppyBackupUploader @done={{route-action "remoteUploadSuccess"}} />
{{/if}}
</:actions>
</AdminPageSubheader>
{{#if this.status.restoreDisabled}}
<div class="backup-message alert alert-info">
<a href="site_settings/category/all_results?filter=allow_restore">{{d-icon
"info-circle"
}}
{{i18n "admin.backups.operations.restore.is_disabled"}}</a>
</div>
{{/if}}
<table class="grid admin-backups-list">
<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 class="backup-item-row" data-backup-filename={{backup.filename}}>
<td class="backup-filename">{{backup.filename}}</td>
<td class="backup-size">{{human-size backup.size}}</td>
<td class="backup-controls">
<DButton
@action={{fn this.download backup}}
@icon="download"
@title="admin.backups.operations.download.title"
@label="admin.backups.operations.download.label"
class="btn-default btn-small backup-item-row__download"
/>
<DMenu
@identifier="backup-item-menu"
@title={{i18n "more_options"}}
@icon="ellipsis-v"
class="btn-small"
>
<:content>
<DropdownMenu as |dropdown|>
<dropdown.item>
<DButton
@icon="far-trash-alt"
@action={{fn (route-action "destroyBackup") backup}}
@disabled={{this.status.isOperationRunning}}
@title={{this.deleteTitle}}
@label="admin.backups.operations.destroy.title"
class="btn-transparent btn-danger backup-item-row__delete"
/>
</dropdown.item>
<dropdown.item>
<DButton
@icon="play"
@action={{fn (route-action "startRestore") backup}}
@disabled={{this.status.restoreDisabled}}
@title={{this.restoreTitle}}
@label="admin.backups.operations.restore.label"
class="btn-transparent backup-item-row__restore"
/>
</dropdown.item>
</DropdownMenu>
</:content>
</DMenu>
</td>
</tr>
{{else}}
<tr>
<td>{{i18n "admin.backups.none"}}</td>
<td></td>
<td></td>
</tr>
{{/each}}
</tbody>
</table>