mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-17 18:37:16 +00:00
Edit webhook.js and Webhook.vue
Check linters
This commit is contained in:
parent
4c79cf1186
commit
ae0d07737e
2 changed files with 16 additions and 17 deletions
|
@ -42,9 +42,9 @@ class Webhook extends NotificationProvider {
|
||||||
heartbeatJSON,
|
heartbeatJSON,
|
||||||
monitorJSON
|
monitorJSON
|
||||||
});
|
});
|
||||||
}else if(notification.webhookContentType === "CompletlyCustom"){
|
} else if (notification.webhookContentType === "CompletlyCustom") {
|
||||||
|
|
||||||
if(msg.includes("Down")){
|
if (msg.includes("Down")) {
|
||||||
const tpl = JSON.parse(notification.webhookCustomBodyDown);
|
const tpl = JSON.parse(notification.webhookCustomBodyDown);
|
||||||
// Insert templated values into Body
|
// Insert templated values into Body
|
||||||
data = tpl;
|
data = tpl;
|
||||||
|
@ -60,7 +60,7 @@ class Webhook extends NotificationProvider {
|
||||||
throw "Additional Headers is not a valid JSON";
|
throw "Additional Headers is not a valid JSON";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
const tpl = JSON.parse(notification.webhookCustomBodyUp);
|
const tpl = JSON.parse(notification.webhookCustomBodyUp);
|
||||||
// Insert templated values into Body
|
// Insert templated values into Body
|
||||||
data = tpl;
|
data = tpl;
|
||||||
|
@ -79,7 +79,7 @@ class Webhook extends NotificationProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notification.webhookAdditionalHeaders && notification.webhookContentType != "CompletlyCustom") {
|
if (notification.webhookAdditionalHeaders && notification.webhookContentType !== "CompletlyCustom") {
|
||||||
try {
|
try {
|
||||||
config.headers = {
|
config.headers = {
|
||||||
...config.headers,
|
...config.headers,
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="mb-3" v-if="$parent.notification.webhookContentType != 'CompletlyCustom'">
|
<div v-if="$parent.notification.webhookContentType != 'CompletlyCustom'" class="mb-3" >
|
||||||
<label for="webhook-url" class="form-label">{{ $t("Post URL") }}</label>
|
<label for="webhook-url" class="form-label">{{ $t("Post URL") }}</label>
|
||||||
<input
|
<input
|
||||||
id="webhook-url"
|
id="webhook-url"
|
||||||
v-model="$parent.notification.webhookURL"
|
v-model="$parent.notification.webhookURL"
|
||||||
type="url"
|
type="url"
|
||||||
pattern="https?://.+"
|
pattern="https?://.+"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3" v-if="$parent.notification.webhookContentType == 'CompletlyCustom'">
|
<div v-if="$parent.notification.webhookContentType == 'CompletlyCustom'" class="mb-3" >
|
||||||
<label for="webhook-url" class="form-label">{{ $t("Post URL UP") }}</label>
|
<label for="webhook-url" class="form-label">{{ $t("Post URL UP") }}</label>
|
||||||
<input
|
<input
|
||||||
id="webhook-url"
|
id="webhook-url"
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3" v-if="$parent.notification.webhookContentType == 'CompletlyCustom'">
|
<div v-if="$parent.notification.webhookContentType == 'CompletlyCustom'" class="mb-3" >
|
||||||
<label for="webhook-url" class="form-label">{{ $t("Post URL DOWN") }}</label>
|
<label for="webhook-url" class="form-label">{{ $t("Post URL DOWN") }}</label>
|
||||||
<input
|
<input
|
||||||
id="webhook-url"
|
id="webhook-url"
|
||||||
|
@ -69,7 +69,6 @@
|
||||||
required
|
required
|
||||||
></textarea>
|
></textarea>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="$parent.notification.webhookContentType == 'CompletlyCustom'">
|
<template v-if="$parent.notification.webhookContentType == 'CompletlyCustom'">
|
||||||
<br>
|
<br>
|
||||||
<label for="customBodyUp" class="form-label">{{ $t("Body UP") }}</label>
|
<label for="customBodyUp" class="form-label">{{ $t("Body UP") }}</label>
|
||||||
|
|
Loading…
Reference in a new issue