mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:40:00 +08:00
FEATURE: Display created and last_used dates for API keys
This commit is contained in:
parent
10478cb395
commit
445a3851d6
|
@ -3,6 +3,8 @@
|
|||
<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>
|
||||
|
@ -10,6 +12,7 @@
|
|||
<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"}}
|
||||
|
@ -18,6 +21,18 @@
|
|||
{{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"
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
class ApiKeySerializer < ApplicationSerializer
|
||||
|
||||
attributes :id,
|
||||
:key
|
||||
:key,
|
||||
:last_used_at,
|
||||
:created_at
|
||||
|
||||
has_one :user, serializer: BasicUserSerializer, embed: :objects
|
||||
|
||||
|
|
|
@ -3302,6 +3302,9 @@ en:
|
|||
user: "User"
|
||||
title: "API"
|
||||
key: "API Key"
|
||||
created: Created
|
||||
last_used: Last Used
|
||||
never_used: (never)
|
||||
generate: "Generate"
|
||||
regenerate: "Regenerate"
|
||||
revoke: "Revoke"
|
||||
|
|
Loading…
Reference in New Issue
Block a user