From 9404efd86dc7f5156ada3eb63f23397b937fadd2 Mon Sep 17 00:00:00 2001 From: Ruben Date: Wed, 28 Dec 2022 10:37:25 +0100 Subject: [PATCH 1/6] Fixed the metrics for the push type. --- server/routers/api-router.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/routers/api-router.js b/server/routers/api-router.js index bbecbced3..e22f9fae4 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -9,6 +9,7 @@ const StatusPage = require("../model/status_page"); const { UptimeKumaServer } = require("../uptime-kuma-server"); const { makeBadge } = require("badge-maker"); const { badgeConstants } = require("../config"); +const { Prometheus } = require("../prometheus"); let router = express.Router(); @@ -87,6 +88,7 @@ router.get("/api/push/:pushToken", async (request, response) => { io.to(monitor.user_id).emit("heartbeat", bean.toJSON()); Monitor.sendStats(io, monitor.id, monitor.user_id); + new Prometheus(monitor).update(bean, undefined); response.json({ ok: true, From 71f00b369055b36110d854e0399344a8157dc9d6 Mon Sep 17 00:00:00 2001 From: Ruben Date: Thu, 12 Jan 2023 18:33:39 +0100 Subject: [PATCH 2/6] Parse push ping parameter with parseInt. --- server/routers/api-router.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routers/api-router.js b/server/routers/api-router.js index e22f9fae4..5e94d9a0b 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -37,7 +37,7 @@ router.get("/api/push/:pushToken", async (request, response) => { let pushToken = request.params.pushToken; let msg = request.query.msg || "OK"; - let ping = request.query.ping || null; + let ping = parseInt(request.query.ping) || null; let statusString = request.query.status || "up"; let status = (statusString === "up") ? UP : DOWN; From db6b863445f8e696cabef33d1a2f7a61a4f88b72 Mon Sep 17 00:00:00 2001 From: titanventura Date: Sun, 26 Feb 2023 16:26:09 +0530 Subject: [PATCH 3/6] show tags in monitor select list under status page : change select UI from normal select to vue-multiselect --- src/pages/StatusPage.vue | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index edf32561b..2cdbf1b5b 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -276,9 +276,23 @@
- + + +
{{ $t("No monitors available.") }} {{ $t("Add one") }} @@ -339,6 +353,8 @@ import PublicGroupList from "../components/PublicGroupList.vue"; import MaintenanceTime from "../components/MaintenanceTime.vue"; import { getResBaseURL } from "../util-frontend"; import { STATUS_PAGE_ALL_DOWN, STATUS_PAGE_ALL_UP, STATUS_PAGE_MAINTENANCE, STATUS_PAGE_PARTIAL_DOWN, UP, MAINTENANCE } from "../util.ts"; +import Tag from "../components/Tag.vue"; +import VueMultiselect from "vue-multiselect"; const toast = useToast(); @@ -359,6 +375,8 @@ export default { Confirm, PrismEditor, MaintenanceTime, + Tag, + VueMultiselect }, // Leave Page for vue route change From 150607cc93681c46d7c636e65c2ddf6f576912cb Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Thu, 2 Mar 2023 07:26:26 +0800 Subject: [PATCH 4/6] Feat: Support auto theme in status pages --- server/socket-handlers/status-page-socket-handler.js | 2 +- src/mixins/theme.js | 3 +++ src/pages/StatusPage.vue | 10 +++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js index 717aba9c4..411bda556 100644 --- a/server/socket-handlers/status-page-socket-handler.js +++ b/server/socket-handlers/status-page-socket-handler.js @@ -276,7 +276,7 @@ module.exports.statusPageSocketHandler = (socket) => { let statusPage = R.dispense("status_page"); statusPage.slug = slug; statusPage.title = title; - statusPage.theme = "light"; + statusPage.theme = "auto"; statusPage.icon = ""; await R.store(statusPage); diff --git a/src/mixins/theme.js b/src/mixins/theme.js index 8d2252670..2f7867df0 100644 --- a/src/mixins/theme.js +++ b/src/mixins/theme.js @@ -39,6 +39,9 @@ export default { } if (this.path.startsWith("/status-page") || this.path.startsWith("/status")) { + if (this.statusPageTheme === "auto") { + return this.system; + } return this.statusPageTheme; } else { if (this.userTheme === "auto") { diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index edf32561b..7c340f8b8 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -34,9 +34,13 @@
-
- - +
+ +
From 22f730499f6e83c4eae048763654322bc8a5caf4 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Mon, 3 Apr 2023 02:57:14 +0800 Subject: [PATCH 5/6] Improve the database connection string input --- src/pages/EditMonitor.vue | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 0b8e55073..997faf955 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -283,13 +283,13 @@
@@ -301,7 +301,7 @@ @@ -311,7 +311,7 @@
@@ -692,6 +692,13 @@ export default { ipOrHostnameRegexPattern: hostNameRegexPattern(), mqttIpOrHostnameRegexPattern: hostNameRegexPattern(true), gameList: null, + connectionStringTemplates: { + "sqlserver": "Server=,;Database=;User Id=;Password=;Encrypt=;TrustServerCertificate=;Connection Timeout=", + "postgres": "postgres://username:password@host:port/database", + "mysql": "mysql://username:password@host:port/database", + "redis": "redis://user:password@host:port", + "mongodb": "mongodb://username:password@host:port/database", + } }; }, @@ -853,6 +860,24 @@ message HealthCheckResponse { } }); } + + // Set default database connection string if empty or it is a template from another database monitor type + for (let monitorType in this.connectionStringTemplates) { + if (this.monitor.type === monitorType) { + let isTemplate = false; + for (let key in this.connectionStringTemplates) { + if (this.monitor.databaseConnectionString === this.connectionStringTemplates[key]) { + isTemplate = true; + break; + } + } + if (!this.monitor.databaseConnectionString || isTemplate) { + this.monitor.databaseConnectionString = this.connectionStringTemplates[monitorType]; + } + break; + } + } + }, currentGameObject(newGameObject, previousGameObject) { @@ -860,8 +885,7 @@ message HealthCheckResponse { this.monitor.port = newGameObject.options.port; } this.monitor.game = newGameObject.keys[0]; - } - + }, }, mounted() { this.init(); From 7706c295642163dd52c342b14cad4c6d979b116d Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Tue, 4 Apr 2023 15:42:37 +0800 Subject: [PATCH 6/6] Minor --- src/pages/StatusPage.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index b1c6d64c9..fc3d3741d 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -285,9 +285,10 @@ :options="allMonitorList" :multiple="false" :searchable="true" - :placeholder="$t('Select')" + :placeholder="$t('Add a monitor')" label="name" trackBy="name" + class="mt-3" >