2022-06-30 06:30:50 -04:00
|
|
|
<LinkTo @route="adminApiKeys.index" class="go-back">
|
2019-11-05 09:10:23 -05:00
|
|
|
{{d-icon "arrow-left"}}
|
|
|
|
{{i18n "admin.api.all_api_keys"}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</LinkTo>
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2020-09-11 09:38:28 -04:00
|
|
|
<div class="api-key api-key-show">
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.key">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.revoked_at}}{{d-icon "times-circle"}}{{/if}}
|
|
|
|
{{this.model.truncatedKey}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.description">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.editingDescription}}
|
2022-07-06 04:37:54 -04:00
|
|
|
<Input @value={{this.buffered.description}} maxlength="255" placeholder={{i18n "admin.api.description_placeholder"}} />
|
2019-11-05 09:10:23 -05:00
|
|
|
{{else}}
|
2020-02-11 09:55:16 -05:00
|
|
|
<span>
|
2022-07-05 13:41:31 -04:00
|
|
|
{{if this.model.description this.model.description (i18n "admin.api.no_description")}}
|
2020-02-11 09:55:16 -05:00
|
|
|
</span>
|
2019-11-05 09:10:23 -05:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
<div class="controls">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.editingDescription}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @class="ok" @action={{action "saveDescription"}} @icon="check" />
|
|
|
|
<DButton @class="cancel" @action={{action "editDescription"}} @icon="times" />
|
2019-11-05 09:10:23 -05:00
|
|
|
{{else}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @class="btn-default" @action={{action "editDescription"}} @icon="pencil-alt" />
|
2019-11-05 09:10:23 -05:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.user">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.user}}
|
|
|
|
<LinkTo @route="adminUser" @model={{this.model.user}}>
|
|
|
|
{{avatar this.model.user imageSize="small"}} {{this.model.user.username}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</LinkTo>
|
2019-11-05 09:10:23 -05:00
|
|
|
{{else}}
|
|
|
|
{{i18n "admin.api.all_users"}}
|
|
|
|
{{/if}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.created">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{format-date this.model.created_at leaveAgo="true"}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.updated">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{format-date this.model.updated_at leaveAgo="true"}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.last_used">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.last_used_at}}
|
|
|
|
{{format-date this.model.last_used_at leaveAgo="true"}}
|
2019-11-05 09:10:23 -05:00
|
|
|
{{else}}
|
|
|
|
{{i18n "admin.api.never_used"}}
|
|
|
|
{{/if}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.revoked">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.revoked_at}}
|
|
|
|
{{format-date this.model.revoked_at leaveAgo="true"}}
|
2020-09-11 09:38:28 -04:00
|
|
|
{{else}}
|
|
|
|
<span>{{i18n "no_value"}}</span>
|
2019-11-05 09:10:23 -05:00
|
|
|
{{/if}}
|
|
|
|
<div class="controls">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.revoked_at}}
|
|
|
|
<DButton @action={{action "undoRevokeKey"}} @actionParam={{this.model}} @icon="undo" @label="admin.api.undo_revoke" />
|
|
|
|
<DButton @action={{action "deleteKey"}} @actionParam={{this.model}} @icon="trash-alt" @label="admin.api.delete" @class="btn-danger" />
|
2019-11-05 09:10:23 -05:00
|
|
|
{{else}}
|
2022-07-05 13:41:31 -04:00
|
|
|
<DButton @class="btn-danger" @action={{action "revokeKey"}} @actionParam={{this.model}} @icon="times" @label="admin.api.revoke" />
|
2019-11-05 09:10:23 -05:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
2020-07-16 14:51:24 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.api_key_scopes.length}}
|
2021-11-10 10:48:00 -05:00
|
|
|
<h2 class="scopes-title">{{i18n "admin.api.scopes.title"}}</h2>
|
2020-07-16 14:51:24 -04:00
|
|
|
|
2020-09-11 09:38:28 -04:00
|
|
|
<table class="scopes-table grid">
|
2020-07-16 14:51:24 -04:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>{{i18n "admin.api.scopes.resource"}}</td>
|
|
|
|
<td>{{i18n "admin.api.scopes.action"}}</td>
|
2020-08-18 14:12:04 -04:00
|
|
|
<td>{{i18n "admin.api.scopes.allowed_urls"}}</td>
|
2020-07-16 14:51:24 -04:00
|
|
|
<td>{{i18n "admin.api.scopes.allowed_parameters"}}</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#each this.model.api_key_scopes as |scope|}}
|
2020-07-16 14:51:24 -04:00
|
|
|
<tr>
|
|
|
|
<td>{{scope.resource}}</td>
|
2020-08-18 14:12:04 -04:00
|
|
|
<td>
|
|
|
|
{{scope.action}}
|
|
|
|
<span
|
|
|
|
class="scope-tooltip"
|
|
|
|
data-tooltip={{i18n (concat "admin.api.scopes.descriptions." scope.resource "." scope.key)}}>
|
|
|
|
{{d-icon "question-circle"}}
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td>
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @icon="link" @action={{action "showURLs" scope.urls}} @class="btn-info" />
|
2020-08-18 14:12:04 -04:00
|
|
|
</td>
|
2020-07-16 14:51:24 -04:00
|
|
|
<td>
|
|
|
|
{{#each scope.parameters as |p|}}
|
|
|
|
<div>
|
|
|
|
<b>{{p}}:</b>
|
|
|
|
{{#if (get scope.allowed_parameters p)}}
|
|
|
|
{{get scope.allowed_parameters p}}
|
|
|
|
{{else}}
|
|
|
|
{{i18n "admin.api.scopes.any_parameter"}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{/each}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{/if}}
|
2020-01-06 12:35:00 -05:00
|
|
|
</div>
|