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>
|
|
|
|
<th>{{i18n "admin.api.user"}}</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|}}
|
|
|
|
<tr>
|
2019-01-24 00:40:05 +08:00
|
|
|
<td class="key">{{k.key}}</td>
|
2018-07-03 11:14:53 +08:00
|
|
|
<td class="key-user">
|
|
|
|
{{#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>
|
|
|
|
<td class="key-controls">
|
2019-01-24 00:40:05 +08: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-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>
|
2016-09-19 16:43:06 +08:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#unless hasMasterKey}}
|
2019-01-24 00:40:05 +08:00
|
|
|
{{d-button
|
|
|
|
class="btn-primary"
|
|
|
|
action=(action "generateMasterKey")
|
|
|
|
icon="key"}}
|
2016-10-21 01:26:41 +08:00
|
|
|
{{/unless}}
|