mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 06:28:04 +08:00
FEATURE: Display created and last_used dates for API keys
This commit is contained in:
@ -3,6 +3,8 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<th>{{i18n "admin.api.key"}}</th>
|
<th>{{i18n "admin.api.key"}}</th>
|
||||||
<th>{{i18n "admin.api.user"}}</th>
|
<th>{{i18n "admin.api.user"}}</th>
|
||||||
|
<th>{{i18n "admin.api.created"}}</th>
|
||||||
|
<th>{{i18n "admin.api.last_used"}}</th>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -10,6 +12,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="key">{{k.key}}</td>
|
<td class="key">{{k.key}}</td>
|
||||||
<td class="key-user">
|
<td class="key-user">
|
||||||
|
<div class="label">{{i18n 'admin.api.user'}}</div>
|
||||||
{{#if k.user}}
|
{{#if k.user}}
|
||||||
{{#link-to "adminUser" k.user}}
|
{{#link-to "adminUser" k.user}}
|
||||||
{{avatar k.user imageSize="small"}}
|
{{avatar k.user imageSize="small"}}
|
||||||
@ -18,6 +21,18 @@
|
|||||||
{{i18n "admin.api.all_users"}}
|
{{i18n "admin.api.all_users"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</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">
|
<td class="key-controls">
|
||||||
{{d-button
|
{{d-button
|
||||||
class="btn-default"
|
class="btn-default"
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
class ApiKeySerializer < ApplicationSerializer
|
class ApiKeySerializer < ApplicationSerializer
|
||||||
|
|
||||||
attributes :id,
|
attributes :id,
|
||||||
:key
|
:key,
|
||||||
|
:last_used_at,
|
||||||
|
:created_at
|
||||||
|
|
||||||
has_one :user, serializer: BasicUserSerializer, embed: :objects
|
has_one :user, serializer: BasicUserSerializer, embed: :objects
|
||||||
|
|
||||||
|
@ -3302,6 +3302,9 @@ en:
|
|||||||
user: "User"
|
user: "User"
|
||||||
title: "API"
|
title: "API"
|
||||||
key: "API Key"
|
key: "API Key"
|
||||||
|
created: Created
|
||||||
|
last_used: Last Used
|
||||||
|
never_used: (never)
|
||||||
generate: "Generate"
|
generate: "Generate"
|
||||||
regenerate: "Regenerate"
|
regenerate: "Regenerate"
|
||||||
revoke: "Revoke"
|
revoke: "Revoke"
|
||||||
|
Reference in New Issue
Block a user