From 931ca6a3ef05483d28cf137212afc14e1eac44a9 Mon Sep 17 00:00:00 2001 From: Patrick Hafner Date: Tue, 21 Dec 2021 03:27:05 +0100 Subject: [PATCH 01/21] Add: customize status page (css and poweredby) --- src/pages/StatusPage.vue | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index 0dc49518e..213a9fbd6 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -88,6 +88,11 @@ {{ $t("Show Tags") }} + + @@ -144,6 +149,15 @@ + + +
@@ -208,9 +222,14 @@
+ + + {{ config.customCSS }} + @@ -659,7 +685,7 @@ footer { } } -.incident { +.incident, .customize { .content { &[contenteditable=true] { min-height: 60px; From 2c2a824f97f012146548a2fb7cf479b2288b78cd Mon Sep 17 00:00:00 2001 From: Patrick Hafner Date: Tue, 21 Dec 2021 03:31:09 +0100 Subject: [PATCH 02/21] Add: en & de-DE language --- src/languages/de-DE.js | 5 ++++- src/languages/en.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index 6c2dd1f19..1b500267d 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -348,5 +348,8 @@ export default { serwersmsAPIPassword: "API Passwort", serwersmsPhoneNumber: "Telefonnummer", serwersmsSenderName: "Name des SMS-Absenders (über Kundenportal registriert)", - "stackfield": "Stackfield", + stackfield: "Stackfield", + Customize: "Anpassen", + "Custom Footer": "Eigener Footer (Leerlassen für Standard)", + "Custom CSS": "Eigenes CSS", }; diff --git a/src/languages/en.js b/src/languages/en.js index fee80a760..97a88f50c 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -351,5 +351,8 @@ export default { serwersmsAPIPassword: "API Password", serwersmsPhoneNumber: "Phone number", serwersmsSenderName: "SMS Sender Name (registered via customer portal)", - "stackfield": "Stackfield", + stackfield: "Stackfield", + Customize: "Customize", + "Custom Footer": "Custom Footer (empty string for default)", + "Custom CSS": "Custom CSS", }; From 3a12e209da1207fb16b4012ec8ff01a7f08f5c0b Mon Sep 17 00:00:00 2001 From: Patrick Hafner Date: Tue, 21 Dec 2021 03:55:25 +0100 Subject: [PATCH 03/21] Edit: editMode check before toggle --- src/pages/StatusPage.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index 213a9fbd6..2d264054f 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -602,8 +602,10 @@ export default { /** customize status page */ customizeStatusPage() { - // toggle modal - this.enableEditCustomizeMode = !this.enableEditCustomizeMode; + if (this.editMode) { + // toggle modal + this.enableEditCustomizeMode = !this.enableEditCustomizeMode; + } }, } From 9ee591417da3fb5e7ad402be97677b2f79385605 Mon Sep 17 00:00:00 2001 From: Patrick Hafner Date: Sat, 25 Dec 2021 04:09:41 +0100 Subject: [PATCH 04/21] Footer HTML support, updated german translation --- src/languages/de-DE.js | 2 +- src/pages/StatusPage.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index 1b500267d..585d00639 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -335,7 +335,7 @@ export default { "Hide Tags": "Tags ausblenden", Description: "Beschreibung", "No monitors available.": "Keine Monitore verfügbar.", - "Add one": "Füge eins hinzu", + "Add one": "Hinzufügen", "No Monitors": "Keine Monitore", "Untitled Group": "Gruppe ohne Titel", Services: "Dienste", diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index 2d264054f..d1835e21c 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -222,7 +222,7 @@ From a7e1a78ea96d3a055b205932e4223198640d3b96 Mon Sep 17 00:00:00 2001 From: MrEddX <66828538+MrEddX@users.noreply.github.com> Date: Fri, 25 Mar 2022 07:31:26 +0200 Subject: [PATCH 05/21] Update bg-BG.js Fixed translation. --- src/languages/bg-BG.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/bg-BG.js b/src/languages/bg-BG.js index 4dd79bfc7..787db0b24 100644 --- a/src/languages/bg-BG.js +++ b/src/languages/bg-BG.js @@ -343,7 +343,7 @@ export default { "No Monitors": "Няма монитори", "Untitled Group": "Група без заглавие", Services: "Услуги", - Discard: "Премахни", + Discard: "Отмени", Cancel: "Отмени", "Powered by": "Създадено чрез", serwersms: "SerwerSMS.pl", From 81de2eedfb596031ba4a74feb9db629f7b8c4e04 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Tue, 12 Apr 2022 20:23:11 +0800 Subject: [PATCH 06/21] Fix template can contain one tag only, disable vue/require-component-is eslint rule --- .eslintrc.js | 1 + src/pages/StatusPage.vue | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b0934d6d8..67a80d245 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -39,6 +39,7 @@ module.exports = { "vue/max-attributes-per-line": "off", "vue/singleline-html-element-content-newline": "off", "vue/html-self-closing": "off", + "vue/require-component-is": "off", // not allow is="style" https://github.com/vuejs/eslint-plugin-vue/issues/462#issuecomment-430234675 "vue/attribute-hyphenation": "off", // This change noNL to "no-n-l" unexpectedly "no-multi-spaces": ["error", { ignoreEOLComments: true, diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index b1b2e9802..381162546 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -261,11 +261,11 @@ {{ $t("deleteStatusPageMsg") }} - - - {{ config.customCSS }} - + + {{ config.customCSS }} + + \ No newline at end of file diff --git a/src/components/notifications/index.js b/src/components/notifications/index.js index 2fa36c0f4..2a7d77933 100644 --- a/src/components/notifications/index.js +++ b/src/components/notifications/index.js @@ -30,6 +30,7 @@ import GoogleChat from "./GoogleChat.vue"; import Gorush from "./Gorush.vue"; import Alerta from "./Alerta.vue"; import OneBot from "./OneBot.vue"; +import Pushdeer from "./Pushdeer.vue"; /** * Manage all notification form. @@ -69,6 +70,7 @@ const NotificationFormList = { "gorush": Gorush, "alerta": Alerta, "OneBot": OneBot, + "Pushdeer": Pushdeer, }; export default NotificationFormList; From 93c51504f93d7828674f797f06e24d3a3fcd9b95 Mon Sep 17 00:00:00 2001 From: ngc7331 Date: Wed, 6 Apr 2022 08:38:48 +0800 Subject: [PATCH 08/21] fixes: formatting and security issues Co-authored-by: Matthew Nickson --- server/notification-providers/pushdeer.js | 6 +++--- src/components/notifications/Pushdeer.vue | 6 +++--- src/languages/en.js | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/server/notification-providers/pushdeer.js b/server/notification-providers/pushdeer.js index f86577693..6831b8cce 100644 --- a/server/notification-providers/pushdeer.js +++ b/server/notification-providers/pushdeer.js @@ -14,11 +14,11 @@ class Pushdeer extends NotificationProvider { let title; if (valid && heartbeatJSON.status == UP) { - title = "## UptimeKuma: " + monitorJSON.name + " up"; + title = "## Uptime Kuma: " + monitorJSON.name + " up"; } else if (valid && heartbeatJSON.status == DOWN) { - title = "## UptimeKuma: " + monitorJSON.name + " down"; + title = "## Uptime Kuma: " + monitorJSON.name + " down"; } else { - title = "## UptimeKuma Message"; + title = "## Uptime Kuma Message"; } let data = { diff --git a/src/components/notifications/Pushdeer.vue b/src/components/notifications/Pushdeer.vue index 762715504..80d0f48ff 100644 --- a/src/components/notifications/Pushdeer.vue +++ b/src/components/notifications/Pushdeer.vue @@ -1,11 +1,11 @@ @@ -16,4 +16,4 @@ export default { HiddenInput, }, }; - \ No newline at end of file + diff --git a/src/languages/en.js b/src/languages/en.js index 2dcec68cc..f432a9c46 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -451,4 +451,5 @@ export default { onebotPrivateMessage: "Private", onebotUserOrGroupId: "Group/User ID", onebotSafetyTips: "For safety, must set access token", + "Pushdeer Key": "Pushdeer Key", }; From fb0064082ee4a301e3c1afb969e347cfd9600878 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 14 Apr 2022 14:29:54 +0800 Subject: [PATCH 09/21] Change Pushdeer to PushDeer --- server/notification-providers/pushdeer.js | 8 ++++---- server/notification.js | 4 ++-- .../notifications/{Pushdeer.vue => PushDeer.vue} | 2 +- src/components/notifications/index.js | 4 ++-- src/languages/en.js | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename src/components/notifications/{Pushdeer.vue => PushDeer.vue} (96%) diff --git a/server/notification-providers/pushdeer.js b/server/notification-providers/pushdeer.js index 6831b8cce..620c1b20a 100644 --- a/server/notification-providers/pushdeer.js +++ b/server/notification-providers/pushdeer.js @@ -2,9 +2,9 @@ const NotificationProvider = require("./notification-provider"); const axios = require("axios"); const { DOWN, UP } = require("../../src/util"); -class Pushdeer extends NotificationProvider { +class PushDeer extends NotificationProvider { - name = "Pushdeer"; + name = "PushDeer"; async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { let okMsg = "Sent Successfully."; @@ -36,7 +36,7 @@ class Pushdeer extends NotificationProvider { this.throwGeneralAxiosError(error); } if (res.data.content.result.length === 0) { - let error = "Invalid Pushdeer key"; + let error = "Invalid PushDeer key"; this.throwGeneralAxiosError(error); } else if (JSON.parse(res.data.content.result[0]).success != "ok") { let error = "Unknown error"; @@ -49,4 +49,4 @@ class Pushdeer extends NotificationProvider { } } -module.exports = Pushdeer; +module.exports = PushDeer; diff --git a/server/notification.js b/server/notification.js index e3d37bafb..842e0e2f8 100644 --- a/server/notification.js +++ b/server/notification.js @@ -32,7 +32,7 @@ const GoogleChat = require("./notification-providers/google-chat"); const Gorush = require("./notification-providers/gorush"); const Alerta = require("./notification-providers/alerta"); const OneBot = require("./notification-providers/onebot"); -const Pushdeer = require("./notification-providers/pushdeer"); +const PushDeer = require("./notification-providers/pushdeer"); class Notification { @@ -76,7 +76,7 @@ class Notification { new Gorush(), new Alerta(), new OneBot(), - new Pushdeer(), + new PushDeer(), ]; for (let item of list) { diff --git a/src/components/notifications/Pushdeer.vue b/src/components/notifications/PushDeer.vue similarity index 96% rename from src/components/notifications/Pushdeer.vue rename to src/components/notifications/PushDeer.vue index 80d0f48ff..c2b7f5cb0 100644 --- a/src/components/notifications/Pushdeer.vue +++ b/src/components/notifications/PushDeer.vue @@ -1,6 +1,6 @@