2019-11-05 22:10:23 +08:00
|
|
|
{{#link-to "adminApiKeys.index" class="go-back"}}
|
|
|
|
{{d-icon "arrow-left"}}
|
|
|
|
{{i18n "admin.api.all_api_keys"}}
|
|
|
|
{{/link-to}}
|
|
|
|
|
|
|
|
<div class="api-key">
|
2019-12-12 19:45:00 +08:00
|
|
|
{{#if model.id}}
|
|
|
|
{{#admin-form-row label="admin.api.key"}}
|
|
|
|
<div>{{model.key}}</div>
|
|
|
|
{{/admin-form-row}}
|
|
|
|
{{#admin-form-row}}
|
|
|
|
{{i18n "admin.api.not_shown_again"}}
|
|
|
|
{{/admin-form-row}}
|
|
|
|
{{#admin-form-row}}
|
|
|
|
{{d-button icon="angle-right" label="admin.api.continue" action=(action "continue") class="btn-primary"}}
|
|
|
|
{{/admin-form-row}}
|
|
|
|
{{else}}
|
|
|
|
{{#admin-form-row label="admin.api.description"}}
|
|
|
|
{{input value=model.description maxlength="255" placeholder=(i18n "admin.api.description_placeholder")}}
|
|
|
|
{{/admin-form-row}}
|
2019-11-05 22:10:23 +08:00
|
|
|
|
2019-12-12 19:45:00 +08:00
|
|
|
{{#admin-form-row label="admin.api.user_mode"}}
|
2020-02-03 21:22:14 +08:00
|
|
|
{{combo-box content=userModes value=userMode onChange=(action "changeUserMode")}}
|
2019-12-12 19:45:00 +08:00
|
|
|
{{/admin-form-row}}
|
2019-11-05 22:10:23 +08:00
|
|
|
|
2019-12-12 19:45:00 +08:00
|
|
|
{{#if showUserSelector}}
|
|
|
|
{{#admin-form-row label="admin.api.user"}}
|
|
|
|
{{user-selector single="true"
|
|
|
|
usernames=model.username
|
|
|
|
placeholderKey="admin.api.user_placeholder"
|
2020-02-03 21:22:14 +08:00
|
|
|
}}
|
2019-12-12 19:45:00 +08:00
|
|
|
{{/admin-form-row}}
|
|
|
|
{{/if}}
|
2020-07-17 02:51:24 +08:00
|
|
|
|
|
|
|
{{#admin-form-row label="admin.api.use_global_key"}}
|
|
|
|
{{input type="checkbox" checked=useGlobalKey}}
|
2019-11-05 22:10:23 +08:00
|
|
|
{{/admin-form-row}}
|
2020-07-17 02:51:24 +08:00
|
|
|
|
|
|
|
{{#unless useGlobalKey}}
|
2020-08-19 02:12:04 +08:00
|
|
|
<div class="scopes-title">{{i18n "admin.api.scopes.title"}}</div>
|
|
|
|
<p>{{i18n "admin.api.scopes.description"}}</p>
|
2020-08-24 23:15:08 +08:00
|
|
|
<table class="scopes-table">
|
|
|
|
<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-07-17 02:51:24 +08:00
|
|
|
<tr>
|
2020-08-24 23:15:08 +08:00
|
|
|
<td class="scope-resource-name"><b>{{resource}}</b></td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
2020-07-17 02:51:24 +08:00
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
{{#each actions as |act|}}
|
|
|
|
<tr>
|
|
|
|
<td>{{input type="checkbox" checked=act.selected}}</td>
|
2020-08-19 02:12:04 +08: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>
|
|
|
|
{{d-button icon="link" action=(action "showURLs" act.urls) class="btn-info"}}
|
|
|
|
</td>
|
2020-07-17 02:51:24 +08:00
|
|
|
<td>
|
|
|
|
{{#each act.params as |p|}}
|
|
|
|
<div>
|
|
|
|
{{input maxlength="255" value=(get act p) placeholder=p}}
|
|
|
|
</div>
|
|
|
|
{{/each}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
2020-08-24 23:15:08 +08:00
|
|
|
{{/each-in}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-07-17 02:51:24 +08:00
|
|
|
{{/unless}}
|
|
|
|
|
|
|
|
{{d-button icon="check" label="admin.api.save" action=(action "save") class="btn-primary" disabled=saveDisabled}}
|
2019-11-05 22:10:23 +08:00
|
|
|
{{/if}}
|
2020-02-03 21:22:14 +08:00
|
|
|
</div>
|