mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
Compare commits
6 commits
5ca4f172c0
...
ca38de640c
Author | SHA1 | Date | |
---|---|---|---|
|
ca38de640c | ||
|
8a432ac937 | ||
|
3e0d48690f | ||
|
710e8fdf46 | ||
|
665d930edc | ||
|
1ece0faa76 |
4 changed files with 21 additions and 7 deletions
|
@ -17,6 +17,8 @@ class SerwerSMS extends NotificationProvider {
|
|||
"Content-Type": "application/json",
|
||||
}
|
||||
};
|
||||
|
||||
// Use phone as first option
|
||||
let data = {
|
||||
"username": notification.serwersmsUsername,
|
||||
"password": notification.serwersmsPassword,
|
||||
|
@ -27,6 +29,13 @@ class SerwerSMS extends NotificationProvider {
|
|||
|
||||
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.error) {
|
||||
let error = `SerwerSMS.pl API returned error code ${resp.data.error.code} (${resp.data.error.type}) with error message: ${resp.data.error.message}`;
|
||||
|
|
|
@ -220,6 +220,9 @@ module.exports.statusPageSocketHandler = (socket) => {
|
|||
|
||||
// Delete groups that are not in the list
|
||||
log.debug("socket", "Delete groups that are not in the list");
|
||||
if (groupIDList.length === 0) {
|
||||
await R.exec("DELETE FROM `group` WHERE status_page_id = ?", [ statusPage.id ]);
|
||||
} else {
|
||||
const slots = groupIDList.map(() => "?").join(",");
|
||||
|
||||
const data = [
|
||||
|
@ -227,6 +230,7 @@ module.exports.statusPageSocketHandler = (socket) => {
|
|||
statusPage.id
|
||||
];
|
||||
await R.exec(`DELETE FROM \`group\` WHERE id NOT IN (${slots}) AND status_page_id = ?`, data);
|
||||
}
|
||||
|
||||
const server = UptimeKumaServer.getInstance();
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<HiddenInput id="serwersms-key" v-model="$parent.notification.serwersmsPassword" :required="true" autocomplete="new-password"></HiddenInput>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
|
|
|
@ -360,6 +360,7 @@
|
|||
"serwersmsAPIUser": "Nazwa użytkownika API (z prefiksem webapi_)",
|
||||
"serwersmsAPIPassword": "Hasło API",
|
||||
"serwersmsPhoneNumber": "Numer telefonu",
|
||||
"serwersmsPhoneNumberGroupId": "Numer telefonu lub ID Grupy",
|
||||
"serwersmsSenderName": "Nazwa nadawcy (zatwierdzona w panelu klienta)",
|
||||
"smseagle": "SMSEagle",
|
||||
"smseagleTo": "Numer/y telefonu",
|
||||
|
|
Loading…
Reference in a new issue