Made sure that the notification provider is not different from the other notification providers

pull/4219/head
Frank Elsinga 3 weeks ago committed by GitHub
parent d2ff2ea385
commit 971373beed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,9 +1,8 @@
const NotificationProvider = require("./notification-provider");
const Axios = require("axios");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");
class SevenIO extends NotificationProvider {
name = "SevenIO";
/**
@ -18,18 +17,18 @@ class SevenIO extends NotificationProvider {
text: msg,
};
const axios = Axios.create({
const config = {
baseURL: "https://gateway.seven.io/api/",
headers: {
"Content-Type": "application/json",
"X-API-Key": notification.sevenioApiKey,
},
});
};
try {
// testing or certificate expiry notification
if (heartbeatJSON == null) {
await axios.post("sms", data);
await axios.post("sms", data, config);
return okMsg;
}
@ -67,7 +66,7 @@ class SevenIO extends NotificationProvider {
data.text = `Your service ${monitorJSON["name"]} ${address}went back up at ${heartbeatJSON["localDateTime"]} ` +
`(${heartbeatJSON["timezone"]}).`;
}
await axios.post("sms", data);
await axios.post("sms", data, config);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);

@ -1,7 +1,7 @@
<template>
<div class="mb-3">
<label for="sevenio-api-key" class="form-label">{{ $t("apiKeySevenIO") }}</label>
<input id="sevenio-api-key" v-model="$parent.notification.sevenioApiKey" type="password" class="form-control" required autocomplete="false">
<HiddenInput id="sevenio-api-key" v-model="$parent.notification.sevenioApiKey" :required="true" autocomplete="new-password"></HiddenInput>
<div class="form-text">
{{ $t("wayToGetSevenIOApiKey") }}
</div>
@ -20,3 +20,12 @@
</div>
</div>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
};
</script>

Loading…
Cancel
Save