mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-17 18:37:16 +00:00
Compare commits
6 commits
d36795edbc
...
4b69c6b275
Author | SHA1 | Date | |
---|---|---|---|
|
4b69c6b275 | ||
|
d2f71d11d6 | ||
|
3e0d48690f | ||
|
710e8fdf46 | ||
|
665d930edc | ||
|
1ece0faa76 |
4 changed files with 14 additions and 3 deletions
|
@ -12,8 +12,9 @@ class ServerChan extends NotificationProvider {
|
||||||
const okMsg = "Sent Successfully.";
|
const okMsg = "Sent Successfully.";
|
||||||
|
|
||||||
// serverchan3 requires sending via ft07.com
|
// serverchan3 requires sending via ft07.com
|
||||||
const url = String(notification.serverChanSendKey).startsWith("sctp")
|
const matchResult = String(notification.serverChanSendKey).match(/^sctp(\d+)t/i);
|
||||||
? `https://${notification.serverChanSendKey}.push.ft07.com/send`
|
const url = matchResult && matchResult[1]
|
||||||
|
? `https://${matchResult[1]}.push.ft07.com/send/${notification.serverChanSendKey}.send`
|
||||||
: `https://sctapi.ftqq.com/${notification.serverChanSendKey}.send`;
|
: `https://sctapi.ftqq.com/${notification.serverChanSendKey}.send`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -17,6 +17,8 @@ class SerwerSMS extends NotificationProvider {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Use phone as first option
|
||||||
let data = {
|
let data = {
|
||||||
"username": notification.serwersmsUsername,
|
"username": notification.serwersmsUsername,
|
||||||
"password": notification.serwersmsPassword,
|
"password": notification.serwersmsPassword,
|
||||||
|
@ -27,6 +29,13 @@ class SerwerSMS extends NotificationProvider {
|
||||||
|
|
||||||
let resp = await axios.post(url, data, config);
|
let resp = await axios.post(url, data, config);
|
||||||
|
|
||||||
|
if (!resp.data.success) {
|
||||||
|
// If unsuccessful, try using group_id
|
||||||
|
data.phone = null; // Clear phone number
|
||||||
|
data.group_id = notification.serwersmsPhoneNumber;
|
||||||
|
resp = await axios.post(url, data, config);
|
||||||
|
}
|
||||||
|
|
||||||
if (!resp.data.success) {
|
if (!resp.data.success) {
|
||||||
if (resp.data.error) {
|
if (resp.data.error) {
|
||||||
let error = `SerwerSMS.pl API returned error code ${resp.data.error.code} (${resp.data.error.type}) with error message: ${resp.data.error.message}`;
|
let error = `SerwerSMS.pl API returned error code ${resp.data.error.code} (${resp.data.error.type}) with error message: ${resp.data.error.message}`;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<HiddenInput id="serwersms-key" v-model="$parent.notification.serwersmsPassword" :required="true" autocomplete="new-password"></HiddenInput>
|
<HiddenInput id="serwersms-key" v-model="$parent.notification.serwersmsPassword" :required="true" autocomplete="new-password"></HiddenInput>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="serwersms-phone-number" class="form-label">{{ $t("serwersmsPhoneNumber") }}</label>
|
<label for="serwersms-phone-number" class="form-label">{{ $t("serwersmsPhoneNumberGroupId") }}</label>
|
||||||
<input id="serwersms-phone-number" v-model="$parent.notification.serwersmsPhoneNumber" type="text" class="form-control" required>
|
<input id="serwersms-phone-number" v-model="$parent.notification.serwersmsPhoneNumber" type="text" class="form-control" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
|
|
@ -360,6 +360,7 @@
|
||||||
"serwersmsAPIUser": "Nazwa użytkownika API (z prefiksem webapi_)",
|
"serwersmsAPIUser": "Nazwa użytkownika API (z prefiksem webapi_)",
|
||||||
"serwersmsAPIPassword": "Hasło API",
|
"serwersmsAPIPassword": "Hasło API",
|
||||||
"serwersmsPhoneNumber": "Numer telefonu",
|
"serwersmsPhoneNumber": "Numer telefonu",
|
||||||
|
"serwersmsPhoneNumberGroupId": "Numer telefonu lub ID Grupy",
|
||||||
"serwersmsSenderName": "Nazwa nadawcy (zatwierdzona w panelu klienta)",
|
"serwersmsSenderName": "Nazwa nadawcy (zatwierdzona w panelu klienta)",
|
||||||
"smseagle": "SMSEagle",
|
"smseagle": "SMSEagle",
|
||||||
"smseagleTo": "Numer/y telefonu",
|
"smseagleTo": "Numer/y telefonu",
|
||||||
|
|
Loading…
Reference in a new issue