mirror of
https://github.com/discourse/discourse.git
synced 2024-12-21 12:43:44 +08:00
b4f7a1b761
Some checks are pending
Licenses / run (push) Waiting to run
Linting / run (push) Waiting to run
Tests / core frontend (${{ matrix.browser }}) (Chrome) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (annotations, core) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (backend, core) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (backend, plugins) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (frontend, plugins) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (frontend, themes) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, chat) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, core) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, plugins) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, themes) (push) Waiting to run
Tests / core frontend (${{ matrix.browser }}) (Firefox ESR) (push) Waiting to run
Tests / core frontend (${{ matrix.browser }}) (Firefox Evergreen) (push) Waiting to run
* UX: Apply admin table classes for consistent mobile styling on the API keys page * apply prettier
90 lines
3.0 KiB
Handlebars
90 lines
3.0 KiB
Handlebars
<DButton
|
|
@action={{route-action "new"}}
|
|
@icon="plus"
|
|
@label="admin.api.new_key"
|
|
class="btn-primary"
|
|
/>
|
|
|
|
{{#if this.model}}
|
|
<LoadMore @selector=".api-keys tr" @action={{action "loadMore"}}>
|
|
<table class="d-admin-table api-keys">
|
|
<thead>
|
|
<th>{{i18n "admin.api.key"}}</th>
|
|
<th>{{i18n "admin.api.description"}}</th>
|
|
<th>{{i18n "admin.api.user"}}</th>
|
|
<th>{{i18n "admin.api.created"}}</th>
|
|
<th>{{i18n "admin.api.last_used"}}</th>
|
|
<th> </th>
|
|
</thead>
|
|
<tbody>
|
|
{{#each this.model as |k|}}
|
|
<tr class="d-admin-row__content {{if k.revoked_at 'revoked'}}">
|
|
<td class="d-admin-row__overview key">
|
|
{{#if k.revoked_at}}{{d-icon "circle-xmark"}}{{/if}}
|
|
{{k.truncatedKey}}
|
|
</td>
|
|
<td class="d-admin-row__detail key-description">
|
|
<div class="d-admin-row__mobile-label">{{i18n
|
|
"admin.api.description"
|
|
}}</div>
|
|
{{k.shortDescription}}
|
|
</td>
|
|
<td class="d-admin-row__detail key-user">
|
|
<div class="d-admin-row__mobile-label">{{i18n
|
|
"admin.api.user"
|
|
}}</div>
|
|
{{#if k.user}}
|
|
<LinkTo @route="adminUser" @model={{k.user}}>
|
|
{{avatar k.user imageSize="small"}}
|
|
</LinkTo>
|
|
{{else}}
|
|
{{i18n "admin.api.all_users"}}
|
|
{{/if}}
|
|
</td>
|
|
<td class="d-admin-row__detail key-created">
|
|
<div class="d-admin-row__mobile-label">{{i18n
|
|
"admin.api.created"
|
|
}}</div>
|
|
{{format-date k.created_at}}
|
|
</td>
|
|
<td class="d-admin-row__detail key-last-used">
|
|
<div class="d-admin-row__mobile-label">{{i18n
|
|
"admin.api.last_used"
|
|
}}</div>
|
|
{{#if k.last_used_at}}
|
|
{{format-date k.last_used_at}}
|
|
{{else}}
|
|
{{i18n "admin.api.never_used"}}
|
|
{{/if}}
|
|
</td>
|
|
<td class="d-admin-row__controls key-controls">
|
|
<DButton
|
|
@action={{route-action "show" k}}
|
|
@icon="far-eye"
|
|
@title="admin.api.show_details"
|
|
/>
|
|
{{#if k.revoked_at}}
|
|
<DButton
|
|
@action={{fn this.undoRevokeKey k}}
|
|
@icon="arrow-rotate-left"
|
|
@title="admin.api.undo_revoke"
|
|
/>
|
|
{{else}}
|
|
<DButton
|
|
@action={{fn this.revokeKey k}}
|
|
@icon="xmark"
|
|
@title="admin.api.revoke"
|
|
class="btn-danger"
|
|
/>
|
|
{{/if}}
|
|
</td>
|
|
</tr>
|
|
{{/each}}
|
|
</tbody>
|
|
</table>
|
|
</LoadMore>
|
|
|
|
<ConditionalLoadingSpinner @condition={{this.loading}} />
|
|
{{else}}
|
|
<p>{{i18n "admin.api.none"}}</p>
|
|
{{/if}} |