discourse/app/assets/javascripts/admin/templates/api-keys.hbs

63 lines
1.7 KiB
Handlebars
Raw Normal View History

{{#if model}}
2019-01-23 11:40:05 -05:00
<table class="api-keys grid">
2018-07-02 23:14:53 -04:00
<thead>
2019-01-23 11:40:05 -05:00
<th>{{i18n "admin.api.key"}}</th>
<th>{{i18n "admin.api.user"}}</th>
<th>{{i18n "admin.api.created"}}</th>
<th>{{i18n "admin.api.last_used"}}</th>
<th>&nbsp;</th>
2018-07-02 23:14:53 -04:00
</thead>
<tbody>
{{#each model as |k|}}
<tr>
2019-01-23 11:40:05 -05:00
<td class="key">{{k.key}}</td>
2018-07-02 23:14:53 -04:00
<td class="key-user">
<div class="label">{{i18n 'admin.api.user'}}</div>
2018-07-02 23:14:53 -04:00
{{#if k.user}}
2019-01-23 11:40:05 -05:00
{{#link-to "adminUser" k.user}}
2018-07-02 23:14:53 -04:00
{{avatar k.user imageSize="small"}}
{{/link-to}}
{{else}}
2019-01-23 11:40:05 -05:00
{{i18n "admin.api.all_users"}}
2018-07-02 23:14:53 -04:00
{{/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>
2018-07-02 23:14:53 -04:00
<td class="key-controls">
2019-01-23 11:40:05 -05:00
{{d-button
class="btn-default"
action=(action "regenerateKey")
actionParam=k icon="undo"
label="admin.api.regenerate"}}
{{d-button
class="btn-default"
action=(action "revokeKey")
actionParam=k
icon="times"
label="admin.api.revoke"}}
2018-07-02 23:14:53 -04:00
</td>
</tr>
{{/each}}
</tbody>
</table>
{{else}}
2019-01-23 11:40:05 -05:00
<p>{{i18n "admin.api.none"}}</p>
{{/if}}
{{#unless hasMasterKey}}
2019-01-23 11:40:05 -05:00
{{d-button
class="btn-primary"
action=(action "generateMasterKey")
icon="key"}}
{{/unless}}