diff --git a/server/routers/api-router.js b/server/routers/api-router.js index 0b4982db6..8b5d36f2a 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -10,6 +10,7 @@ const { UptimeKumaServer } = require("../uptime-kuma-server"); const { UptimeCacheList } = require("../uptime-cache-list"); const { makeBadge } = require("badge-maker"); const { badgeConstants } = require("../config"); +const { Prometheus } = require("../prometheus"); let router = express.Router(); @@ -37,7 +38,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; @@ -89,6 +90,7 @@ router.get("/api/push/:pushToken", async (request, response) => { io.to(monitor.user_id).emit("heartbeat", bean.toJSON()); UptimeCacheList.clearCache(monitor.id); Monitor.sendStats(io, monitor.id, monitor.user_id); + new Prometheus(monitor).update(bean, undefined); response.json({ ok: true, 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/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 @@ - + - + - +