2021-09-17 04:07:03 -04:00
|
|
|
<template>
|
|
|
|
<div class="mb-3">
|
2021-09-21 01:02:41 -04:00
|
|
|
<label for="webhook-url" class="form-label">{{ $t("Post URL") }}</label>
|
2022-07-18 12:04:18 -04:00
|
|
|
<input
|
|
|
|
id="webhook-url"
|
|
|
|
v-model="$parent.notification.webhookURL"
|
|
|
|
type="url"
|
|
|
|
pattern="https?://.+"
|
|
|
|
class="form-control"
|
|
|
|
required
|
|
|
|
/>
|
2021-09-17 04:07:03 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3">
|
2022-10-05 11:48:07 -04:00
|
|
|
<label for="webhook-content-type" class="form-label">{{
|
|
|
|
$t("Content Type")
|
|
|
|
}}</label>
|
2022-07-18 12:04:18 -04:00
|
|
|
<select
|
|
|
|
id="webhook-content-type"
|
|
|
|
v-model="$parent.notification.webhookContentType"
|
|
|
|
class="form-select"
|
|
|
|
required
|
|
|
|
>
|
|
|
|
<option value="json">application/json</option>
|
|
|
|
<option value="form-data">multipart/form-data</option>
|
2021-09-17 04:07:03 -04:00
|
|
|
</select>
|
|
|
|
|
|
|
|
<div class="form-text">
|
2022-10-05 11:48:07 -04:00
|
|
|
<p>{{ $t("webhookJsonDesc", ['"application/json"']) }}</p>
|
2021-09-30 07:22:17 -04:00
|
|
|
<i18n-t tag="p" keypath="webhookFormDataDesc">
|
2021-09-30 07:48:24 -04:00
|
|
|
<template #multipart>"multipart/form-data"</template>
|
|
|
|
<template #decodeFunction>
|
|
|
|
<strong>json_decode($_POST['data'])</strong>
|
|
|
|
</template>
|
2021-09-21 01:02:41 -04:00
|
|
|
</i18n-t>
|
2021-09-17 04:07:03 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-07-18 12:04:18 -04:00
|
|
|
|
|
|
|
<div class="mb-3">
|
2022-10-05 11:48:07 -04:00
|
|
|
<i18n-t
|
|
|
|
tag="label"
|
|
|
|
class="form-label"
|
|
|
|
for="additionalHeaders"
|
|
|
|
keypath="webhookAdditionalHeadersTitle"
|
|
|
|
>
|
|
|
|
</i18n-t>
|
|
|
|
<textarea
|
|
|
|
id="additionalHeaders"
|
|
|
|
v-model="$parent.notification.webhookAdditionalHeaders"
|
|
|
|
class="form-control"
|
|
|
|
:placeholder="headersPlaceholder"
|
|
|
|
></textarea>
|
|
|
|
<div class="form-text">
|
|
|
|
<i18n-t tag="p" keypath="webhookAdditionalHeadersDesc"> </i18n-t>
|
|
|
|
</div>
|
2022-07-18 12:04:18 -04:00
|
|
|
</div>
|
2021-09-17 04:07:03 -04:00
|
|
|
</template>
|
2022-07-18 12:04:18 -04:00
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2022-10-05 11:48:07 -04:00
|
|
|
computed: {
|
|
|
|
headersPlaceholder() {
|
|
|
|
return this.$t("Example:", [
|
|
|
|
`
|
|
|
|
{
|
|
|
|
"HeaderName": "HeaderValue"
|
|
|
|
}`,
|
|
|
|
]);
|
|
|
|
},
|
2022-07-18 12:04:18 -04:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
2022-10-05 11:48:07 -04:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
textarea {
|
|
|
|
min-height: 200px;
|
|
|
|
}
|
|
|
|
</style>
|