diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 50b919d3..9745a76a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -79,7 +79,7 @@ body: label: "🖥️ Deployment Environment" description: | examples: - - **Runtime**: Docker 20.10.9 / nodejs 14.18.0 / K8S via ... v1.3.3 / .. + - **Runtime**: Docker 20.10.9 / nodejs 18.17.1 / K8S via ... v1.3.3 / .. - **Database**: sqlite/embedded mariadb/external mariadb - **Filesystem used to store the database on**: Windows/ZFS/btrfs/NFSv3 on a SSD/HDD/eMMC - **number of monitors**: 42 diff --git a/.github/workflows/auto-test.yml b/.github/workflows/auto-test.yml index d0629f7b..c791bc88 100644 --- a/.github/workflows/auto-test.yml +++ b/.github/workflows/auto-test.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest, ARM64] - node: [ 16, 20.5 ] + node: [ 18, 20.5 ] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: @@ -33,13 +33,9 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - - - name: Install - run: npm install - - name: Build - run: npm run build - - name: Test Backend - run: npm run test-backend + - run: npm install + - run: npm run build + - run: npm run test-backend env: HEADLESS_TEST: 1 JUST_FOR_TEST: ${{ secrets.JUST_FOR_TEST }} @@ -53,7 +49,7 @@ jobs: strategy: matrix: os: [ ARMv7 ] - node: [ 14, 20 ] + node: [ 18, 20 ] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/.github/workflows/close-incorrect-issue.yml b/.github/workflows/close-incorrect-issue.yml index e26cf5e5..3ef5ba37 100644 --- a/.github/workflows/close-incorrect-issue.yml +++ b/.github/workflows/close-incorrect-issue.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node-version: [16] + node-version: [18] steps: - uses: actions/checkout@v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2eedd548..d9c0952c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -230,8 +230,8 @@ The goal is to make the Uptime Kuma installation as easy as installing a mobile ## Tools -- [`Node.js`](https://nodejs.org/) >= 14 -- [`npm`](https://www.npmjs.com/) >= 8.5 +- [`Node.js`](https://nodejs.org/) >= 18 +- [`npm`](https://www.npmjs.com/) >= 9.3 - [`git`](https://git-scm.com/) - IDE that supports [`ESLint`](https://eslint.org/) and EditorConfig (I am using [`IntelliJ IDEA`](https://www.jetbrains.com/idea/)) - A SQLite GUI tool (f.ex. [`SQLite Expert Personal`](https://www.sqliteexpert.com/download.html) or [`DBeaver Community`](https://dbeaver.io/download/)) diff --git a/README.md b/README.md index ebeca525..0459692a 100644 --- a/README.md +++ b/README.md @@ -56,15 +56,12 @@ Requirements: - ✅ Major Linux distros such as Debian, Ubuntu, CentOS, Fedora and ArchLinux etc. - ✅ Windows 10 (x64), Windows Server 2012 R2 (x64) or higher - ❌ Replit / Heroku -- [Node.js](https://nodejs.org/en/download/) 14 / 16 / 18 / 20.4 +- [Node.js](https://nodejs.org/en/download/) 18 / 20.4 - [npm](https://docs.npmjs.com/cli/) 9 - [Git](https://git-scm.com/downloads) - [pm2](https://pm2.keymetrics.io/) - For running Uptime Kuma in the background ```bash -# Update your npm -npm install npm@9 -g - git clone https://github.com/louislam/uptime-kuma.git cd uptime-kuma npm run setup diff --git a/db/knex_init_db.js b/db/knex_init_db.js index 7ce1bb48..46bff4bf 100644 --- a/db/knex_init_db.js +++ b/db/knex_init_db.js @@ -318,7 +318,10 @@ async function createTables() { // monitor_tls_info await knex.schema.createTable("monitor_tls_info", (table) => { table.increments("id"); - table.integer("monitor_id").unsigned().notNullable(); //TODO: no fk ? + table.integer("monitor_id").unsigned().notNullable() + .references("id").inTable("monitor") + .onDelete("CASCADE") + .onUpdate("CASCADE"); table.text("info_json"); }); diff --git a/db/knex_migrations/2024-01-22-0000-stats-extras.js b/db/knex_migrations/2024-01-22-0000-stats-extras.js new file mode 100644 index 00000000..b92e8892 --- /dev/null +++ b/db/knex_migrations/2024-01-22-0000-stats-extras.js @@ -0,0 +1,26 @@ +exports.up = function (knex) { + return knex.schema + .alterTable("stat_daily", function (table) { + table.text("extras").defaultTo(null).comment("Extra statistics during this time period"); + }) + .alterTable("stat_minutely", function (table) { + table.text("extras").defaultTo(null).comment("Extra statistics during this time period"); + }) + .alterTable("stat_hourly", function (table) { + table.text("extras").defaultTo(null).comment("Extra statistics during this time period"); + }); + +}; + +exports.down = function (knex) { + return knex.schema + .alterTable("stat_daily", function (table) { + table.dropColumn("extras"); + }) + .alterTable("stat_minutely", function (table) { + table.dropColumn("extras"); + }) + .alterTable("stat_hourly", function (table) { + table.dropColumn("extras"); + }); +}; diff --git a/db/old_migrations/patch-monitor-tls-info-add-fk.sql b/db/old_migrations/patch-monitor-tls-info-add-fk.sql new file mode 100644 index 00000000..9b9c2d2c --- /dev/null +++ b/db/old_migrations/patch-monitor-tls-info-add-fk.sql @@ -0,0 +1,18 @@ +BEGIN TRANSACTION; + +PRAGMA writable_schema = TRUE; + +UPDATE + SQLITE_MASTER +SET + sql = replace(sql, + 'monitor_id INTEGER NOT NULL', + 'monitor_id INTEGER NOT NULL REFERENCES [monitor] ([id]) ON DELETE CASCADE ON UPDATE CASCADE' +) +WHERE + name = 'monitor_tls_info' + AND type = 'table'; + +PRAGMA writable_schema = RESET; + +COMMIT; diff --git a/package.json b/package.json index e8adc491..567efa1b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/louislam/uptime-kuma.git" }, "engines": { - "node": "14 || 16 || 18 || >= 20.4.0" + "node": "18 || >= 20.4.0" }, "scripts": { "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .", diff --git a/server/database.js b/server/database.js index cfe14fe7..ed4b9e68 100644 --- a/server/database.js +++ b/server/database.js @@ -105,7 +105,8 @@ class Database { "patch-add-gamedig-given-port.sql": true, "patch-notification-config.sql": true, "patch-fix-kafka-producer-booleans.sql": true, - "patch-timeout.sql": true, // The last file so far converted to a knex migration file + "patch-timeout.sql": true, + "patch-monitor-tls-info-add-fk.sql": true, // The last file so far converted to a knex migration file }; /** diff --git a/server/notification-providers/call-me-bot.js b/server/notification-providers/call-me-bot.js new file mode 100644 index 00000000..daa9ccde --- /dev/null +++ b/server/notification-providers/call-me-bot.js @@ -0,0 +1,23 @@ +const NotificationProvider = require("./notification-provider"); +const axios = require("axios"); + +class CallMeBot extends NotificationProvider { + name = "CallMeBot"; + + /** + * @inheritdoc + */ + async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { + const okMsg = "Sent Successfully."; + try { + const url = new URL(notification.callMeBotEndpoint); + url.searchParams.set("text", msg); + await axios.get(url.toString()); + return okMsg; + } catch (error) { + this.throwGeneralAxiosError(error); + } + } +} + +module.exports = CallMeBot; diff --git a/server/notification-providers/cellsynt.js b/server/notification-providers/cellsynt.js new file mode 100644 index 00000000..e842237b --- /dev/null +++ b/server/notification-providers/cellsynt.js @@ -0,0 +1,39 @@ +const NotificationProvider = require("./notification-provider"); +const axios = require("axios"); + +class Cellsynt extends NotificationProvider { + name = "Cellsynt"; + + /** + * @inheritdoc + */ + async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { + const okMsg = "Sent Successfully."; + const data = { + // docs at https://www.cellsynt.com/en/sms/api-integration + params: { + "username": notification.cellsyntLogin, + "password": notification.cellsyntPassword, + "destination": notification.cellsyntDestination, + "text": msg.replace(/[^\x00-\x7F]/g, ""), + "originatortype": notification.cellsyntOriginatortype, + "originator": notification.cellsyntOriginator, + "allowconcat": notification.cellsyntAllowLongSMS ? 6 : 1 + } + }; + try { + const resp = await axios.post("https://se-1.cellsynt.net/sms.php", null, data); + if (resp.data == null ) { + throw new Error("Could not connect to Cellsynt, please try again."); + } else if (resp.data.includes("Error:")) { + resp.data = resp.data.replaceAll("Error:", ""); + throw new Error(resp.data); + } + return okMsg; + } catch (error) { + this.throwGeneralAxiosError(error); + } + } +} + +module.exports = Cellsynt; diff --git a/server/notification-providers/gtx-messaging.js b/server/notification-providers/gtx-messaging.js new file mode 100644 index 00000000..1ff97d11 --- /dev/null +++ b/server/notification-providers/gtx-messaging.js @@ -0,0 +1,33 @@ +const NotificationProvider = require("./notification-provider"); +const axios = require("axios"); + +class GtxMessaging extends NotificationProvider { + name = "gtxmessaging"; + + /** + * @inheritDoc + */ + async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { + const okMsg = "Sent Successfully."; + + // The UP/DOWN symbols will be replaced with `???` by gtx-messaging + const text = msg.replaceAll("🔴 ", "").replaceAll("✅ ", ""); + + try { + const data = new URLSearchParams(); + data.append("from", notification.gtxMessagingFrom.trim()); + data.append("to", notification.gtxMessagingTo.trim()); + data.append("text", text); + + const url = `https://rest.gtx-messaging.net/smsc/sendsms/${notification.gtxMessagingApiKey}/json`; + + await axios.post(url, data); + + return okMsg; + } catch (error) { + this.throwGeneralAxiosError(error); + } + } +} + +module.exports = GtxMessaging; diff --git a/server/notification-providers/slack.js b/server/notification-providers/slack.js index 9347b07c..439f5e90 100644 --- a/server/notification-providers/slack.js +++ b/server/notification-providers/slack.js @@ -26,6 +26,93 @@ class Slack extends NotificationProvider { } } + /** + * Builds the actions available in the slack message + * @param {string} baseURL Uptime Kuma base URL + * @param {object} monitorJSON The monitor config + * @returns {Array} The relevant action objects + */ + static buildActions(baseURL, monitorJSON) { + const actions = []; + + if (baseURL) { + actions.push({ + "type": "button", + "text": { + "type": "plain_text", + "text": "Visit Uptime Kuma", + }, + "value": "Uptime-Kuma", + "url": baseURL + getMonitorRelativeURL(monitorJSON.id), + }); + + } + + if (monitorJSON.url) { + actions.push({ + "type": "button", + "text": { + "type": "plain_text", + "text": "Visit site", + }, + "value": "Site", + "url": monitorJSON.url, + }); + } + + return actions; + } + + /** + * Builds the different blocks the Slack message consists of. + * @param {string} baseURL Uptime Kuma base URL + * @param {object} monitorJSON The monitor object + * @param {object} heartbeatJSON The heartbeat object + * @param {string} title The message title + * @param {string} msg The message body + * @returns {Array} The rich content blocks for the Slack message + */ + static buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg) { + + //create an array to dynamically add blocks + const blocks = []; + + // the header block + blocks.push({ + "type": "header", + "text": { + "type": "plain_text", + "text": title, + }, + }); + + // the body block, containing the details + blocks.push({ + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Message*\n" + msg, + }, + { + "type": "mrkdwn", + "text": `*Time (${heartbeatJSON["timezone"]})*\n${heartbeatJSON["localDateTime"]}`, + } + ], + }); + + const actions = this.buildActions(baseURL, monitorJSON); + if (actions.length > 0) { + //the actions block, containing buttons + blocks.push({ + "type": "actions", + "elements": actions, + }); + } + + return blocks; + } + /** * @inheritdoc */ @@ -48,35 +135,18 @@ class Slack extends NotificationProvider { return okMsg; } - const textMsg = "Uptime Kuma Alert"; + const baseURL = await setting("primaryBaseURL"); + + const title = "Uptime Kuma Alert"; let data = { - "text": `${textMsg}\n${msg}`, + "text": `${title}\n${msg}`, "channel": notification.slackchannel, "username": notification.slackusername, "icon_emoji": notification.slackiconemo, "attachments": [ { "color": (heartbeatJSON["status"] === UP) ? "#2eb886" : "#e01e5a", - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": textMsg, - }, - }, - { - "type": "section", - "fields": [{ - "type": "mrkdwn", - "text": "*Message*\n" + msg, - }, - { - "type": "mrkdwn", - "text": `*Time (${heartbeatJSON["timezone"]})*\n${heartbeatJSON["localDateTime"]}`, - }], - } - ], + "blocks": Slack.buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg), } ] }; @@ -85,26 +155,6 @@ class Slack extends NotificationProvider { await Slack.deprecateURL(notification.slackbutton); } - const baseURL = await setting("primaryBaseURL"); - - // Button - if (baseURL) { - data.attachments.forEach(element => { - element.blocks.push({ - "type": "actions", - "elements": [{ - "type": "button", - "text": { - "type": "plain_text", - "text": "Visit Uptime Kuma", - }, - "value": "Uptime-Kuma", - "url": baseURL + getMonitorRelativeURL(monitorJSON.id), - }], - }); - }); - } - await axios.post(notification.slackwebhookURL, data); return okMsg; } catch (error) { diff --git a/server/notification-providers/whapi.js b/server/notification-providers/whapi.js new file mode 100644 index 00000000..70e0fbb4 --- /dev/null +++ b/server/notification-providers/whapi.js @@ -0,0 +1,39 @@ +const NotificationProvider = require("./notification-provider"); +const axios = require("axios"); + +class Whapi extends NotificationProvider { + name = "whapi"; + + /** + * @inheritdoc + */ + async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { + const okMsg = "Sent Successfully."; + + try { + const config = { + headers: { + "Accept": "application/json", + "Content-Type": "application/json", + "Authorization": "Bearer " + notification.whapiAuthToken, + } + }; + + let data = { + "to": notification.whapiRecipient, + "body": msg, + }; + + let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/\/+$/, "") + "/messages/text"; + + await axios.post(url, data, config); + + return okMsg; + } catch (error) { + this.throwGeneralAxiosError(error); + } + } + +} + +module.exports = Whapi; diff --git a/server/notification.js b/server/notification.js index 5a412c6e..f5a95206 100644 --- a/server/notification.js +++ b/server/notification.js @@ -6,6 +6,7 @@ const AliyunSms = require("./notification-providers/aliyun-sms"); const Apprise = require("./notification-providers/apprise"); const Bark = require("./notification-providers/bark"); const ClickSendSMS = require("./notification-providers/clicksendsms"); +const CallMeBot = require("./notification-providers/call-me-bot"); const SMSC = require("./notification-providers/smsc"); const DingDing = require("./notification-providers/dingding"); const Discord = require("./notification-providers/discord"); @@ -55,6 +56,9 @@ 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 Whapi = require("./notification-providers/whapi"); +const GtxMessaging = require("./notification-providers/gtx-messaging"); +const Cellsynt = require("./notification-providers/cellsynt"); class Notification { @@ -78,6 +82,7 @@ class Notification { new Apprise(), new Bark(), new ClickSendSMS(), + new CallMeBot(), new SMSC(), new DingDing(), new Discord(), @@ -126,7 +131,10 @@ class Notification { new Webhook(), new WeCom(), new GoAlert(), - new ZohoCliq() + new ZohoCliq(), + new Whapi(), + new GtxMessaging(), + new Cellsynt(), ]; for (let item of list) { if (! item.name) { diff --git a/server/uptime-calculator.js b/server/uptime-calculator.js index 9632e6ea..7b532674 100644 --- a/server/uptime-calculator.js +++ b/server/uptime-calculator.js @@ -116,14 +116,23 @@ class UptimeCalculator { ]); for (let bean of minutelyStatBeans) { - let key = bean.timestamp; - this.minutelyUptimeDataList.push(key, { + let data = { up: bean.up, down: bean.down, avgPing: bean.ping, minPing: bean.pingMin, maxPing: bean.pingMax, - }); + }; + + if (bean.extras != null) { + data = { + ...data, + ...JSON.parse(bean.extras), + }; + } + + let key = bean.timestamp; + this.minutelyUptimeDataList.push(key, data); } // Load hourly data from database (recent 30 days only) @@ -133,14 +142,22 @@ class UptimeCalculator { ]); for (let bean of hourlyStatBeans) { - let key = bean.timestamp; - this.hourlyUptimeDataList.push(key, { + let data = { up: bean.up, down: bean.down, avgPing: bean.ping, minPing: bean.pingMin, maxPing: bean.pingMax, - }); + }; + + if (bean.extras != null) { + data = { + ...data, + ...JSON.parse(bean.extras), + }; + } + + this.hourlyUptimeDataList.push(bean.timestamp, data); } // Load daily data from database (recent 365 days only) @@ -150,14 +167,22 @@ class UptimeCalculator { ]); for (let bean of dailyStatBeans) { - let key = bean.timestamp; - this.dailyUptimeDataList.push(key, { + let data = { up: bean.up, down: bean.down, avgPing: bean.ping, minPing: bean.pingMin, maxPing: bean.pingMax, - }); + }; + + if (bean.extras != null) { + data = { + ...data, + ...JSON.parse(bean.extras), + }; + } + + this.dailyUptimeDataList.push(bean.timestamp, data); } } @@ -170,11 +195,6 @@ class UptimeCalculator { async update(status, ping = 0) { let date = this.getCurrentDate(); - // Don't count MAINTENANCE into uptime - if (status === MAINTENANCE) { - return date; - } - let flatStatus = this.flatStatus(status); if (flatStatus === DOWN && ping > 0) { @@ -189,7 +209,12 @@ class UptimeCalculator { let hourlyData = this.hourlyUptimeDataList[hourlyKey]; let dailyData = this.dailyUptimeDataList[dailyKey]; - if (flatStatus === UP) { + if (status === MAINTENANCE) { + minutelyData.maintenance = minutelyData.maintenance ? minutelyData.maintenance + 1 : 1; + hourlyData.maintenance = hourlyData.maintenance ? hourlyData.maintenance + 1 : 1; + dailyData.maintenance = dailyData.maintenance ? dailyData.maintenance + 1 : 1; + + } else if (flatStatus === UP) { minutelyData.up += 1; hourlyData.up += 1; dailyData.up += 1; @@ -233,7 +258,7 @@ class UptimeCalculator { } } - } else { + } else if (flatStatus === DOWN) { minutelyData.down += 1; hourlyData.down += 1; dailyData.down += 1; @@ -263,6 +288,13 @@ class UptimeCalculator { dailyStatBean.ping = dailyData.avgPing; dailyStatBean.pingMin = dailyData.minPing; dailyStatBean.pingMax = dailyData.maxPing; + { + // eslint-disable-next-line no-unused-vars + const { up, down, avgPing, minPing, maxPing, ...extras } = dailyData; + if (Object.keys(extras).length > 0) { + dailyStatBean.extras = JSON.stringify(extras); + } + } await R.store(dailyStatBean); let hourlyStatBean = await this.getHourlyStatBean(hourlyKey); @@ -271,6 +303,13 @@ class UptimeCalculator { hourlyStatBean.ping = hourlyData.avgPing; hourlyStatBean.pingMin = hourlyData.minPing; hourlyStatBean.pingMax = hourlyData.maxPing; + { + // eslint-disable-next-line no-unused-vars + const { up, down, avgPing, minPing, maxPing, ...extras } = hourlyData; + if (Object.keys(extras).length > 0) { + hourlyStatBean.extras = JSON.stringify(extras); + } + } await R.store(hourlyStatBean); let minutelyStatBean = await this.getMinutelyStatBean(divisionKey); @@ -279,6 +318,13 @@ class UptimeCalculator { minutelyStatBean.ping = minutelyData.avgPing; minutelyStatBean.pingMin = minutelyData.minPing; minutelyStatBean.pingMax = minutelyData.maxPing; + { + // eslint-disable-next-line no-unused-vars + const { up, down, avgPing, minPing, maxPing, ...extras } = minutelyData; + if (Object.keys(extras).length > 0) { + minutelyStatBean.extras = JSON.stringify(extras); + } + } await R.store(minutelyStatBean); // Remove the old data @@ -474,7 +520,7 @@ class UptimeCalculator { flatStatus(status) { switch (status) { case UP: - // case MAINTENANCE: + case MAINTENANCE: return UP; case DOWN: case PENDING: @@ -606,7 +652,11 @@ class UptimeCalculator { avgPing = totalPing / total.up; } - uptimeData.uptime = total.up / (total.up + total.down); + if (total.up + total.down === 0) { + uptimeData.uptime = 0; + } else { + uptimeData.uptime = total.up / (total.up + total.down); + } uptimeData.avgPing = avgPing; return uptimeData; } diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 56580fbf..f57e0628 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -115,6 +115,7 @@ export default { "apprise": this.$t("apprise"), "Bark": "Bark", "clicksendsms": "ClickSend SMS", + "CallMeBot": "CallMeBot (WhatsApp, Telegram Call, Facebook Messanger)", "discord": "Discord", "GoogleChat": "Google Chat (Google Workspace)", "gorush": "Gorush", @@ -152,7 +153,10 @@ export default { "Splunk": "Splunk", "webhook": "Webhook", "GoAlert": "GoAlert", - "ZohoCliq": "ZohoCliq" + "ZohoCliq": "ZohoCliq", + "whapi": "WhatsApp (Whapi)", + "gtxmessaging": "GtxMessaging", + "Cellsynt": "Cellsynt", }; // Put notifications here if it's not supported in most regions or its documentation is not in English diff --git a/src/components/notifications/CallMeBot.vue b/src/components/notifications/CallMeBot.vue new file mode 100644 index 00000000..74c69ea3 --- /dev/null +++ b/src/components/notifications/CallMeBot.vue @@ -0,0 +1,13 @@ + diff --git a/src/components/notifications/Cellsynt.vue b/src/components/notifications/Cellsynt.vue new file mode 100644 index 00000000..2e8a6de7 --- /dev/null +++ b/src/components/notifications/Cellsynt.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/components/notifications/GtxMessaging.vue b/src/components/notifications/GtxMessaging.vue new file mode 100644 index 00000000..24118fef --- /dev/null +++ b/src/components/notifications/GtxMessaging.vue @@ -0,0 +1,49 @@ + + + diff --git a/src/components/notifications/Whapi.vue b/src/components/notifications/Whapi.vue new file mode 100644 index 00000000..4c92ad2c --- /dev/null +++ b/src/components/notifications/Whapi.vue @@ -0,0 +1,33 @@ + + diff --git a/src/components/notifications/index.js b/src/components/notifications/index.js index 6cb0c9fd..45832238 100644 --- a/src/components/notifications/index.js +++ b/src/components/notifications/index.js @@ -4,6 +4,7 @@ import AliyunSMS from "./AliyunSms.vue"; import Apprise from "./Apprise.vue"; import Bark from "./Bark.vue"; import ClickSendSMS from "./ClickSendSMS.vue"; +import CallMeBot from "./CallMeBot.vue"; import SMSC from "./SMSC.vue"; import DingDing from "./DingDing.vue"; import Discord from "./Discord.vue"; @@ -13,6 +14,7 @@ import GoogleChat from "./GoogleChat.vue"; import Gorush from "./Gorush.vue"; import Gotify from "./Gotify.vue"; import GrafanaOncall from "./GrafanaOncall.vue"; +import GtxMessaging from "./GtxMessaging.vue"; import HomeAssistant from "./HomeAssistant.vue"; import HeiiOnCall from "./HeiiOnCall.vue"; import Kook from "./Kook.vue"; @@ -53,6 +55,8 @@ import WeCom from "./WeCom.vue"; import GoAlert from "./GoAlert.vue"; import ZohoCliq from "./ZohoCliq.vue"; import Splunk from "./Splunk.vue"; +import Whapi from "./Whapi.vue"; +import Cellsynt from "./Cellsynt.vue"; /** * Manage all notification form. @@ -65,6 +69,7 @@ const NotificationFormList = { "apprise": Apprise, "Bark": Bark, "clicksendsms": ClickSendSMS, + "CallMeBot": CallMeBot, "smsc": SMSC, "DingDing": DingDing, "discord": Discord, @@ -113,7 +118,10 @@ const NotificationFormList = { "WeCom": WeCom, "GoAlert": GoAlert, "ServerChan": ServerChan, - "ZohoCliq": ZohoCliq + "ZohoCliq": ZohoCliq, + "whapi": Whapi, + "gtxmessaging": GtxMessaging, + "Cellsynt": Cellsynt, }; export default NotificationFormList; diff --git a/src/i18n.js b/src/i18n.js index 3a636c35..d309e113 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -57,7 +57,7 @@ for (let lang in languageList) { }; } -const rtlLangs = [ "fa", "ar-SY", "ur" ]; +const rtlLangs = [ "he-IL", "fa", "ar-SY", "ur" ]; export const currentLocale = () => localStorage.locale || languageList[navigator.language] && navigator.language diff --git a/src/lang/en.json b/src/lang/en.json index 11190a08..21b0eec7 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -885,7 +885,30 @@ "deleteRemoteBrowserMessage": "Are you sure want to delete this Remote Browser for all monitors?", "GrafanaOncallUrl": "Grafana Oncall URL", "Browser Screenshot": "Browser Screenshot", + "wayToWriteWhapiRecipient": "The phone number with the international prefix, but without the plus sign at the start ({0}), the Contact ID ({1}) or the Group ID ({2}).", + "wayToGetWhapiUrlAndToken": "You can get the API URL and the token by going into your desired channel from {0}", + "whapiRecipient": "Phone Number / Contact ID / Group ID", + "API URL": "API URL", "What is a Remote Browser?": "What is a Remote Browser?", "wayToGetHeiiOnCallDetails": "How to get the Trigger ID and API Keys is explained in the {documentation}", - "documentationOf": "{0} Documentation" + "documentationOf": "{0} Documentation", + "callMeBotGet": "Here you can generate an endpoint for {0}, {1} and {2}. Keep in mind that you might get rate limited. The ratelimits appear to be: {3}", + "gtxMessagingApiKeyHint": "You can find your API key at: My Routing Accounts > Show Account Information > API Credentials > REST API (v2.x)", + "From Phone Number / Transmission Path Originating Address (TPOA)": "From Phone Number / Transmission Path Originating Address (TPOA)", + "gtxMessagingFromHint": "On mobile phones, your recipients sees the TPOA displayed as the sender of the message. Allowed are up to 11 alphanumeric characters, a shortcode, the local longcode or international numbers ({e164}, {e212} or {e214})", + "To Phone Number": "To Phone Number", + "gtxMessagingToHint": "International format, with leading \"+\" ({e164}, {e212} or {e214})", + "Originator type": "Originator type", + "Alphanumeric (recommended)": "Alphanumeric (recommended)", + "Telephone number": "Telephone number", + "cellsyntOriginatortypeAlphanumeric": "Alphanumeric string (max 11 alphanumeric characters). Recipients can not reply to the message.", + "cellsyntOriginatortypeNumeric": "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). Recipients can reply to the message.", + "Originator": "Originator", + "cellsyntOriginator": "Visible on recipient's mobile phone as originator of the message. Allowed values and function depends on parameter originatortype.", + "Destination": "Destination", + "cellsyntDestination": "Recipient's telephone number using international format with leading 00 followed by country code, e.g. 00447920110000 for the UK number 07920 110 000 (max 17 digits in total). Max 25000 comma separated recipients per HTTP request.", + "Allow Long SMS": "Allow Long SMS", + "cellsyntSplitLongMessages": "Split long messages into up to 6 parts. 153 x 6 = 918 characters.", + "max 15 digits": "max 15 digits", + "max 11 alphanumeric characters": "max 11 alphanumeric characters" }