diff --git a/src/components/notifications/Webhook.vue b/src/components/notifications/Webhook.vue index 4262ad06..8c67a274 100644 --- a/src/components/notifications/Webhook.vue +++ b/src/components/notifications/Webhook.vue @@ -12,9 +12,7 @@
- + -
-
-

{{ $t("webhookJsonDesc", ['"application/json"']) }}

-
-
- - - - -
-
- - - - - -
-
+
{{ $t("webhookJsonDesc", ['"application/json"']) }}
+ + + + +
@@ -67,15 +54,14 @@
-
- -
+
{{ $t("webhookAdditionalHeadersDesc") }}
@@ -90,18 +76,18 @@ export default { computed: { headersPlaceholder() { return this.$t("Example:", [ - ` -{ +`{ "Authorization": "Authorization Token" }`, ]); }, customBodyPlaceholder() { - return `Example: -{ - "Title": "Uptime Kuma Alert - {{ monitorJSON['name'] }}", + return this.$t("Example:", [ +`{ + "Title": "Uptime Kuma Alert{% if monitorJSON %} - {{ monitorJSON['name'] }}{% endif %}", "Body": "{{ msg }}" -}`; +}` + ]); } }, }; diff --git a/src/lang/en.json b/src/lang/en.json index e1b390fa..90d6de27 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -213,7 +213,12 @@ "Content Type": "Content Type", "webhookJsonDesc": "{0} is good for any modern HTTP servers such as Express.js", "webhookFormDataDesc": "{multipart} is good for PHP. The JSON will need to be parsed with {decodeFunction}", - "webhookCustomBodyDesc": "Define a custom HTTP Body for the request. Template variables {msg}, {heartbeat}, {monitor} are accepted.", + "liquidIntroduction": "Templatability is achieved via the Liquid templating language. Please refer to the {0} for usage instructions. These are the available variables:", + "templateMsg": "message of the notification", + "templateHeartbeatJSON": "object describing the heartbeat", + "templateMonitorJSON": "object describing the monitor", + "templateLimitedToUpDownCertNotifications": "only available for UP/DOWN/Certificate expiry notifications", + "templateLimitedToUpDownNotifications": "only available for UP/DOWN notifications", "webhookAdditionalHeadersTitle": "Additional Headers", "webhookAdditionalHeadersDesc": "Sets additional headers sent with the webhook. Each header should be defined as a JSON key/value.", "webhookBodyPresetOption": "Preset - {0}",