mirror of
https://github.com/discourse/discourse.git
synced 2024-12-13 16:26:30 +08:00
85774cc214
This commit attempts to improve the mobile experience for admin page header and subheader by automatically collapsing all action buttons in these components into a DMenu when viewing mobile. This is done by using different "list" wrapper components and a DMenu trigger and a DropdownMenu on mobile only, and uses has-block to determine whether to render the DMenu trigger at all. This also removes the `PluginOutlet` in `AdminPluginConfigPage`, it was too inflexible for this `DropdownMenu` case, and since the `:actions` were always rendering we couldn't rely on `has-block`. A new plugin API, `registerPluginHeaderActionComponent`, has been introduced instead to replace it.
92 lines
3.0 KiB
Handlebars
92 lines
3.0 KiB
Handlebars
<AdminPageSubheader @titleLabel="admin.backups.files_title">
|
|
<:actions as |actions|>
|
|
<actions.Wrapped as |wrapped|>
|
|
{{#if this.localBackupStorage}}
|
|
<UppyBackupUploader
|
|
class={{wrapped.buttonClass}}
|
|
@done={{route-action "uploadSuccess"}}
|
|
@localBackupStorage={{this.localBackupStorage}}
|
|
/>
|
|
{{else}}
|
|
<UppyBackupUploader
|
|
class={{wrapped.buttonClass}}
|
|
@done={{route-action "remoteUploadSuccess"}}
|
|
/>
|
|
{{/if}}
|
|
</actions.Wrapped>
|
|
</:actions>
|
|
</AdminPageSubheader>
|
|
|
|
{{#if this.status.restoreDisabled}}
|
|
<div class="backup-message alert alert-info">
|
|
{{dIcon "circle-info"}}
|
|
{{html-safe
|
|
(i18n
|
|
"admin.backups.operations.restore.is_disabled"
|
|
url=this.restoreSettingsUrl
|
|
)
|
|
}}
|
|
</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 admin-table-row-controls">
|
|
<DButton
|
|
@action={{fn this.download backup}}
|
|
@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-vertical"
|
|
class="btn-small"
|
|
>
|
|
<:content>
|
|
<DropdownMenu as |dropdown|>
|
|
<dropdown.item>
|
|
<DButton
|
|
@icon="trash-can"
|
|
@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> |