2022-06-30 06:30:50 -04:00
|
|
|
<DButton @class="btn-primary" @action={{route-action "new"}} @icon="plus" @label="admin.api.new_key" />
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2016-09-19 04:43:06 -04:00
|
|
|
{{#if model}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<LoadMore @selector=".api-keys tr" @action={{action "loadMore"}}>
|
2021-11-09 05:18:23 -05:00
|
|
|
<table class="api-keys grid">
|
|
|
|
<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 model as |k|}}
|
|
|
|
<tr class={{if k.revoked_at "revoked"}}>
|
|
|
|
<td class="key">
|
|
|
|
{{#if k.revoked_at}}{{d-icon "times-circle"}}{{/if}}
|
|
|
|
{{k.truncatedKey}}
|
|
|
|
</td>
|
|
|
|
<td class="key-description">
|
|
|
|
{{k.shortDescription}}
|
|
|
|
</td>
|
|
|
|
<td class="key-user">
|
|
|
|
<div class="label">{{i18n "admin.api.user"}}</div>
|
|
|
|
{{#if k.user}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<LinkTo @route="adminUser" @model={{k.user}}>
|
2021-11-09 05:18:23 -05:00
|
|
|
{{avatar k.user imageSize="small"}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</LinkTo>
|
2021-11-09 05:18:23 -05:00
|
|
|
{{else}}
|
|
|
|
{{i18n "admin.api.all_users"}}
|
|
|
|
{{/if}}
|
|
|
|
</td>
|
|
|
|
<td class="key-created">
|
|
|
|
<div class="label">{{i18n "admin.api.created"}}</div>
|
|
|
|
{{format-date k.created_at}}
|
|
|
|
</td>
|
|
|
|
<td class="key-last-used">
|
|
|
|
<div class="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="key-controls">
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @action={{route-action "show" k}} @icon="far-eye" @title="admin.api.show_details" />
|
2021-11-09 05:18:23 -05:00
|
|
|
{{#if k.revoked_at}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @action={{action "undoRevokeKey"}} @actionParam={{k}} @icon="undo" @title="admin.api.undo_revoke" />
|
2021-11-09 05:18:23 -05:00
|
|
|
{{else}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @class="btn-danger" @action={{action "revokeKey"}} @actionParam={{k}} @icon="times" @title="admin.api.revoke" />
|
2021-11-09 05:18:23 -05:00
|
|
|
{{/if}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2022-06-30 06:30:50 -04:00
|
|
|
</LoadMore>
|
2021-11-09 05:18:23 -05:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<ConditionalLoadingSpinner @condition={{loading}} />
|
2016-09-19 04:43:06 -04:00
|
|
|
{{else}}
|
2019-01-23 11:40:05 -05:00
|
|
|
<p>{{i18n "admin.api.none"}}</p>
|
2020-03-26 14:49:38 -04:00
|
|
|
{{/if}}
|