diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 69f98c0e..2e10be48 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Project Info -First of all, I want to thank everyone who have wrote issues or shared pull requests for Uptime Kuma. +First of all, I want to thank everyone who has submitted issues or shared pull requests for Uptime Kuma. I never thought the GitHub community would be so nice! Because of this, I also never thought that other people would actually read and edit my code. Parts of the code are not very well-structured or commented, sorry about that. @@ -9,7 +9,7 @@ The project was created with `vite.js` and is written in `vue3`. Our backend lives in the `server`-directory and mostly communicates via websockets. Both frontend and backend share the same `package.json`. -For production, the frontend is build into `dist`-directory and the server (`express.js`) exposes the `dist` directory as the root of the endpoint. +For production, the frontend is built into the `dist`-directory and the server (`express.js`) exposes the `dist` directory as the root of the endpoint. For development, we run vite in development mode on another port. ## Directories @@ -28,7 +28,7 @@ For development, we run vite in development mode on another port. ## Can I create a pull request for Uptime Kuma? Yes or no, it depends on what you will try to do. -Both your and our maintainers time is precious, and we don't want to waste both time. +Both yours and our maintainers' time is precious, and we don't want to waste either. If you have any questions about any process/.. is not clear, you are likely not alone => please ask them ^^ @@ -49,11 +49,11 @@ Different guidelines exist for different types of pull requests (PRs):
If you come across a bug and think you can solve, we appreciate your work. - Please make sure that you follow by these rules: + Please make sure that you follow these rules: - keep the PR as small as possible, fix only one thing at a time => keeping it reviewable - - test that your code does what you came it does. + - test that your code does what you claim it does. - Because maintainer time is precious junior maintainers may merge uncontroversial PRs in this area. + Because maintainer time is precious, junior maintainers may merge uncontroversial PRs in this area.
-be sure to **create an empty draft pull request or open an issue, so we can have a discussion first**. - This is especially important for a large pull request or you don't know if it will be merged or not. + This is especially important for a large pull request or when you don't know if it will be merged or not. Because of the large impact of this work, only senior maintainers may merge PRs in this area.
@@ -201,7 +201,7 @@ The rationale behind this is that we can align the direction and scope of the fe ## Project Styles -I personally do not like something that requires so many configurations before you can finally start the app. +I personally do not like something that requires a lot of configuration before you can finally start the app. The goal is to make the Uptime Kuma installation as easy as installing a mobile app. - Easy to install for non-Docker users @@ -260,7 +260,7 @@ Port `3000` and port `3001` will be used. npm run dev ``` -But sometimes, you would like to restart the server, but not the frontend, you can run these commands in two terminals: +But sometimes you may want to restart the server without restarting the frontend. In that case, you can run these commands in two terminals: ```bash npm run start-frontend-dev @@ -409,7 +409,7 @@ https://github.com/louislam/uptime-kuma/issues?q=sort%3Aupdated-desc ### What is a maintainer and what are their roles? -This project has multiple maintainers which specialise in different areas. +This project has multiple maintainers who specialise in different areas. Currently, there are 3 maintainers: | Person | Role | Main Area | diff --git a/server/notification-providers/dingding.js b/server/notification-providers/dingding.js index 5d8cb894..c66f270a 100644 --- a/server/notification-providers/dingding.js +++ b/server/notification-providers/dingding.js @@ -87,7 +87,6 @@ class DingDing extends NotificationProvider { * @returns {string} Status */ statusToString(status) { - // TODO: Move to notification-provider.js to avoid repetition in classes switch (status) { case DOWN: return "DOWN"; diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index ccb80bf4..6a52f8f3 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -48,7 +48,7 @@ class Discord extends NotificationProvider { }, { name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", - value: this.extractAdress(monitorJSON), + value: this.extractAddress(monitorJSON), }, { name: `Time (${heartbeatJSON["timezone"]})`, @@ -85,7 +85,7 @@ class Discord extends NotificationProvider { }, { name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", - value: this.extractAdress(monitorJSON), + value: this.extractAddress(monitorJSON), }, { name: `Time (${heartbeatJSON["timezone"]})`, diff --git a/server/notification-providers/notification-provider.js b/server/notification-providers/notification-provider.js index d26b791f..b9fb3d86 100644 --- a/server/notification-providers/notification-provider.js +++ b/server/notification-providers/notification-provider.js @@ -24,7 +24,7 @@ class NotificationProvider { * @param {?object} monitorJSON Monitor details (For Up/Down only) * @returns {string} The extracted address based on the monitor type. */ - extractAdress(monitorJSON) { + extractAddress(monitorJSON) { if (!monitorJSON) { return ""; } diff --git a/server/notification-providers/sevenio.js b/server/notification-providers/sevenio.js index 9d805d7e..eac38a26 100644 --- a/server/notification-providers/sevenio.js +++ b/server/notification-providers/sevenio.js @@ -32,7 +32,7 @@ class SevenIO extends NotificationProvider { return okMsg; } - let address = this.extractAdress(monitorJSON); + let address = this.extractAddress(monitorJSON); if (address !== "") { address = `(${address}) `; } diff --git a/server/notification-providers/signl4.js b/server/notification-providers/signl4.js index e48983f5..8261a73f 100644 --- a/server/notification-providers/signl4.js +++ b/server/notification-providers/signl4.js @@ -18,7 +18,7 @@ class SIGNL4 extends NotificationProvider { msg, // Source system "X-S4-SourceSystem": "UptimeKuma", - monitorUrl: this.extractAdress(monitorJSON), + monitorUrl: this.extractAddress(monitorJSON), }; const config = { diff --git a/server/notification-providers/slack.js b/server/notification-providers/slack.js index 3676d6df..f28a643e 100644 --- a/server/notification-providers/slack.js +++ b/server/notification-providers/slack.js @@ -48,7 +48,7 @@ class Slack extends NotificationProvider { } - const address = this.extractAdress(monitorJSON); + const address = this.extractAddress(monitorJSON); if (address) { actions.push({ "type": "button", diff --git a/server/notification-providers/smtp.js b/server/notification-providers/smtp.js index 801e0e69..9f3defa5 100644 --- a/server/notification-providers/smtp.js +++ b/server/notification-providers/smtp.js @@ -93,7 +93,7 @@ class SMTP extends NotificationProvider { if (monitorJSON !== null) { monitorName = monitorJSON["name"]; - monitorHostnameOrURL = this.extractAdress(monitorJSON); + monitorHostnameOrURL = this.extractAddress(monitorJSON); } let serviceStatus = "⚠️ Test"; diff --git a/server/notification-providers/squadcast.js b/server/notification-providers/squadcast.js index 9074e9b7..5713783c 100644 --- a/server/notification-providers/squadcast.js +++ b/server/notification-providers/squadcast.js @@ -34,7 +34,7 @@ class Squadcast extends NotificationProvider { data.status = "resolve"; } - data.tags["AlertAddress"] = this.extractAdress(monitorJSON); + data.tags["AlertAddress"] = this.extractAddress(monitorJSON); monitorJSON["tags"].forEach(tag => { data.tags[tag["name"]] = { diff --git a/server/notification-providers/teams.js b/server/notification-providers/teams.js index 2fcea707..2793604c 100644 --- a/server/notification-providers/teams.js +++ b/server/notification-providers/teams.js @@ -225,7 +225,7 @@ class Teams extends NotificationProvider { const payload = this._notificationPayloadFactory({ heartbeatJSON: heartbeatJSON, monitorName: monitorJSON.name, - monitorUrl: this.extractAdress(monitorJSON), + monitorUrl: this.extractAddress(monitorJSON), dashboardUrl: dashboardUrl, }); diff --git a/server/notification-providers/techulus-push.js b/server/notification-providers/techulus-push.js index 230897f3..bf688b19 100644 --- a/server/notification-providers/techulus-push.js +++ b/server/notification-providers/techulus-push.js @@ -10,11 +10,22 @@ class TechulusPush extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; + let data = { + "title": notification?.pushTitle?.length ? notification.pushTitle : "Uptime-Kuma", + "body": msg, + "timeSensitive": notification.pushTimeSensitive ?? true, + }; + + if (notification.pushChannel) { + data.channel = notification.pushChannel; + } + + if (notification.pushSound) { + data.sound = notification.pushSound; + } + try { - await axios.post(`https://push.techulus.com/api/v1/notify/${notification.pushAPIKey}`, { - "title": "Uptime-Kuma", - "body": msg, - }); + await axios.post(`https://push.techulus.com/api/v1/notify/${notification.pushAPIKey}`, data); return okMsg; } catch (error) { this.throwGeneralAxiosError(error); diff --git a/server/notification-providers/zoho-cliq.js b/server/notification-providers/zoho-cliq.js index 44681b7d..3a504de8 100644 --- a/server/notification-providers/zoho-cliq.js +++ b/server/notification-providers/zoho-cliq.js @@ -85,7 +85,7 @@ class ZohoCliq extends NotificationProvider { const payload = this._notificationPayloadFactory({ monitorMessage: heartbeatJSON.msg, monitorName: monitorJSON.name, - monitorUrl: this.extractAdress(monitorJSON), + monitorUrl: this.extractAddress(monitorJSON), status: heartbeatJSON.status }); diff --git a/src/components/notifications/TechulusPush.vue b/src/components/notifications/TechulusPush.vue index bece17e2..bb2c27ad 100644 --- a/src/components/notifications/TechulusPush.vue +++ b/src/components/notifications/TechulusPush.vue @@ -4,6 +4,53 @@