2022-12-13 08:53:08 +08:00
|
|
|
<LinkTo @route="adminWebHooks" class="go-back">
|
|
|
|
{{d-icon "arrow-left"}}
|
|
|
|
{{i18n "admin.web_hooks.go_back"}}
|
|
|
|
</LinkTo>
|
|
|
|
|
|
|
|
<div class="web-hook-container">
|
|
|
|
<p>{{i18n "admin.web_hooks.detailed_instruction"}}</p>
|
|
|
|
|
|
|
|
<form class="web-hook form-horizontal">
|
|
|
|
<div class="control-group">
|
|
|
|
<label for="payload-url">{{i18n "admin.web_hooks.payload_url"}}</label>
|
|
|
|
<TextField
|
|
|
|
@name="payload-url"
|
|
|
|
@value={{this.model.payload_url}}
|
|
|
|
@placeholderKey="admin.web_hooks.payload_url_placeholder"
|
|
|
|
/>
|
|
|
|
<InputTip @validation={{this.urlValidation}} />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label for="content-type">{{i18n "admin.web_hooks.content_type"}}</label>
|
|
|
|
<ComboBox
|
|
|
|
@content={{this.contentTypes}}
|
|
|
|
@name="content-type"
|
|
|
|
@value={{this.model.content_type}}
|
|
|
|
@onChange={{action (mut this.model.content_type)}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label for="secret">{{i18n "admin.web_hooks.secret"}}</label>
|
|
|
|
<TextField
|
|
|
|
@name="secret"
|
|
|
|
@value={{this.model.secret}}
|
|
|
|
@placeholderKey="admin.web_hooks.secret_placeholder"
|
|
|
|
/>
|
|
|
|
<InputTip @validation={{this.secretValidation}} />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label>{{i18n "admin.web_hooks.event_chooser"}}</label>
|
2022-12-13 20:32:34 +08:00
|
|
|
|
|
|
|
<label class="subscription-choice">
|
|
|
|
<RadioButton
|
|
|
|
@name="subscription-choice"
|
2023-10-09 11:35:31 +08:00
|
|
|
@onChange={{action (mut this.model.wildcard_web_hook) false}}
|
|
|
|
@value={{false}}
|
|
|
|
@selection={{this.model.wildcard_web_hook}}
|
2022-12-13 20:32:34 +08:00
|
|
|
/>
|
2022-12-13 08:53:08 +08:00
|
|
|
{{i18n "admin.web_hooks.individual_event"}}
|
|
|
|
<InputTip @validation={{this.eventTypeValidation}} />
|
|
|
|
</label>
|
|
|
|
|
|
|
|
{{#unless this.model.wildcard_web_hook}}
|
|
|
|
<div class="event-selector">
|
2023-10-09 11:35:31 +08:00
|
|
|
{{#each-in this.groupedEventTypes as |group eventTypes|}}
|
|
|
|
<div class="event-group">
|
|
|
|
{{i18n (concat "admin.web_hooks." group "_event.group_name")}}
|
|
|
|
{{#each eventTypes as |type|}}
|
|
|
|
<WebhookEventChooser
|
|
|
|
@type={{type}}
|
|
|
|
@group={{group}}
|
|
|
|
@eventTypes={{this.model.web_hook_event_types}}
|
|
|
|
/>
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
{{/each-in}}
|
2022-12-13 08:53:08 +08:00
|
|
|
</div>
|
|
|
|
{{/unless}}
|
|
|
|
|
2022-12-13 20:32:34 +08:00
|
|
|
<label class="subscription-choice">
|
|
|
|
<RadioButton
|
|
|
|
@name="subscription-choice"
|
2023-10-09 11:35:31 +08:00
|
|
|
@onChange={{action (mut this.model.wildcard_web_hook) true}}
|
|
|
|
@value={{true}}
|
|
|
|
@selection={{this.model.wildcard_web_hook}}
|
2022-12-13 20:32:34 +08:00
|
|
|
/>
|
2022-12-13 08:53:08 +08:00
|
|
|
{{i18n "admin.web_hooks.wildcard_event"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="filters control-group">
|
|
|
|
<div class="filter">
|
|
|
|
<label>{{d-icon "circle" class="tracking"}}{{i18n
|
|
|
|
"admin.web_hooks.categories_filter"
|
|
|
|
}}</label>
|
|
|
|
<CategorySelector
|
|
|
|
@categories={{this.model.categories}}
|
|
|
|
@onChange={{action (mut this.model.categories)}}
|
|
|
|
/>
|
|
|
|
<div class="instructions">{{i18n
|
|
|
|
"admin.web_hooks.categories_filter_instructions"
|
|
|
|
}}</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{#if this.showTagsFilter}}
|
|
|
|
<div class="filter">
|
|
|
|
<label>{{d-icon "circle" class="tracking"}}{{i18n
|
|
|
|
"admin.web_hooks.tags_filter"
|
|
|
|
}}</label>
|
|
|
|
<TagChooser
|
|
|
|
@tags={{this.model.tag_names}}
|
|
|
|
@everyTag={{true}}
|
|
|
|
@excludeSynonyms={{true}}
|
|
|
|
/>
|
|
|
|
<div class="instructions">{{i18n
|
|
|
|
"admin.web_hooks.tags_filter_instructions"
|
|
|
|
}}</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
<div class="filter">
|
|
|
|
<label>{{d-icon "circle" class="tracking"}}{{i18n
|
|
|
|
"admin.web_hooks.groups_filter"
|
|
|
|
}}</label>
|
|
|
|
<GroupSelector
|
|
|
|
@groupNames={{this.model.groupsFilterInName}}
|
|
|
|
@groupFinder={{this.model.groupFinder}}
|
|
|
|
/>
|
|
|
|
<div class="instructions">{{i18n
|
|
|
|
"admin.web_hooks.groups_filter_instructions"
|
|
|
|
}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-01-31 19:33:26 +08:00
|
|
|
<span>
|
|
|
|
<PluginOutlet
|
|
|
|
@name="web-hook-fields"
|
|
|
|
@connectorTagName="div"
|
2023-01-31 20:58:31 +08:00
|
|
|
@outletArgs={{hash model=this.model}}
|
2023-01-31 19:33:26 +08:00
|
|
|
/>
|
|
|
|
</span>
|
2022-12-13 08:53:08 +08:00
|
|
|
|
|
|
|
<label>
|
|
|
|
<Input
|
|
|
|
@type="checkbox"
|
|
|
|
name="verify_certificate"
|
|
|
|
@checked={{this.model.verify_certificate}}
|
|
|
|
/>
|
|
|
|
{{i18n "admin.web_hooks.verify_certificate"}}
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
<Input @type="checkbox" name="active" @checked={{this.model.active}} />
|
|
|
|
{{i18n "admin.web_hooks.active"}}
|
|
|
|
</label>
|
|
|
|
|
|
|
|
{{#if this.model.active}}
|
|
|
|
<div class="instructions">{{i18n "admin.web_hooks.active_notice"}}</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<div class="controls">
|
|
|
|
<DButton
|
|
|
|
@translatedLabel={{this.saveButtonText}}
|
2023-08-31 17:49:35 +08:00
|
|
|
@action={{this.save}}
|
2022-12-13 08:53:08 +08:00
|
|
|
@disabled={{this.saveButtonDisabled}}
|
2023-08-31 17:49:35 +08:00
|
|
|
class="btn-primary admin-webhooks__save-button"
|
2022-12-13 08:53:08 +08:00
|
|
|
/>
|
|
|
|
|
|
|
|
{{#if this.model.isNew}}
|
|
|
|
<LinkTo @route="adminWebHooks" class="btn btn-default">
|
|
|
|
{{i18n "cancel"}}
|
|
|
|
</LinkTo>
|
|
|
|
{{else}}
|
|
|
|
<LinkTo
|
|
|
|
@route="adminWebHooks.show"
|
|
|
|
@model={{this.model}}
|
|
|
|
class="btn btn-default"
|
|
|
|
>
|
|
|
|
{{i18n "cancel"}}
|
|
|
|
</LinkTo>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
<span class="saving">{{this.savingStatus}}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|