Modified files and last correction

pull/4558/head
Simon Nilsson 9 months ago
parent 300c21d3ab
commit 23af76c43d

@ -1,12 +1,9 @@
const NotificationProvider = require("./notification-provider");
const { DOWN, UP } = require("../../src/util");
const { default: axios } = require("axios");
const Crypto = require("crypto");
const qs = require("qs");
class CellsyntMobileServices extends NotificationProvider {
class Cellsynt extends NotificationProvider {
name = "CellsyntMobileServices";
name = "Cellsynt";
/**
* @inheritdoc
@ -48,17 +45,6 @@ class CellsyntMobileServices extends NotificationProvider {
/* Identifier which will be visible on recipient's mobile phone as
originator of the message. Allowed values and function depends
on parameter originatortype's value according to below:
** numeric **
Numeric value (max 15 digits) with telephone number on
international format without leading 00 (example UK number
07920 110 000 should be set as 447920110000). Receiving
mobile phone will add a leading + sign and thus see the
originator as a normal mobile phone number (+447920110000).
Therefore it is also possible to reply to the message.
** shortcode **
Numerical value (max 15 digits). Used to set a shortcode in an
operator network as originator (i.e. will be shown without leading
+ sign, e.g. 72456).
** alpha **
3Send SMS
Alphanumeric string (max 11 characters). The following
@ -66,12 +52,19 @@ class CellsyntMobileServices extends NotificationProvider {
characters may work but functionality can not be guaranteed.
Recipients can not reply to messages with alphanumeric
originators
** numeric **
Numeric value (max 15 digits) with telephone number on
international format without leading 00 (example UK number
07920 110 000 should be set as 447920110000). Receiving
mobile phone will add a leading + sign and thus see the
originator as a normal mobile phone number (+447920110000).
Therefore it is also possible to reply to the message.
*/
//"originator": "uptime-kuma",
"originator": notification.cellsyntOriginator,
/* Type of message that should be sent. Possible values: text
(default), binary and unicode */
"type": "text",
//"type": "text",
/* Maximum number of SMS permitted to be linked together when
needed (default value is 1, see Long SMS). Maximum value is 6
@ -79,19 +72,6 @@ class CellsyntMobileServices extends NotificationProvider {
*/
"allowconcat": notification.cellsyntAllowLongSMS?6:1,
/* Can be used if you want to prevent a message from being
delivered after a certain time, e.g. 9 PM the same evening if
information thereafter is considered invalid / outdated. If
message has not been delivered after the set time (e.g. mobile
phone was switched off) you will get a delivery receipt with
status "failed".
Value should be given as a Unix timestamp. Different operators
permit different allowed max values (e.g. 3 days expiry time). If
a value is set that is above an operator's max allowed time it will
be adjusted to the highest possible value.
*/
//"expiry": "9 PM",
/* Value can be set to true if message should be sent as "flash
message", i.e. displayed directly on phone screen instead of
being saved to inbox. This is identical to setting class=0.
@ -132,8 +112,6 @@ class CellsyntMobileServices extends NotificationProvider {
let resp = await axios.post("https://se-1.cellsynt.net/sms.php", null, data);
if(typeof resp.data == undefined || resp.data == null || resp.data.includes("Error")) {
this.throwGeneralAxiosError(resp.data);
}else{
}
}catch (error) {
this.throwGeneralAxiosError(error);
@ -146,4 +124,4 @@ class CellsyntMobileServices extends NotificationProvider {
}
}
module.exports = CellsyntMobileServices;
module.exports = Cellsynt;

@ -53,7 +53,7 @@ const GoAlert = require("./notification-providers/goalert");
const SMSManager = require("./notification-providers/smsmanager");
const ServerChan = require("./notification-providers/serverchan");
const ZohoCliq = require("./notification-providers/zoho-cliq");
const CellsyntMobileServices = require("./notification-providers/cellsyntmobileservices");
const Cellsynt = require("./notification-providers/cellsynt");
class Notification {
@ -119,7 +119,7 @@ class Notification {
new WeCom(),
new GoAlert(),
new ZohoCliq(),
new CellsyntMobileServices()
new Cellsynt()
];
for (let item of list) {
if (! item.name) {

@ -151,7 +151,7 @@ export default {
"webhook": "Webhook",
"GoAlert": "GoAlert",
"ZohoCliq": "ZohoCliq",
"CellsyntMobileServices": "Cellsynt mobile services"
"Cellsynt": "Cellsynt"
};
// Put notifications here if it's not supported in most regions or its documentation is not in English

@ -0,0 +1,59 @@
<template>
<div class="mb-3">
<label for="cellsynt-login" class="form-label">{{ $t("Username") }}</label>
<input id="cellsynt-login" v-model="$parent.notification.cellsyntLogin" type="text" class="form-control" required>
</div>
<div class="mb-3">
<label for="cellsynt-key" class="form-label">{{ $t("Password") }}</label>
<HiddenInput id="cellsynt-key" v-model="$parent.notification.cellsyntPassword" :required="true" autocomplete="new-password"></HiddenInput>
</div>
<div class="mb-3">
<label for="cellsynt-Originatortype" class="form-label">{{ $t("Originator type") }}</label>
<select id="cellsynt-Originatortype" v-model="$parent.notification.cellsyntOriginatortype" :required="true" class="form-select">
<option value="alpha">{{ $t("Alpha (recommended)") }}</option>
<option value="numeric">{{ $t("Numeric") }}</option>
</select>
<div class="form-text">
<p><b>{{ $t("Alpha (recommended)") }}:</b><br>
{{ $t("Alphanumeric string (max 11 characters). The following characters are guaranteed to work: a-z, A-Z and 0-9. Other characters may work but functionality can not be guaranteed. Recipients can not reply to messages with alphanumeric originators.") }}</p>
<p><b>{{ $t("Numeric") }}:</b><br>
{{ $t("Numeric value (max 15 digits) with telephone number on international format without leading 00 (example UK number 07920 110 000 should be set as 447920110000). Receiving mobile phone will add a leading + sign and thus see the originator as a normal mobile phone number (+447920110000). Therefore it is also possible to reply to the message.") }}</p>
</div>
</div>
<div class="mb-3">
<label for="cellsynt-originator" class="form-label">{{ $t("Originator") }}</label>
<input id="cellsynt-originator" v-model="$parent.notification.cellsyntOriginator" type="text" class="form-control" required>
<div class="form-text"><p>{{ $t("Identifier which will be visible on recipient's mobile phone as originator of the message. Allowed values and function depends on parameter originatortype.") }}</p></div>
</div>
<div class="mb-3">
<label for="cellsynt-destination" class="form-label">{{ $t("Destination") }}</label>
<input id="cellsynt-destination" v-model="$parent.notification.cellsyntDestination" type="text" class="form-control" required>
<div class="form-text"><p>{{ $t("Recipient's telephone number on international format with leading 00 followed by country code, e.g. 00447920110000 for UK number 07920 110 000 (max 17 digits in total). To send the same message to multiple recipients, separate numbers with comma. Max 25000 recipients per HTTP request.") }}</p></div>
</div>
<div class="form-check form-switch">
<input id="cellsynt-allow-long" v-model="$parent.notification.cellsyntAllowLongSMS" type="checkbox" class="form-check-input">
<label for="cellsynt-allow-long" class="form-label">{{ $t("Allow Long SMS") }}</label>
<div class="form-text">{{ $t("Long SMS (also known as \"concatenated SMS\") enables sending messages exceeding 160 characters.") }}</div>
</div>
<div class="mb-3">
<label for="cellsynt-destination" class="form-label">{{ $t("Details") }}</label>
<div class="form-text">
{{ $t("For sign-up and price information check out this link") }}, <a href="https://www.cellsynt.com/en/" target="_blank">https://www.cellsynt.com/en/</a>
</div>
</div>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput
},
mounted() {
this.$parent.notification.cellsyntOriginator = "uptime-kuma";
this.$parent.notification.cellsyntOriginatortype = "alpha";
console.log("hello world");
}
};
</script>

@ -1,75 +0,0 @@
<template>
<div class="mb-3">
<label for="cellsynt-login" class="form-label">{{ $t("Username") }}</label>
<input id="cellsynt-login" v-model="$parent.notification.cellsyntLogin" type="text" class="form-control" required>
</div>
<div class="mb-3">
<label for="cellsynt-key" class="form-label">{{ $t("Password") }}</label>
<HiddenInput id="cellsynt-key" v-model="$parent.notification.cellsyntPassword" :required="true" autocomplete="new-password"></HiddenInput>
</div>
<div class="mb-3">
<label for="cellsynt-Originatortype" class="form-label">{{ $t("Originator type") }}</label>
<select id="cellsynt-Originatortype" v-model="$parent.notification.cellsyntOriginatortype" :required="true" class="form-select">
<option value="numeric">{{ $t("Numeric") }}</option>
<option value="shortcode">{{ $t("Shortcode") }}</option>
<option value="alpha">{{ $t("Alpha") }}</option>
</select>
<div class="form-text">
<p><b>Numeric:</b><br>
Numeric value (max 15 digits) with telephone number on
international format without leading 00 (example UK number
07920 110 000 should be set as 447920110000). Receiving
mobile phone will add a leading + sign and thus see the
originator as a normal mobile phone number (+447920110000).
Therefore it is also possible to reply to the message.</p>
<p><b>Shortcode:</b><br>
Numerical value (max 15 digits). Used to set a shortcode in an
operator network as originator (i.e. will be shown without leading
+ sign, e.g. 72456).</p>
<p><b>Alpha:</b><br>
Alphanumeric string (max 11 characters). The following
characters are guaranteed to work: a-z, A-Z and 0-9. Other
characters may work but functionality can not be guaranteed.
Recipients can not reply to messages with alphanumeric
originators.</p>
</div>
</div>
<div class="mb-3">
<label for="cellsynt-originator" class="form-label">{{ $t("Originator") }}</label>
<input id="cellsynt-originator" v-model="$parent.notification.cellsyntOriginator" type="text" class="form-control" required>
<div class="form-text"><p>Identifier which will be visible on recipient's mobile phone as
originator of the message. Allowed values and function depends
on parameter originatortype</p></div>
</div>
<div class="mb-3">
<label for="cellsynt-destination" class="form-label">{{ $t("Destination") }}</label>
<input id="cellsynt-destination" v-model="$parent.notification.cellsyntDestination" type="text" class="form-control" required>
<div class="form-text"><p>Recipient's telephone number on international format with
leading 00 followed by country code, e.g. 00447920110000 for
UK number 07920 110 000 (max 17 digits in total).
To send the same message to multiple recipients, separate
numbers with comma. Max 25000 recipients per HTTP request.</p></div>
</div>
<div class="form-check form-switch">
<input id="cellsynt-allow-long" v-model="$parent.notification.cellsyntAllowLongSMS" type="checkbox" class="form-check-input">
<label for="cellsynt-allow-long" class="form-label">{{ $t("Allow Long SMS") }}</label>
<div class="form-text">Long SMS (also known as "concatenated SMS") enables sending messages exceeding 160
characters.</div>
</div>
<div class="mb-3">
<label for="cellsynt-destination" class="form-label">{{ $t("Details") }}</label>
<div class="form-text">
For sign-up and price information check out this link, <a href="https://www.cellsynt.com/en/" target="_blank">https://www.cellsynt.com/en/</a>
</div>
</div>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput
}
};
</script>

@ -51,7 +51,7 @@ import WeCom from "./WeCom.vue";
import GoAlert from "./GoAlert.vue";
import ZohoCliq from "./ZohoCliq.vue";
import Splunk from "./Splunk.vue";
import CellsyntMobileServices from "./CellsyntMobileServices.vue";
import Cellsynt from "./Cellsynt.vue";
/**
@ -113,7 +113,7 @@ const NotificationFormList = {
"GoAlert": GoAlert,
"ServerChan": ServerChan,
"ZohoCliq": ZohoCliq,
"CellsyntMobileServices": CellsyntMobileServices
"Cellsynt": Cellsynt
};
export default NotificationFormList;

Loading…
Cancel
Save