1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/templates/admin-wizards-api.hbs

124 Zeilen
3,4 KiB
Handlebars

<div class="wizard-api-authorization">
<div class="details">
<div class="control-group">
<label>{{i18n 'admin.wizard.api.service'}}</label>
<div class="controls">
{{input value=api.service}}
</div>
<div class="control-label">
<span>{{i18n 'admin.wizard.api.redirect_uri'}}</span>
<span>{{api.redirectUri}}</span>
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth_type'}}</label>
<div class="controls">
{{combo-box value=api.authType content=authorizationTypes none='admin.wizard.api.auth_type_none'}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth_url'}}</label>
<div class="controls">
{{input value=api.authUrl}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.token_url'}}</label>
<div class="controls">
{{input value=api.tokenUrl}}
</div>
</div>
{{#if isOauth}}
<div class="control-group">
<label>{{i18n 'admin.wizard.api.client_id'}}</label>
<div class="controls">
{{input value=api.clientId}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.client_secret'}}</label>
<div class="controls">
{{input value=api.clientSecret}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.params'}}</label>
<div class="controls">
{{#each api.authParams as |param|}}
<div class="param">
{{input value=param.key placeholder=(i18n 'admin.wizard.api.param_key')}}
{{input value=param.value placeholder=(i18n 'admin.wizard.api.param_value')}}
{{d-button action='removeParam' actionParam=param icon='times'}}
</div>
{{/each}}
{{d-button label='admin.wizard.api.param_new' icon='plus' action='addParam'}}
</div>
</div>
{{/if}}
</div>
<div class='buttons'>
{{d-button label="admin.wizard.api.save" action="save"}}
{{#if savingApi}}
{{loading-spinner size="small"}}
{{/if}}
</div>
<div class='buttons'>
{{d-button label="admin.wizard.api.authorize" action="authorize"}}
</div>
<div class="authorization">
{{#if api.authorized}}
<span class="authorization-indicator authorized"></span>
<span>{{i18n "admin.wizard.api.authorized"}}</span>
{{else}}
<span class="authorization-indicator not-authorized"></span>
<span>{{i18n "admin.wizard.api.not_authorized"}}</span>
{{/if}}
</div>
<div class="keys">
<div class="control-group">
<label>Access Token:</label>
<div class="controls">
{{api.accessToken}}
</div>
</div>
<div class="control-group">
<label>Expires At:</label>
<div class="controls">
{{api.tokenExpiresAt}}
</div>
</div>
<div class="control-group">
<label>Refresh At:</label>
<div class="controls">
{{api.tokenRefreshAt}}
</div>
</div>
<div class="control-group">
<label>Refresh Token:</label>
<div class="controls">
{{api.refreshToken}}
</div>
</div>
<div class="control-group">
<label>Code:</label>
<div class="controls">
{{api.code}}
</div>
</div>
</div>
</div>