diff --git a/package-lock.json b/package-lock.json index eefd9d5ac..5b961b90f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "uptime-kuma", - "version": "1.11.4", + "version": "1.12.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "uptime-kuma", - "version": "1.11.4", + "version": "1.12.1", "license": "MIT", "dependencies": { "@fortawesome/fontawesome-svg-core": "~1.2.36", @@ -29,6 +29,7 @@ "dayjs": "~1.10.7", "express": "~4.17.1", "express-basic-auth": "~1.2.0", + "favico.js": "^0.3.10", "form-data": "~4.0.0", "http-graceful-shutdown": "~3.1.5", "iconv-lite": "^0.6.3", @@ -6140,6 +6141,11 @@ "reusify": "^1.0.4" } }, + "node_modules/favico.js": { + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/favico.js/-/favico.js-0.3.10.tgz", + "integrity": "sha1-gFhuJ6EX8kqNUcGKmb3HFNQzkwE=" + }, "node_modules/fb-watchman": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", @@ -18240,6 +18246,11 @@ "reusify": "^1.0.4" } }, + "favico.js": { + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/favico.js/-/favico.js-0.3.10.tgz", + "integrity": "sha1-gFhuJ6EX8kqNUcGKmb3HFNQzkwE=" + }, "fb-watchman": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", diff --git a/package.json b/package.json index 9da737982..23f7acde6 100644 --- a/package.json +++ b/package.json @@ -68,12 +68,13 @@ "chardet": "^1.3.0", "chart.js": "~3.6.0", "chartjs-adapter-dayjs": "~1.0.0", - "check-password-strength": "^2.0.3", + "check-password-strength": "^2.0.5", "command-exists": "~1.2.9", "compare-versions": "~3.6.0", "dayjs": "~1.10.7", "express": "~4.17.1", "express-basic-auth": "~1.2.0", + "favico.js": "^0.3.10", "form-data": "~4.0.0", "http-graceful-shutdown": "~3.1.5", "iconv-lite": "^0.6.3", diff --git a/src/languages/bg-BG.js b/src/languages/bg-BG.js index 66ce636f8..1973aed11 100644 --- a/src/languages/bg-BG.js +++ b/src/languages/bg-BG.js @@ -361,4 +361,13 @@ export default { smtpDkimHashAlgo: "Хеш алгоритъм (по желание)", smtpDkimheaderFieldNames: "Хедър ключове за подписване (по желание)", smtpDkimskipFields: "Хедър ключове, които да не се подписват (по желание)", + PushByTechulus: "Push от Techulus", + GoogleChat: "Google Chat (Само за работното пространство на Google)", + gorush: "Gorush", + alerta: "Alerta", + alertaApiEndpoint: "Крайна точка на API", + alertaEnvironment: "Среда", + alertaApiKey: "API Ключ", + alertaAlertState: "Състояние на тревога", + alertaRecoverState: "Състояние на възстановяване", }; diff --git a/src/languages/hu.js b/src/languages/hu.js index 8b390dc46..06a324aa1 100644 --- a/src/languages/hu.js +++ b/src/languages/hu.js @@ -362,4 +362,12 @@ export default { smtpDkimHashAlgo: "Hash algoritmus (nem kötelező)", smtpDkimheaderFieldNames: "Fejléc kulcsok a bejelentkezéshez (nem kötelező)", smtpDkimskipFields: "Fejléc kulcsok egyéb esetben (nem kötelező)", + PushByTechulus: "Techulus push", + gorush: "Gorush", + alerta: "Alerta", + alertaApiEndpoint: "API végpont", + alertaEnvironment: "Környezet", + alertaApiKey: "API kulcs", + alertaAlertState: "Figyelmeztetési állapot", + alertaRecoverState: "Visszaállási állapot", }; diff --git a/src/mixins/socket.js b/src/mixins/socket.js index 5dee63082..5d80293de 100644 --- a/src/mixins/socket.js +++ b/src/mixins/socket.js @@ -1,6 +1,7 @@ import { io } from "socket.io-client"; import { useToast } from "vue-toastification"; import jwt_decode from "jwt-decode"; +import Favico from "favico.js"; const toast = useToast(); let socket; @@ -11,6 +12,10 @@ const noSocketIOPages = [ "/" ]; +const favicon = new Favico({ + animation: "none" +}); + export default { data() { @@ -398,10 +403,50 @@ export default { return result; }, + + stats() { + let result = { + up: 0, + down: 0, + unknown: 0, + pause: 0, + }; + + for (let monitorID in this.$root.monitorList) { + let beat = this.$root.lastHeartbeatList[monitorID]; + let monitor = this.$root.monitorList[monitorID]; + + if (monitor && ! monitor.active) { + result.pause++; + } else if (beat) { + if (beat.status === 1) { + result.up++; + } else if (beat.status === 0) { + result.down++; + } else if (beat.status === 2) { + result.up++; + } else { + result.unknown++; + } + } else { + result.unknown++; + } + } + + return result; + }, }, watch: { + // Update Badge + "stats.down"(to, from) { + if (to !== from) { + favicon.badge(to); + console.log(to); + } + }, + // Reload the SPA if the server version is changed. "info.version"(to, from) { if (from && from !== to) { diff --git a/src/pages/DashboardHome.vue b/src/pages/DashboardHome.vue index 16d07983b..6e8a5bbcd 100644 --- a/src/pages/DashboardHome.vue +++ b/src/pages/DashboardHome.vue @@ -9,19 +9,19 @@