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"}}
|
2021-09-27 04:43:47 -04:00
|
|
|
<span>{{i18n "admin.api.all_api_keys"}}</span>
|
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-new">
|
2019-12-12 06:45:00 -05:00
|
|
|
{{#if model.id}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.key">
|
2019-12-12 06:45:00 -05:00
|
|
|
<div>{{model.key}}</div>
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
|
|
|
<AdminFormRow>
|
2019-12-12 06:45:00 -05:00
|
|
|
{{i18n "admin.api.not_shown_again"}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
|
|
|
<AdminFormRow>
|
|
|
|
<DButton @icon="angle-right" @label="admin.api.continue" @action={{action "continue"}} @class="btn-primary" />
|
|
|
|
</AdminFormRow>
|
2019-12-12 06:45:00 -05:00
|
|
|
{{else}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.description">
|
|
|
|
<Input @value={{model.description}} @maxlength="255" placeholder={{i18n "admin.api.description_placeholder"}} />
|
|
|
|
</AdminFormRow>
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.user_mode">
|
|
|
|
<ComboBox @content={{userModes}} @value={{userMode}} @onChange={{action "changeUserMode"}} />
|
|
|
|
</AdminFormRow>
|
2019-11-05 09:10:23 -05:00
|
|
|
|
2019-12-12 06:45:00 -05:00
|
|
|
{{#if showUserSelector}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.user">
|
|
|
|
<EmailGroupUserChooser @value={{model.username}} @onChange={{action "updateUsername"}} @options={{hash
|
2021-02-01 05:07:11 -05:00
|
|
|
maximum=1
|
|
|
|
filterPlaceholder="admin.api.user_placeholder"
|
2022-06-30 06:30:50 -04:00
|
|
|
}} />
|
|
|
|
</AdminFormRow>
|
2019-12-12 06:45:00 -05:00
|
|
|
{{/if}}
|
2020-07-16 14:51:24 -04:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminFormRow @label="admin.api.scope_mode">
|
|
|
|
<ComboBox @content={{scopeModes}} @value={{scopeMode}} @onChange={{action "changeScopeMode"}} />
|
2021-11-10 10:48:00 -05:00
|
|
|
|
|
|
|
{{#if (eq scopeMode "read_only")}}
|
|
|
|
<p>{{i18n "admin.api.scopes.descriptions.global.read"}}</p>
|
|
|
|
{{else if (eq scopeMode "global")}}
|
|
|
|
<p>{{i18n "admin.api.scopes.global_description"}}</p>
|
|
|
|
{{/if}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</AdminFormRow>
|
2020-07-16 14:51:24 -04:00
|
|
|
|
2021-11-10 10:48:00 -05:00
|
|
|
{{#if (eq scopeMode "granular")}}
|
|
|
|
<h2 class="scopes-title">{{i18n "admin.api.scopes.title"}}</h2>
|
2020-08-18 14:12:04 -04:00
|
|
|
<p>{{i18n "admin.api.scopes.description"}}</p>
|
2020-09-11 09:38:28 -04:00
|
|
|
<table class="scopes-table grid">
|
2020-08-24 11:15:08 -04:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
|
|
<td>{{i18n "admin.api.scopes.allowed_urls"}}</td>
|
|
|
|
<td>{{i18n "admin.api.scopes.optional_allowed_parameters"}}</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{#each-in scopes as |resource actions|}}
|
2020-09-11 09:38:28 -04:00
|
|
|
<tr class="scope-resource-name">
|
|
|
|
<td><b>{{resource}}</b></td>
|
2020-08-24 11:15:08 -04:00
|
|
|
<td></td>
|
|
|
|
<td></td>
|
2020-07-16 14:51:24 -04:00
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
{{#each actions as |act|}}
|
|
|
|
<tr>
|
2022-06-30 06:30:50 -04:00
|
|
|
<td><Input @type="checkbox" @checked={{act.selected}} /></td>
|
2020-08-18 14:12:04 -04:00
|
|
|
<td>
|
|
|
|
<div class="scope-name">{{act.name}}</div>
|
|
|
|
<span class="scope-tooltip" data-tooltip={{i18n (concat "admin.api.scopes.descriptions." resource "." act.key)}}>
|
|
|
|
{{d-icon "question-circle"}}
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td>
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @icon="link" @action={{action "showURLs" act.urls}} @class="btn-info" />
|
2020-08-18 14:12:04 -04:00
|
|
|
</td>
|
2020-07-16 14:51:24 -04:00
|
|
|
<td>
|
|
|
|
{{#each act.params as |p|}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @maxlength="255" @value={{get act p}} placeholder={{p}} />
|
2020-07-16 14:51:24 -04:00
|
|
|
{{/each}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
2020-08-24 11:15:08 -04:00
|
|
|
{{/each-in}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2021-11-10 10:48:00 -05:00
|
|
|
{{/if}}
|
2020-07-16 14:51:24 -04:00
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @icon="check" @label="admin.api.save" @action={{action "save"}} @class="btn-primary" @disabled={{saveDisabled}} />
|
2019-11-05 09:10:23 -05:00
|
|
|
{{/if}}
|
2020-02-03 08:22:14 -05:00
|
|
|
</div>
|