mirror of
https://github.com/discourse/discourse.git
synced 2024-12-20 20:50:18 +08:00
63 lines
1.7 KiB
Handlebars
63 lines
1.7 KiB
Handlebars
{{#if model}}
|
|
<table class="api-keys grid">
|
|
<thead>
|
|
<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> </th>
|
|
</thead>
|
|
<tbody>
|
|
{{#each model as |k|}}
|
|
<tr>
|
|
<td class="key">{{k.key}}</td>
|
|
<td class="key-user">
|
|
<div class="label">{{i18n 'admin.api.user'}}</div>
|
|
{{#if k.user}}
|
|
{{#link-to "adminUser" k.user}}
|
|
{{avatar k.user imageSize="small"}}
|
|
{{/link-to}}
|
|
{{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">
|
|
{{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"}}
|
|
</td>
|
|
</tr>
|
|
{{/each}}
|
|
</tbody>
|
|
</table>
|
|
{{else}}
|
|
<p>{{i18n "admin.api.none"}}</p>
|
|
{{/if}}
|
|
|
|
{{#unless hasMasterKey}}
|
|
{{d-button
|
|
class="btn-primary"
|
|
action=(action "generateMasterKey")
|
|
icon="key"}}
|
|
{{/unless}}
|