Compare commits

...

6 commits

Author SHA1 Message Date
lci-sinersio
dc5dfe7921
Merge 3e0d48690f into 4228dd0a29 2024-11-19 00:29:48 +00:00
Ionys
4228dd0a29
Fix the timeout value (#5352)
Some checks failed
validate / validate (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 / check-linters (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
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-19 01:29:35 +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 18 additions and 5 deletions

View file

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

View file

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

View file

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

View file

@ -1443,11 +1443,14 @@ message HealthCheckResponse {
} }
} }
if (this.monitor.type === "snmp") { // Set a default timeout if the monitor type has changed or if it's a new monitor
if (oldType || this.isAdd) {
if (this.monitor.type === "snmp") {
// snmp is not expected to be executed via the internet => we can choose a lower default timeout // snmp is not expected to be executed via the internet => we can choose a lower default timeout
this.monitor.timeout = 5; this.monitor.timeout = 5;
} else { } else {
this.monitor.timeout = 48; this.monitor.timeout = 48;
}
} }
// Set default SNMP version // Set default SNMP version