mirror of
https://github.com/koichixD/uptime-kuma.git
synced 2026-09-04 09:13:21 +00:00
feat(serwersms): add group messaging support (#6610)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
@@ -21,11 +21,16 @@ class SerwerSMS extends NotificationProvider {
|
||||
let data = {
|
||||
"username": notification.serwersmsUsername,
|
||||
"password": notification.serwersmsPassword,
|
||||
"phone": notification.serwersmsPhoneNumber,
|
||||
"text": msg.replace(/[^\x00-\x7F]/g, ""),
|
||||
"sender": notification.serwersmsSenderName,
|
||||
};
|
||||
|
||||
if (notification.serwersmsRecipientType === "group") {
|
||||
data.group_id = notification.serwersmsGroupId;
|
||||
} else {
|
||||
data.phone = notification.serwersmsPhoneNumber;
|
||||
}
|
||||
|
||||
let resp = await axios.post(url, data, config);
|
||||
|
||||
if (!resp.data.success) {
|
||||
|
||||
@@ -8,9 +8,21 @@
|
||||
<HiddenInput id="serwersms-key" v-model="$parent.notification.serwersmsPassword" :required="true" autocomplete="new-password"></HiddenInput>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="serwersms-recipient-type" class="form-label">{{ $t("serwersmsRecipientType") }}</label>
|
||||
<select id="serwersms-recipient-type" v-model="$parent.notification.serwersmsRecipientType" class="form-select">
|
||||
<option value="phone">{{ $t("serwersmsRecipientTypePhone") }}</option>
|
||||
<option value="group">{{ $t("serwersmsRecipientTypeGroup") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div v-if="$parent.notification.serwersmsRecipientType !== 'group'" class="mb-3">
|
||||
<label for="serwersms-phone-number" class="form-label">{{ $t("serwersmsPhoneNumber") }}</label>
|
||||
<input id="serwersms-phone-number" v-model="$parent.notification.serwersmsPhoneNumber" type="text" class="form-control" required>
|
||||
</div>
|
||||
<div v-if="$parent.notification.serwersmsRecipientType === 'group'" class="mb-3">
|
||||
<label for="serwersms-group-id" class="form-label">{{ $t("serwersmsGroupId") }}</label>
|
||||
<input id="serwersms-group-id" v-model="$parent.notification.serwersmsGroupId" type="text" class="form-control" required>
|
||||
<div class="form-text">{{ $t("serwersmsGroupIdHelptext") }}</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="serwersms-sender-name" class="form-label">{{ $t("serwersmsSenderName") }}</label>
|
||||
<input id="serwersms-sender-name" v-model="$parent.notification.serwersmsSenderName" type="text" minlength="3" maxlength="11" class="form-control">
|
||||
|
||||
@@ -808,6 +808,11 @@
|
||||
"serwersmsAPIUser": "API Username (incl. webapi_ prefix)",
|
||||
"serwersmsAPIPassword": "API Password",
|
||||
"serwersmsPhoneNumber": "Phone number",
|
||||
"serwersmsRecipientType": "Recipient type",
|
||||
"serwersmsRecipientTypePhone": "Phone number",
|
||||
"serwersmsRecipientTypeGroup": "Group",
|
||||
"serwersmsGroupId": "Group ID",
|
||||
"serwersmsGroupIdHelptext": "ID or group IDs in the Customer Panel. These identifiers can be downloaded using action groups / index or by copying them from the editing group in the Customer Panel.",
|
||||
"serwersmsSenderName": "SMS Sender Name (registered via customer portal)",
|
||||
"smseagleTo": "Phone number(s)",
|
||||
"smseagleGroup": "Phonebook group name(s)",
|
||||
|
||||
Reference in New Issue
Block a user