2022-06-30 18:30:50 +08:00
|
|
|
<LinkTo @route="adminWebHooks" class="go-back">
|
2017-07-27 04:25:09 +08:00
|
|
|
{{d-icon "arrow-left"}}
|
2016-06-16 01:49:57 +08:00
|
|
|
{{i18n "admin.web_hooks.go_back"}}
|
2022-06-30 18:30:50 +08:00
|
|
|
</LinkTo>
|
2016-06-16 01:49:57 +08:00
|
|
|
|
|
|
|
<div class="web-hook-container">
|
|
|
|
<p>{{i18n "admin.web_hooks.detailed_instruction"}}</p>
|
|
|
|
<form class="web-hook form-horizontal">
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="control-group">
|
2016-06-16 01:49:57 +08:00
|
|
|
<label for="payload-url">{{i18n "admin.web_hooks.payload_url"}}</label>
|
2022-07-06 01:41:31 +08:00
|
|
|
<TextField @name="payload-url" @value={{this.model.payload_url}} @placeholderKey="admin.web_hooks.payload_url_placeholder" />
|
|
|
|
<InputTip @validation={{this.urlValidation}} />
|
2016-06-16 01:49:57 +08:00
|
|
|
</div>
|
|
|
|
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="control-group">
|
2016-06-16 01:49:57 +08:00
|
|
|
<label for="content-type">{{i18n "admin.web_hooks.content_type"}}</label>
|
2022-07-06 01:41:31 +08:00
|
|
|
<ComboBox @content={{this.contentTypes}} @name="content-type" @value={{this.model.content_type}} @onChange={{action (mut this.model.content_type)}} />
|
2016-06-16 01:49:57 +08:00
|
|
|
</div>
|
|
|
|
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="control-group">
|
2016-06-16 01:49:57 +08:00
|
|
|
<label for="secret">{{i18n "admin.web_hooks.secret"}}</label>
|
2022-07-06 01:41:31 +08:00
|
|
|
<TextField @name="secret" @value={{this.model.secret}} @placeholderKey="admin.web_hooks.secret_placeholder" />
|
|
|
|
<InputTip @validation={{this.secretValidation}} />
|
2016-06-16 01:49:57 +08:00
|
|
|
</div>
|
|
|
|
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="control-group">
|
2016-06-16 01:49:57 +08:00
|
|
|
<label>{{i18n "admin.web_hooks.event_chooser"}}</label>
|
|
|
|
<div>
|
2022-07-06 01:41:31 +08:00
|
|
|
<RadioButton @class="subscription-choice" @name="subscription-choice" @value="individual" @selection={{this.model.webHookType}} />
|
2016-06-16 01:49:57 +08:00
|
|
|
{{i18n "admin.web_hooks.individual_event"}}
|
2022-07-06 01:41:31 +08:00
|
|
|
<InputTip @validation={{this.eventTypeValidation}} />
|
2016-06-16 01:49:57 +08:00
|
|
|
</div>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#unless this.model.wildcard_web_hook}}
|
2016-06-16 01:49:57 +08:00
|
|
|
<div class="event-selector">
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#each this.eventTypes as |type|}}
|
|
|
|
<AdminWebHookEventChooser @type={{type}} @model={{this.model.web_hook_event_types}} />
|
2016-06-16 01:49:57 +08:00
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
{{/unless}}
|
|
|
|
<div>
|
2022-07-06 01:41:31 +08:00
|
|
|
<RadioButton @class="subscription-choice" @name="subscription-choice" @value="wildcard" @selection={{this.model.webHookType}} />
|
2016-06-16 01:49:57 +08:00
|
|
|
{{i18n "admin.web_hooks.wildcard_event"}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="filters control-group">
|
2018-07-03 11:14:53 +08:00
|
|
|
<div class="filter">
|
2017-07-27 04:25:09 +08:00
|
|
|
<label>{{d-icon "circle" class="tracking"}}{{i18n "admin.web_hooks.categories_filter"}}</label>
|
2022-07-06 01:41:31 +08:00
|
|
|
<CategorySelector @categories={{this.model.categories}} @onChange={{action (mut this.model.categories)}} />
|
2016-06-16 01:49:57 +08:00
|
|
|
<div class="instructions">{{i18n "admin.web_hooks.categories_filter_instructions"}}</div>
|
|
|
|
</div>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.showTagsFilter}}
|
2018-12-05 17:14:06 +08:00
|
|
|
<div class="filter">
|
|
|
|
<label>{{d-icon "circle" class="tracking"}}{{i18n "admin.web_hooks.tags_filter"}}</label>
|
2022-07-06 01:41:31 +08:00
|
|
|
<TagChooser @tags={{this.model.tag_names}} @everyTag={{true}} @excludeSynonyms={{true}} />
|
2018-12-05 17:14:06 +08:00
|
|
|
<div class="instructions">{{i18n "admin.web_hooks.tags_filter_instructions"}}</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2018-07-03 11:14:53 +08:00
|
|
|
<div class="filter">
|
2017-07-27 04:25:09 +08:00
|
|
|
<label>{{d-icon "circle" class="tracking"}}{{i18n "admin.web_hooks.groups_filter"}}</label>
|
2022-07-06 01:41:31 +08:00
|
|
|
<GroupSelector @groupNames={{this.model.groupsFilterInName}} @groupFinder={{this.model.groupFinder}} />
|
2016-06-16 01:49:57 +08:00
|
|
|
<div class="instructions">{{i18n "admin.web_hooks.groups_filter_instructions"}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
<PluginOutlet @name="web-hook-fields" @tagName="span" @connectorTagName="div" @args={{hash model=this.model}} />
|
2016-12-23 00:08:35 +08:00
|
|
|
|
2016-06-16 01:49:57 +08:00
|
|
|
<div>
|
2022-07-06 16:37:54 +08:00
|
|
|
<Input @type="checkbox" name="verify_certificate" @checked={{this.model.verify_certificate}} /> {{i18n "admin.web_hooks.verify_certificate"}}
|
2016-06-16 01:49:57 +08:00
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div>
|
2022-07-06 16:37:54 +08:00
|
|
|
<Input @type="checkbox" name="active" @checked={{this.model.active}} /> {{i18n "admin.web_hooks.active"}}
|
2016-06-16 01:49:57 +08:00
|
|
|
</div>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.model.active}}
|
2016-06-16 01:49:57 +08:00
|
|
|
<div class="instructions">{{i18n "admin.web_hooks.active_notice"}}</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<div class="controls">
|
2022-07-06 01:41:31 +08:00
|
|
|
<DButton @class="btn-default" @translatedLabel={{this.saveButtonText}} @action={{action "save"}} @disabled={{this.saveButtonDisabled}} />
|
2019-01-10 18:06:01 +08:00
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#unless this.model.isNew}}
|
2022-06-30 18:30:50 +08:00
|
|
|
<DButton @class="btn-danger" @label="admin.web_hooks.destroy" @action={{action "destroy"}} />
|
2022-07-06 01:41:31 +08:00
|
|
|
<LinkTo @route="adminWebHooks.showEvents" @model={{this.model.id}} class="btn">
|
2016-06-16 01:49:57 +08:00
|
|
|
{{i18n "admin.web_hooks.events.go_events"}}
|
2022-06-30 18:30:50 +08:00
|
|
|
</LinkTo>
|
2016-06-16 01:49:57 +08:00
|
|
|
{{/unless}}
|
2022-07-06 01:41:31 +08:00
|
|
|
<span class="saving">{{this.savingStatus}}</span>
|
2016-06-16 01:49:57 +08:00
|
|
|
</div>
|
|
|
|
</div>
|