2019-06-02 12:54:31 +02:00
|
|
|
<div class="wizard-api-header page">
|
2021-04-12 16:19:53 +02:00
|
|
|
<div class="buttons">
|
2019-06-03 04:49:54 +02:00
|
|
|
{{#if updating}}
|
|
|
|
{{loading-spinner size="small"}}
|
|
|
|
{{else}}
|
|
|
|
{{#if responseIcon}}
|
|
|
|
{{d-icon responseIcon}}
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
|
2019-06-12 22:57:38 +02:00
|
|
|
{{d-button label="admin.wizard.api.save" action=(action "save") class="btn-primary" disabled=saveDisabled}}
|
2019-06-03 04:49:54 +02:00
|
|
|
|
|
|
|
{{#if showRemove}}
|
2019-06-12 22:57:38 +02:00
|
|
|
{{d-button action=(action "remove") label="admin.wizard.api.remove"}}
|
2019-06-03 04:49:54 +02:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if error}}
|
|
|
|
<div class="error">
|
|
|
|
{{error}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
2022-06-02 16:45:20 +02:00
|
|
|
<div class="wizard-header large">
|
2019-06-03 04:49:54 +02:00
|
|
|
{{#if api.isNew}}
|
2021-04-12 16:19:53 +02:00
|
|
|
{{i18n "admin.wizard.api.new"}}
|
2019-06-03 04:49:54 +02:00
|
|
|
{{else}}
|
2022-06-02 16:45:20 +02:00
|
|
|
<span>{{api.title}}</span>
|
2019-06-03 04:49:54 +02:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
2019-06-02 12:54:31 +02:00
|
|
|
<div class="metadata">
|
|
|
|
<div class="title">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.title"}}</label>
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.api.title}}
|
|
|
|
placeholder={{i18n "admin.wizard.api.title_placeholder"}}
|
|
|
|
/>
|
2019-06-02 12:54:31 +02:00
|
|
|
</div>
|
|
|
|
|
2022-06-02 16:45:20 +02:00
|
|
|
<div class="name {{nameClass}}">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.name"}}</label>
|
2019-06-02 12:54:31 +02:00
|
|
|
{{#if api.isNew}}
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.api.name}}
|
|
|
|
placeholder={{i18n "admin.wizard.api.name_placeholder"}}
|
|
|
|
/>
|
2019-06-02 12:54:31 +02:00
|
|
|
{{else}}
|
2022-06-02 16:45:20 +02:00
|
|
|
<span>{{api.name}}</span>
|
2019-06-02 12:54:31 +02:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2019-05-31 09:54:11 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-06-02 12:54:31 +02:00
|
|
|
<div class="wizard-api-header">
|
2019-06-03 04:49:54 +02:00
|
|
|
<div class="buttons">
|
2019-06-03 01:40:54 +02:00
|
|
|
{{#if isOauth}}
|
2019-06-07 05:09:31 +02:00
|
|
|
{{#if authorizing}}
|
|
|
|
{{loading-spinner size="small"}}
|
|
|
|
{{else}}
|
|
|
|
{{#if authErrorMessage}}
|
|
|
|
<span>{{authErrorMessage}}</span>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
2019-06-03 01:40:54 +02:00
|
|
|
{{d-button label="admin.wizard.api.auth.btn"
|
2019-06-12 22:57:38 +02:00
|
|
|
action=(action "authorize")
|
2019-06-03 01:40:54 +02:00
|
|
|
disabled=authDisabled
|
|
|
|
class="btn-primary"}}
|
|
|
|
{{/if}}
|
2019-06-02 12:54:31 +02:00
|
|
|
</div>
|
2019-06-03 04:49:54 +02:00
|
|
|
|
2022-06-02 16:45:20 +02:00
|
|
|
<div class="wizard-header medium">
|
2021-04-12 16:19:53 +02:00
|
|
|
{{i18n "admin.wizard.api.auth.label"}}
|
2019-06-03 04:49:54 +02:00
|
|
|
</div>
|
2019-05-31 09:54:11 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="wizard-api-authentication">
|
|
|
|
<div class="settings">
|
|
|
|
|
2022-06-02 16:45:20 +02:00
|
|
|
<div class="wizard-header small">
|
2021-04-12 16:19:53 +02:00
|
|
|
{{i18n "admin.wizard.api.auth.settings"}}
|
2019-05-31 09:54:11 +02:00
|
|
|
</div>
|
2019-05-30 07:04:34 +02:00
|
|
|
|
2019-06-07 05:09:31 +02:00
|
|
|
{{#if showRedirectUri}}
|
|
|
|
<div class="control-group redirect-uri">
|
|
|
|
<div class="control-label">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.auth.redirect_uri"}}</label>
|
2019-06-07 05:09:31 +02:00
|
|
|
<div class="controls">
|
|
|
|
{{api.redirectUri}}
|
2019-06-02 12:54:31 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-06-07 05:09:31 +02:00
|
|
|
</div>
|
2019-06-02 12:54:31 +02:00
|
|
|
{{/if}}
|
2019-05-30 07:04:34 +02:00
|
|
|
|
2019-06-02 12:54:31 +02:00
|
|
|
<div class="control-group auth-type">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.auth.type"}}</label>
|
2019-05-30 07:04:34 +02:00
|
|
|
<div class="controls">
|
2020-02-02 11:42:05 +01:00
|
|
|
{{combo-box
|
2021-04-12 16:19:53 +02:00
|
|
|
value=api.authType
|
2020-02-02 11:42:05 +01:00
|
|
|
content=authorizationTypes
|
2020-04-22 15:03:18 +02:00
|
|
|
onChange=(action (mut api.authType))
|
2020-03-22 07:47:56 +01:00
|
|
|
options=(hash
|
2021-04-12 16:19:53 +02:00
|
|
|
none="admin.wizard.api.auth.type_none"
|
2020-03-22 07:47:56 +01:00
|
|
|
)}}
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-06-03 00:59:35 +02:00
|
|
|
{{#if isOauth}}
|
2019-06-07 05:09:31 +02:00
|
|
|
{{#if threeLeggedOauth}}
|
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.auth.url"}}</label>
|
2019-06-07 05:09:31 +02:00
|
|
|
<div class="controls">
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.api.authUrl}}
|
|
|
|
/>
|
2019-06-07 05:09:31 +02:00
|
|
|
</div>
|
2019-06-03 00:59:35 +02:00
|
|
|
</div>
|
2019-06-07 05:09:31 +02:00
|
|
|
{{/if}}
|
2019-05-30 07:04:34 +02:00
|
|
|
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.auth.token_url"}}</label>
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="controls">
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.api.tokenUrl}}
|
|
|
|
/>
|
2019-06-03 00:59:35 +02:00
|
|
|
</div>
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.auth.client_id"}}</label>
|
2019-05-30 07:04:34 +02:00
|
|
|
<div class="controls">
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.api.clientId}}
|
|
|
|
/>
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.auth.client_secret"}}</label>
|
2019-05-30 07:04:34 +02:00
|
|
|
<div class="controls">
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.api.clientSecret}}
|
|
|
|
/>
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.auth.params.label"}}</label>
|
2019-05-30 07:04:34 +02:00
|
|
|
<div class="controls">
|
|
|
|
{{#each api.authParams as |param|}}
|
|
|
|
<div class="param">
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.param.key}}
|
|
|
|
placeholder={{i18n "admin.wizard.key"}}
|
|
|
|
/>
|
|
|
|
<Input
|
|
|
|
@value={{this.param.value}}
|
|
|
|
placeholder={{i18n "admin.wizard.value"}}
|
|
|
|
/>
|
2021-04-12 16:19:53 +02:00
|
|
|
{{d-button action=(action "removeParam") actionParam=param icon="times"}}
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
|
|
|
{{/each}}
|
2021-04-12 16:19:53 +02:00
|
|
|
{{d-button label="admin.wizard.api.auth.params.new" icon="plus" action=(action "addParam")}}
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-06-03 01:40:54 +02:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if isBasicAuth}}
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.auth.username"}}</label>
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="controls">
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.api.username}}
|
|
|
|
/>
|
2019-06-03 00:59:35 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.auth.password"}}</label>
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="controls">
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.api.password}}
|
|
|
|
/>
|
2019-06-03 00:59:35 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-05-30 07:04:34 +02:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
2019-06-03 00:59:35 +02:00
|
|
|
{{#if isOauth}}
|
|
|
|
<div class="status">
|
|
|
|
<div class="authorization">
|
|
|
|
{{#if api.authorized}}
|
|
|
|
<span class="authorization-indicator authorized"></span>
|
|
|
|
<span>{{i18n "admin.wizard.api.status.authorized"}}</span>
|
|
|
|
{{else}}
|
|
|
|
<span class="authorization-indicator not-authorized"></span>
|
|
|
|
<span>{{i18n "admin.wizard.api.status.not_authorized"}}</span>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2019-06-02 12:54:31 +02:00
|
|
|
|
2022-06-02 16:45:20 +02:00
|
|
|
<div class="wizard-header small">
|
2021-04-12 16:19:53 +02:00
|
|
|
{{i18n "admin.wizard.api.status.label"}}
|
2019-06-03 00:59:35 +02:00
|
|
|
</div>
|
2019-06-02 12:54:31 +02:00
|
|
|
|
2019-06-07 05:09:31 +02:00
|
|
|
{{#if threeLeggedOauth}}
|
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.status.code"}}</label>
|
2019-06-07 05:09:31 +02:00
|
|
|
<div class="controls">
|
|
|
|
{{api.code}}
|
|
|
|
</div>
|
2019-06-03 00:59:35 +02:00
|
|
|
</div>
|
2019-06-07 05:09:31 +02:00
|
|
|
{{/if}}
|
2019-05-30 07:04:34 +02:00
|
|
|
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.status.access_token"}}</label>
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="controls">
|
|
|
|
{{api.accessToken}}
|
|
|
|
</div>
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
|
|
|
|
2019-06-07 05:09:31 +02:00
|
|
|
{{#if threeLeggedOauth}}
|
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.status.refresh_token"}}</label>
|
2019-06-07 05:09:31 +02:00
|
|
|
<div class="controls">
|
|
|
|
{{api.refreshToken}}
|
|
|
|
</div>
|
2019-06-03 00:59:35 +02:00
|
|
|
</div>
|
2019-06-07 05:09:31 +02:00
|
|
|
{{/if}}
|
2019-05-30 07:04:34 +02:00
|
|
|
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.status.expires_at"}}</label>
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="controls">
|
|
|
|
{{api.tokenExpiresAt}}
|
|
|
|
</div>
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
|
|
|
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="control-group">
|
2021-04-12 16:19:53 +02:00
|
|
|
<label>{{i18n "admin.wizard.api.status.refresh_at"}}</label>
|
2019-06-03 00:59:35 +02:00
|
|
|
<div class="controls">
|
|
|
|
{{api.tokenRefreshAt}}
|
|
|
|
</div>
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-06-03 00:59:35 +02:00
|
|
|
{{/if}}
|
2019-05-30 07:04:34 +02:00
|
|
|
</div>
|
2019-05-31 09:54:11 +02:00
|
|
|
|
2022-06-02 16:45:20 +02:00
|
|
|
<div class="wizard-header medium">
|
2021-04-12 16:19:53 +02:00
|
|
|
{{i18n "admin.wizard.api.endpoint.label"}}
|
2019-05-31 09:54:11 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="wizard-api-endpoints">
|
2021-04-12 16:19:53 +02:00
|
|
|
{{d-button action=(action "addEndpoint") label="admin.wizard.api.endpoint.add" icon="plus"}}
|
2019-05-31 09:54:11 +02:00
|
|
|
|
2019-06-02 12:54:31 +02:00
|
|
|
{{#if api.endpoints}}
|
|
|
|
<div class="endpoint-list">
|
|
|
|
<ul>
|
|
|
|
{{#each api.endpoints as |endpoint|}}
|
|
|
|
<li>
|
|
|
|
<div class="endpoint">
|
2019-06-03 04:49:54 +02:00
|
|
|
<div class="endpoint-">
|
2019-08-13 06:11:46 +02:00
|
|
|
<div class="top">
|
2023-04-03 04:28:06 +02:00
|
|
|
<Input
|
|
|
|
@value={{this.endpoint.name}}
|
|
|
|
placeholder={{i18n "admin.wizard.api.endpoint.name"}}
|
|
|
|
/>
|
|
|
|
<Input
|
|
|
|
@value={{this.endpoint.url}}
|
|
|
|
placeholder={{i18n "admin.wizard.api.endpoint.url"}}
|
|
|
|
class="endpoint-url"
|
|
|
|
/>
|
2019-08-13 06:11:46 +02:00
|
|
|
{{d-button action=(action "removeEndpoint")
|
|
|
|
actionParam=endpoint
|
2021-04-12 16:19:53 +02:00
|
|
|
icon="times"
|
|
|
|
class="remove-endpoint"}}
|
2019-08-13 06:11:46 +02:00
|
|
|
</div>
|
|
|
|
<div class="bottom">
|
2020-02-02 11:42:05 +01:00
|
|
|
{{combo-box
|
|
|
|
content=endpointMethods
|
|
|
|
value=endpoint.method
|
2020-03-29 09:49:33 +02:00
|
|
|
onChange=(action (mut endpoint.method))
|
2020-03-22 07:47:56 +01:00
|
|
|
options=(hash
|
|
|
|
none="admin.wizard.api.endpoint.method"
|
|
|
|
)}}
|
2020-02-02 11:42:05 +01:00
|
|
|
{{combo-box
|
|
|
|
content=contentTypes
|
|
|
|
value=endpoint.content_type
|
2020-03-29 09:49:33 +02:00
|
|
|
onChange=(action (mut endpoint.content_type))
|
2020-03-22 07:47:56 +01:00
|
|
|
options=(hash
|
|
|
|
none="admin.wizard.api.endpoint.content_type"
|
|
|
|
)}}
|
2020-02-02 11:42:05 +01:00
|
|
|
{{multi-select
|
2020-04-22 15:03:18 +02:00
|
|
|
value=endpoint.success_codes
|
2020-02-02 11:42:05 +01:00
|
|
|
content=successCodes
|
2020-03-29 09:49:33 +02:00
|
|
|
onChange=(action (mut endpoint.success_codes))
|
2020-03-22 07:47:56 +01:00
|
|
|
options=(hash
|
|
|
|
none="admin.wizard.api.endpoint.success_codes"
|
|
|
|
)}}
|
2019-08-13 06:11:46 +02:00
|
|
|
</div>
|
2019-06-03 04:49:54 +02:00
|
|
|
</div>
|
2019-06-02 12:54:31 +02:00
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2019-05-31 09:54:11 +02:00
|
|
|
</div>
|
2019-06-06 18:10:13 +02:00
|
|
|
|
2022-06-02 16:45:20 +02:00
|
|
|
<div class="wizard-header medium">
|
2021-04-12 16:19:53 +02:00
|
|
|
{{i18n "admin.wizard.api.log.label"}}
|
2022-06-02 16:45:20 +02:00
|
|
|
|
|
|
|
<div class="controls">
|
|
|
|
{{d-button
|
|
|
|
action=(action "clearLogs")
|
|
|
|
class="clear-logs"
|
|
|
|
label="admin.wizard.api.log.clear"}}
|
|
|
|
</div>
|
2019-06-06 18:10:13 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="wizard-api-log">
|
2020-04-22 15:03:18 +02:00
|
|
|
<div class="log-list">
|
|
|
|
<table class="wizard-api-log-table">
|
2021-04-12 16:19:53 +02:00
|
|
|
<thead>
|
|
|
|
<th>Datetime</th>
|
|
|
|
<th>User</th>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>URL</th>
|
|
|
|
<th>Error</th>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{#each api.log as |logentry|}}
|
|
|
|
<tr>
|
|
|
|
<td>{{logentry.time}}</td>
|
|
|
|
<td class="user-image">
|
|
|
|
<div class="user-image-inner">
|
2022-06-02 16:45:20 +02:00
|
|
|
<a href={{logentry.userpath}} data-user-card={{logentry.username}}>{{avatar logentry imageSize="medium"}}</a>
|
2021-04-12 16:19:53 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td>{{logentry.status}}</td>
|
|
|
|
<td>{{logentry.url}}</td>
|
|
|
|
<td>{{logentry.error}}</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
|
|
|
</tbody>
|
2020-04-22 15:03:18 +02:00
|
|
|
</table>
|
|
|
|
</div>
|
2019-06-06 18:10:13 +02:00
|
|
|
</div>
|