Compare commits

...

6 commits

Author SHA1 Message Date
lci-sinersio
4b69c6b275
Merge 3e0d48690f into d2f71d11d6 2024-10-22 08:49:03 +00:00
Easy
d2f71d11d6
Update API URL to compatible with the latest version of ServerChan (#5227)
Some checks are pending
Auto Test / auto-test (18, ARM64) (push) Blocked by required conditions
Auto Test / auto-test (18, macos-latest) (push) Blocked by required conditions
Auto Test / auto-test (18, ubuntu-latest) (push) Blocked by required conditions
Auto Test / auto-test (18, windows-latest) (push) Blocked by required conditions
Auto Test / auto-test (20, ARM64) (push) Blocked by required conditions
Auto Test / auto-test (20, macos-latest) (push) Blocked by required conditions
Auto Test / auto-test (20, ubuntu-latest) (push) Blocked by required conditions
Auto Test / auto-test (20, windows-latest) (push) Blocked by required conditions
Auto Test / armv7-simple-test (18, ARMv7) (push) Waiting to run
Auto Test / armv7-simple-test (20, ARMv7) (push) Waiting to run
Auto Test / check-linters (push) Waiting to run
Auto Test / e2e-test (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Merge Conflict Labeler / Labeling (push) Waiting to run
json-yaml-validate / json-yaml-validate (push) Waiting to run
2024-10-22 10:48:51 +02: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 14 additions and 3 deletions

View file

@ -12,8 +12,9 @@ class ServerChan extends NotificationProvider {
const okMsg = "Sent Successfully.";
// serverchan3 requires sending via ft07.com
const url = String(notification.serverChanSendKey).startsWith("sctp")
? `https://${notification.serverChanSendKey}.push.ft07.com/send`
const matchResult = String(notification.serverChanSendKey).match(/^sctp(\d+)t/i);
const url = matchResult && matchResult[1]
? `https://${matchResult[1]}.push.ft07.com/send/${notification.serverChanSendKey}.send`
: `https://sctapi.ftqq.com/${notification.serverChanSendKey}.send`;
try {

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

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