2019-11-05 22:10:23 +08:00
|
|
|
{{d-button
|
|
|
|
class="btn-primary"
|
|
|
|
action=(route-action "new")
|
|
|
|
icon="plus"
|
|
|
|
label="admin.api.new_key"}}
|
|
|
|
|
2016-09-19 16:43:06 +08:00
|
|
|
{{#if model}}
|
2019-01-24 00:40:05 +08:00
|
|
|
<table class="api-keys grid">
|
2018-07-03 11:14:53 +08:00
|
|
|
<thead>
|
2019-01-24 00:40:05 +08:00
|
|
|
<th>{{i18n "admin.api.key"}}</th>
|
2019-11-05 22:10:23 +08:00
|
|
|
<th>{{i18n "admin.api.description"}}</th>
|
2019-01-24 00:40:05 +08:00
|
|
|
<th>{{i18n "admin.api.user"}}</th>
|
2019-10-09 21:24:14 +08:00
|
|
|
<th>{{i18n "admin.api.created"}}</th>
|
|
|
|
<th>{{i18n "admin.api.last_used"}}</th>
|
2016-09-19 16:43:06 +08:00
|
|
|
<th> </th>
|
2018-07-03 11:14:53 +08:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{#each model as |k|}}
|
2019-11-05 22:10:23 +08:00
|
|
|
<tr class={{if k.revoked_at "revoked"}}>
|
|
|
|
<td class="key">
|
|
|
|
{{#if k.revoked_at}}{{d-icon 'times-circle'}}{{/if}}
|
2019-12-12 19:45:00 +08:00
|
|
|
{{k.truncatedKey}}
|
2019-11-05 22:10:23 +08:00
|
|
|
</td>
|
|
|
|
<td class="key-description">
|
|
|
|
{{k.shortDescription}}
|
|
|
|
</td>
|
2018-07-03 11:14:53 +08:00
|
|
|
<td class="key-user">
|
2019-10-09 21:24:14 +08:00
|
|
|
<div class="label">{{i18n 'admin.api.user'}}</div>
|
2018-07-03 11:14:53 +08:00
|
|
|
{{#if k.user}}
|
2019-01-24 00:40:05 +08:00
|
|
|
{{#link-to "adminUser" k.user}}
|
2018-07-03 11:14:53 +08:00
|
|
|
{{avatar k.user imageSize="small"}}
|
|
|
|
{{/link-to}}
|
|
|
|
{{else}}
|
2019-01-24 00:40:05 +08:00
|
|
|
{{i18n "admin.api.all_users"}}
|
2018-07-03 11:14:53 +08:00
|
|
|
{{/if}}
|
|
|
|
</td>
|
2019-10-09 21:24:14 +08:00
|
|
|
<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>
|
2018-07-03 11:14:53 +08:00
|
|
|
<td class="key-controls">
|
2019-11-05 22:10:23 +08:00
|
|
|
{{d-button action=(route-action "show" k) icon="far-eye" title="admin.api.show_details"}}
|
|
|
|
{{#if k.revoked_at}}
|
|
|
|
{{d-button
|
|
|
|
action=(action "undoRevokeKey")
|
|
|
|
actionParam=k icon="undo"
|
2019-11-07 00:13:12 +08:00
|
|
|
title="admin.api.undo_revoke"}}
|
2019-11-05 22:10:23 +08:00
|
|
|
{{else}}
|
|
|
|
{{d-button
|
|
|
|
class="btn-danger"
|
|
|
|
action=(action "revokeKey")
|
|
|
|
actionParam=k
|
|
|
|
icon="times"
|
|
|
|
title="admin.api.revoke"}}
|
|
|
|
{{/if}}
|
|
|
|
|
2018-07-03 11:14:53 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
|
|
|
</tbody>
|
2016-09-19 16:43:06 +08:00
|
|
|
</table>
|
|
|
|
{{else}}
|
2019-01-24 00:40:05 +08:00
|
|
|
<p>{{i18n "admin.api.none"}}</p>
|
2019-11-05 22:10:23 +08:00
|
|
|
{{/if}}
|