Compare commits

...

6 commits

Author SHA1 Message Date
lci-sinersio
ca38de640c
Merge 3e0d48690f into 8a432ac937 2024-11-12 18:00:25 +00:00
Ionys
8a432ac937
fix(status page): Make sure the group deletion is correctly handled when groupIDList is empty (#5340)
Some checks failed
Auto Test / check-linters (push) Has been cancelled
Auto Test / armv7-simple-test (18, ARMv7) (push) Has been cancelled
Auto Test / armv7-simple-test (20, ARMv7) (push) Has been cancelled
Auto Test / e2e-test (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
validate / json-yaml-validate (push) Has been cancelled
validate / validate (push) Has been cancelled
Auto Test / auto-test (18, ARM64) (push) Has been cancelled
Auto Test / auto-test (18, macos-latest) (push) Has been cancelled
Auto Test / auto-test (18, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (18, windows-latest) (push) Has been cancelled
Auto Test / auto-test (20, ARM64) (push) Has been cancelled
Auto Test / auto-test (20, macos-latest) (push) Has been cancelled
Auto Test / auto-test (20, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (20, windows-latest) (push) Has been cancelled
2024-11-12 19:00:09 +01:00
lci-sinersio
3e0d48690f
Update serwersms.js 2024-06-03 14:26:24 +02:00
lci-sinersio
710e8fdf46
Update SerwerSMS.vue
Adds a description that group id can be used
2024-06-03 14:24:10 +02:00
lci-sinersio
665d930edc
Update pl.json
Adds a translation
2024-06-03 14:23:13 +02:00
lci-sinersio
1ece0faa76
Update serwersms.js
Adds the ability to use group_id
2024-06-03 14:19:31 +02:00
4 changed files with 21 additions and 7 deletions

View file

@ -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}`;

View file

@ -220,13 +220,17 @@ module.exports.statusPageSocketHandler = (socket) => {
// Delete groups that are not in the list
log.debug("socket", "Delete groups that are not in the list");
const slots = groupIDList.map(() => "?").join(",");
if (groupIDList.length === 0) {
await R.exec("DELETE FROM `group` WHERE status_page_id = ?", [ statusPage.id ]);
} else {
const slots = groupIDList.map(() => "?").join(",");
const data = [
...groupIDList,
statusPage.id
];
await R.exec(`DELETE FROM \`group\` WHERE id NOT IN (${slots}) AND status_page_id = ?`, data);
const data = [
...groupIDList,
statusPage.id
];
await R.exec(`DELETE FROM \`group\` WHERE id NOT IN (${slots}) AND status_page_id = ?`, data);
}
const server = UptimeKumaServer.getInstance();

View file

@ -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">

View file

@ -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",