From 1952e34110957a3ed81b68d0ad9afb78f0da4ac4 Mon Sep 17 00:00:00 2001 From: Ponkhy Date: Sun, 29 Aug 2021 18:47:01 +0200 Subject: [PATCH 01/25] Added the possibility to clear monitor data --- server/server.js | 48 ++++++++++++++++++++++ src/assets/vars.scss | 2 + src/languages/de-DE.js | 5 +++ src/languages/en.js | 2 + src/mixins/socket.js | 7 ++++ src/pages/Details.vue | 93 ++++++++++++++++++++++++++++++++++++++++-- 6 files changed, 153 insertions(+), 4 deletions(-) diff --git a/server/server.js b/server/server.js index d4fe668b3..3530981bb 100644 --- a/server/server.js +++ b/server/server.js @@ -552,6 +552,54 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); } }); + socket.on("clearEvents", async (monitorID, callback) => { + try { + checkLogin(socket) + + console.log(`Clear Events Monitor: ${monitorID} User ID: ${socket.userID}`) + + await R.exec("UPDATE heartbeat SET msg = ?, important = ? WHERE monitor_id = ? ", [ + "", + "0", + monitorID, + ]); + + callback({ + ok: true, + msg: "Events Successfully Cleared.", + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + + socket.on("clearHeartbeats", async (monitorID, callback) => { + try { + checkLogin(socket) + + console.log(`Clear Heartbeats Monitor: ${monitorID} User ID: ${socket.userID}`) + + await R.exec("DELETE FROM heartbeat WHERE monitor_id = ?", [ + monitorID + ]); + + callback({ + ok: true, + msg: "Heartbeats Successfully Cleared.", + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + debug("added all socket handlers") // *************************** diff --git a/src/assets/vars.scss b/src/assets/vars.scss index 9d487eb26..2f4369832 100644 --- a/src/assets/vars.scss +++ b/src/assets/vars.scss @@ -16,3 +16,5 @@ $dark-border-color: #1d2634; $easing-in: cubic-bezier(0.54, 0.78, 0.55, 0.97); $easing-out: cubic-bezier(0.25, 0.46, 0.45, 0.94); $easing-in-out: cubic-bezier(0.79, 0.14, 0.15, 0.86); + +$dropdown-border-radius: 0.5rem; diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index ba852cf32..58d283a3b 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -104,4 +104,9 @@ export default { rrtypeDescription: "Wähle den RR-Typ aus, welchen du überwachen möchtest.", "Last Result": "Letztes Ergebnis", pauseMonitorMsg: "Bist du sicher das du den Monitor pausieren möchtest?", + clearEventsMsg: "Bist du sicher das du alle Ereignisse löschen möchtest?", + clearHeartbeatsMsg: "Bist du sicher das du alle Statistiken löschen möchtest?", + "Clear Data": "Lösche Daten", + "Events": "Ereignisse", + "Heartbeats": "Statistiken", } diff --git a/src/languages/en.js b/src/languages/en.js index 75c25dd57..0729e2e7e 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -16,4 +16,6 @@ export default { resoverserverDescription: "Cloudflare is the default server, you can change the resolver server anytime.", rrtypeDescription: "Select the RR-Type you want to monitor", pauseMonitorMsg: "Are you sure want to pause?", + clearEventsMsg: "Are you sure want to delete all events?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats?", } diff --git a/src/mixins/socket.js b/src/mixins/socket.js index 454422e94..6f6f033a6 100644 --- a/src/mixins/socket.js +++ b/src/mixins/socket.js @@ -254,6 +254,13 @@ export default { this.importantHeartbeatList = {} }, + clearEvents(monitorID, callback) { + socket.emit("clearEvents", monitorID, callback) + }, + + clearHeartbeats(monitorID, callback) { + socket.emit("clearHeartbeats", monitorID, callback) + }, }, computed: { diff --git a/src/pages/Details.vue b/src/pages/Details.vue index cc45e4034..8ceae1d25 100644 --- a/src/pages/Details.vue +++ b/src/pages/Details.vue @@ -133,6 +133,23 @@
+ @@ -172,6 +189,14 @@ {{ $t("deleteMonitorMsg") }} + + + {{ $t("clearEventsMsg") }} + + + + {{ $t("clearHeartbeatsMsg") }} + @@ -313,6 +338,14 @@ export default { this.$refs.confirmDelete.show(); }, + clearEventsDialog() { + this.$refs.confirmClearEvents.show(); + }, + + clearHeartbeatsDialog() { + this.$refs.confirmClearHeartbeats.show(); + }, + deleteMonitor() { this.$root.deleteMonitor(this.monitor.id, (res) => { if (res.ok) { @@ -324,6 +357,27 @@ export default { }) }, + clearEvents() { + this.$root.clearEvents(this.monitor.id, (res) => { + if (res.ok) { + toast.success(res.msg); + this.$router.go(); + } else { + toast.error(res.msg); + } + }) + }, + + clearHeartbeats() { + this.$root.clearHeartbeats(this.monitor.id, (res) => { + if (res.ok) { + toast.success(res.msg); + this.$router.go(); + } else { + toast.error(res.msg); + } + }) + }, }, } @@ -340,16 +394,20 @@ export default { @media (max-width: 550px) { .functions { text-align: center; - } - button, a { - margin-left: 10px !important; - margin-right: 10px !important; + button, a { + margin-left: 10px !important; + margin-right: 10px !important; + } } .ping-chart-wrapper { padding: 10px !important; } + + .dropdown-clear-data { + margin-bottom: 10px; + } } @media (max-width: 400px) { @@ -364,6 +422,13 @@ export default { padding-left: 25px; padding-right: 25px; } + + .dropdown-clear-data { + button { + display: block; + padding-top: 4px; + } + } } .url { @@ -417,9 +482,29 @@ table { color: black; } +.dropdown-clear-data { + float: right; +} + .dark { .keyword { color: $dark-font-color; } + + .dropdown-clear-data { + ul { + background-color: $dark-bg; + border-color: $dark-bg2; + border-width: 2px; + + li button{ + color: $dark-font-color; + } + + li button:hover { + background-color: $dark-bg2; + } + } + } } From 7b92166d18e0759d3cc805c9cd96ef39fbdcee61 Mon Sep 17 00:00:00 2001 From: Ponkhy Date: Wed, 1 Sep 2021 00:36:24 +0200 Subject: [PATCH 02/25] Added clear all db statistics function --- server/server.js | 22 ++++++++++++++++++++-- src/languages/de-DE.js | 5 +++-- src/languages/en.js | 5 +++-- src/mixins/socket.js | 4 ++++ src/pages/Details.vue | 2 -- src/pages/Settings.vue | 18 ++++++++++++++++++ 6 files changed, 48 insertions(+), 8 deletions(-) diff --git a/server/server.js b/server/server.js index 3530981bb..6c49b8c23 100644 --- a/server/server.js +++ b/server/server.js @@ -566,7 +566,6 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); callback({ ok: true, - msg: "Events Successfully Cleared.", }); } catch (e) { @@ -589,7 +588,26 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); callback({ ok: true, - msg: "Heartbeats Successfully Cleared.", + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + + socket.on("clearStatistics", async (callback) => { + try { + checkLogin(socket) + + console.log(`Clear Statistics User ID: ${socket.userID}`) + + await R.exec("DELETE FROM heartbeat"); + + callback({ + ok: true, }); } catch (e) { diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index 58d283a3b..182f9e1a0 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -104,9 +104,10 @@ export default { rrtypeDescription: "Wähle den RR-Typ aus, welchen du überwachen möchtest.", "Last Result": "Letztes Ergebnis", pauseMonitorMsg: "Bist du sicher das du den Monitor pausieren möchtest?", - clearEventsMsg: "Bist du sicher das du alle Ereignisse löschen möchtest?", - clearHeartbeatsMsg: "Bist du sicher das du alle Statistiken löschen möchtest?", + clearEventsMsg: "Bist du sicher das du alle Ereignisse für diesen Monitor löschen möchtest?", + clearHeartbeatsMsg: "Bist du sicher das du alle Statistiken für diesen Monitor löschen möchtest?", "Clear Data": "Lösche Daten", "Events": "Ereignisse", "Heartbeats": "Statistiken", + confirmClearStatisticsMsg: "Bist du sicher das du ALLE Statistiken löschen möchtest?", } diff --git a/src/languages/en.js b/src/languages/en.js index 0729e2e7e..f72418070 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -16,6 +16,7 @@ export default { resoverserverDescription: "Cloudflare is the default server, you can change the resolver server anytime.", rrtypeDescription: "Select the RR-Type you want to monitor", pauseMonitorMsg: "Are you sure want to pause?", - clearEventsMsg: "Are you sure want to delete all events?", - clearHeartbeatsMsg: "Are you sure want to delete all heartbeats?", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", } diff --git a/src/mixins/socket.js b/src/mixins/socket.js index 6f6f033a6..64560ea7c 100644 --- a/src/mixins/socket.js +++ b/src/mixins/socket.js @@ -261,6 +261,10 @@ export default { clearHeartbeats(monitorID, callback) { socket.emit("clearHeartbeats", monitorID, callback) }, + + clearStatistics(callback) { + socket.emit("clearStatistics", callback) + }, }, computed: { diff --git a/src/pages/Details.vue b/src/pages/Details.vue index 5c05b3dda..907e2d124 100644 --- a/src/pages/Details.vue +++ b/src/pages/Details.vue @@ -360,7 +360,6 @@ export default { clearEvents() { this.$root.clearEvents(this.monitor.id, (res) => { if (res.ok) { - toast.success(res.msg); this.$router.go(); } else { toast.error(res.msg); @@ -371,7 +370,6 @@ export default { clearHeartbeats() { this.$root.clearHeartbeats(this.monitor.id, (res) => { if (res.ok) { - toast.success(res.msg); this.$router.go(); } else { toast.error(res.msg); diff --git a/src/pages/Settings.vue b/src/pages/Settings.vue index d71ec109b..da56613e5 100644 --- a/src/pages/Settings.vue +++ b/src/pages/Settings.vue @@ -126,6 +126,7 @@ + @@ -184,6 +185,10 @@

Bitte mit Vorsicht nutzen.

+ + + {{ $t("confirmClearStatisticsMsg") }} + @@ -282,6 +287,10 @@ export default { this.$refs.confirmDisableAuth.show(); }, + confirmClearStatistics() { + this.$refs.confirmClearStatistics.show(); + }, + disableAuth() { this.settings.disableAuth = true; this.saveSettings(); @@ -293,6 +302,15 @@ export default { this.$root.storage().removeItem("token"); }, + clearStatistics() { + this.$root.clearStatistics((res) => { + if (res.ok) { + this.$router.go(); + } else { + toast.error(res.msg); + } + }) + }, }, } From 0b9e410ea5b6edcc888ddd488d19a36ca011abf8 Mon Sep 17 00:00:00 2001 From: Ponkhy Date: Sat, 4 Sep 2021 13:36:08 +0200 Subject: [PATCH 03/25] Added i18n key to en.js --- src/languages/en.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index accc6dcc6..bec4edf27 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -111,5 +111,8 @@ export default { "Create your admin account": "Create your admin account", "Repeat Password": "Repeat Password", respTime: "Resp. Time (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + "Clear Data": "Clear Data", + "Events": "Events", + "Heartbeats": "Heartbeats", } From 299506ce45d64956b064528b30e4fa4cbea806fd Mon Sep 17 00:00:00 2001 From: LouisLam Date: Sun, 5 Sep 2021 02:03:40 +0800 Subject: [PATCH 04/25] reset the heartbeat list instead of reload the page after cleared events or heartbeats --- server/client.js | 91 +++++++++++++++++++++++++++++++++++++++++++ server/server.js | 72 +++++----------------------------- src/mixins/socket.js | 8 ++-- src/pages/Details.vue | 11 ++---- 4 files changed, 109 insertions(+), 73 deletions(-) create mode 100644 server/client.js diff --git a/server/client.js b/server/client.js new file mode 100644 index 000000000..4f28a2fa0 --- /dev/null +++ b/server/client.js @@ -0,0 +1,91 @@ +/* + * For Client Socket + */ +const { TimeLogger } = require("../src/util"); +const { R } = require("redbean-node"); +const { io } = require("./server"); + +async function sendNotificationList(socket) { + const timeLogger = new TimeLogger(); + + let result = []; + let list = await R.find("notification", " user_id = ? ", [ + socket.userID, + ]); + + for (let bean of list) { + result.push(bean.export()) + } + + io.to(socket.userID).emit("notificationList", result) + + timeLogger.print("Send Notification List"); + + return list; +} + +/** + * Send Heartbeat History list to socket + * @param toUser True = send to all browsers with the same user id, False = send to the current browser only + * @param overwrite Overwrite client-side's heartbeat list + */ +async function sendHeartbeatList(socket, monitorID, toUser = false, overwrite = false) { + const timeLogger = new TimeLogger(); + + let list = await R.find("heartbeat", ` + monitor_id = ? + ORDER BY time DESC + LIMIT 100 + `, [ + monitorID, + ]) + + let result = []; + + for (let bean of list) { + result.unshift(bean.toJSON()); + } + + if (toUser) { + io.to(socket.userID).emit("heartbeatList", monitorID, result, overwrite); + } else { + socket.emit("heartbeatList", monitorID, result, overwrite); + } + + timeLogger.print(`[Monitor: ${monitorID}] sendHeartbeatList`); +} + +/** + * Important Heart beat list (aka event list) + * @param socket + * @param monitorID + * @param toUser True = send to all browsers with the same user id, False = send to the current browser only + * @param overwrite Overwrite client-side's heartbeat list + */ +async function sendImportantHeartbeatList(socket, monitorID, toUser = false, overwrite = false) { + const timeLogger = new TimeLogger(); + + let list = await R.find("heartbeat", ` + monitor_id = ? + AND important = 1 + ORDER BY time DESC + LIMIT 500 + `, [ + monitorID, + ]) + + timeLogger.print(`[Monitor: ${monitorID}] sendImportantHeartbeatList`); + + if (toUser) { + io.to(socket.userID).emit("importantHeartbeatList", monitorID, list, overwrite); + } else { + socket.emit("importantHeartbeatList", monitorID, list, overwrite); + } + +} + +module.exports = { + sendNotificationList, + sendImportantHeartbeatList, + sendHeartbeatList, +} diff --git a/server/server.js b/server/server.js index e28b96d82..7d9295354 100644 --- a/server/server.js +++ b/server/server.js @@ -82,7 +82,12 @@ if (sslKey && sslCert) { } const io = new Server(server); -app.use(express.json()) +module.exports.io = io; + +// Must be after io instantiation +const { sendNotificationList, sendHeartbeatList, sendImportantHeartbeatList } = require("./client"); + +app.use(express.json()); /** * Total WebSocket client connected to server currently, no actual use @@ -597,6 +602,8 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); monitorID, ]); + await sendImportantHeartbeatList(socket, monitorID, true, true); + callback({ ok: true, }); @@ -619,6 +626,8 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); monitorID ]); + await sendHeartbeatList(socket, monitorID, true, true); + callback({ ok: true, }); @@ -719,25 +728,6 @@ async function sendMonitorList(socket) { return list; } -async function sendNotificationList(socket) { - const timeLogger = new TimeLogger(); - - let result = []; - let list = await R.find("notification", " user_id = ? ", [ - socket.userID, - ]); - - for (let bean of list) { - result.push(bean.export()) - } - - io.to(socket.userID).emit("notificationList", result) - - timeLogger.print("Send Notification List"); - - return list; -} - async function afterLogin(socket, user) { socket.userID = user.id; socket.join(user.id) @@ -872,48 +862,6 @@ async function startMonitors() { } } -/** - * Send Heartbeat History list to socket - */ -async function sendHeartbeatList(socket, monitorID) { - const timeLogger = new TimeLogger(); - - let list = await R.find("heartbeat", ` - monitor_id = ? - ORDER BY time DESC - LIMIT 100 - `, [ - monitorID, - ]) - - let result = []; - - for (let bean of list) { - result.unshift(bean.toJSON()) - } - - socket.emit("heartbeatList", monitorID, result) - - timeLogger.print(`[Monitor: ${monitorID}] sendHeartbeatList`) -} - -async function sendImportantHeartbeatList(socket, monitorID) { - const timeLogger = new TimeLogger(); - - let list = await R.find("heartbeat", ` - monitor_id = ? - AND important = 1 - ORDER BY time DESC - LIMIT 500 - `, [ - monitorID, - ]) - - timeLogger.print(`[Monitor: ${monitorID}] sendImportantHeartbeatList`); - - socket.emit("importantHeartbeatList", monitorID, list) -} - async function shutdownFunction(signal) { console.log("Shutdown requested"); console.log("Called signal: " + signal); diff --git a/src/mixins/socket.js b/src/mixins/socket.js index 64560ea7c..672027fa1 100644 --- a/src/mixins/socket.js +++ b/src/mixins/socket.js @@ -107,8 +107,8 @@ export default { } }); - socket.on("heartbeatList", (monitorID, data) => { - if (! (monitorID in this.heartbeatList)) { + socket.on("heartbeatList", (monitorID, data, overwrite = false) => { + if (! (monitorID in this.heartbeatList) || overwrite) { this.heartbeatList[monitorID] = data; } else { this.heartbeatList[monitorID] = data.concat(this.heartbeatList[monitorID]) @@ -127,8 +127,8 @@ export default { this.certInfoList[monitorID] = JSON.parse(data) }); - socket.on("importantHeartbeatList", (monitorID, data) => { - if (! (monitorID in this.importantHeartbeatList)) { + socket.on("importantHeartbeatList", (monitorID, data, overwrite) => { + if (! (monitorID in this.importantHeartbeatList) || overwrite) { this.importantHeartbeatList[monitorID] = data; } else { this.importantHeartbeatList[monitorID] = data.concat(this.importantHeartbeatList[monitorID]) diff --git a/src/pages/Details.vue b/src/pages/Details.vue index d30885f48..776f1c1dd 100644 --- a/src/pages/Details.vue +++ b/src/pages/Details.vue @@ -276,6 +276,7 @@ export default { importantHeartBeatList() { if (this.$root.importantHeartbeatList[this.monitor.id]) { + // eslint-disable-next-line vue/no-side-effects-in-computed-properties this.heartBeatList = this.$root.importantHeartbeatList[this.monitor.id]; return this.$root.importantHeartbeatList[this.monitor.id] } @@ -359,9 +360,7 @@ export default { clearEvents() { this.$root.clearEvents(this.monitor.id, (res) => { - if (res.ok) { - this.$router.go(); - } else { + if (! res.ok) { toast.error(res.msg); } }) @@ -369,9 +368,7 @@ export default { clearHeartbeats() { this.$root.clearHeartbeats(this.monitor.id, (res) => { - if (res.ok) { - this.$router.go(); - } else { + if (! res.ok) { toast.error(res.msg); } }) @@ -495,7 +492,7 @@ table { border-color: $dark-bg2; border-width: 2px; - li button{ + li button { color: $dark-font-color; } From d5b32ffbb8cb91834a6c3a37bb3a3c9c76d6e71f Mon Sep 17 00:00:00 2001 From: LouisLam Date: Sun, 5 Sep 2021 02:25:40 +0800 Subject: [PATCH 05/25] add language missing keys --- src/languages/da-DK.js | 8 +++++++- src/languages/de-DE.js | 4 ++-- src/languages/en.js | 4 ++-- src/languages/es-ES.js | 8 +++++++- src/languages/fr.js | 8 +++++++- src/languages/ja.js | 8 +++++++- src/languages/ko-KR.js | 8 +++++++- src/languages/nl-NL.js | 8 +++++++- src/languages/ru-RU.js | 8 +++++++- src/languages/sr-latn.js | 8 +++++++- src/languages/sr.js | 8 +++++++- src/languages/sv-SE.js | 8 +++++++- src/languages/zh-CN.js | 8 +++++++- src/languages/zh-HK.js | 8 +++++++- 14 files changed, 88 insertions(+), 16 deletions(-) diff --git a/src/languages/da-DK.js b/src/languages/da-DK.js index 713eecfe2..1f4f74faf 100644 --- a/src/languages/da-DK.js +++ b/src/languages/da-DK.js @@ -108,5 +108,11 @@ export default { "Repeat Password": "Gentag adgangskoden", "Resource Record Type": "Resource Record Type", respTime: "Resp. Time (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index 9d51d4383..0db25023c 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -107,8 +107,8 @@ export default { clearEventsMsg: "Bist du sicher das du alle Ereignisse für diesen Monitor löschen möchtest?", clearHeartbeatsMsg: "Bist du sicher das du alle Statistiken für diesen Monitor löschen möchtest?", "Clear Data": "Lösche Daten", - "Events": "Ereignisse", - "Heartbeats": "Statistiken", + Events: "Ereignisse", + Heartbeats: "Statistiken", confirmClearStatisticsMsg: "Bist du sicher das du ALLE Statistiken löschen möchtest?", "Create your admin account": "Erstelle dein Admin Konto", "Repeat Password": "Wiederhole das Passwort", diff --git a/src/languages/en.js b/src/languages/en.js index bec4edf27..58089b9ea 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -113,6 +113,6 @@ export default { respTime: "Resp. Time (ms)", notAvailableShort: "N/A", "Clear Data": "Clear Data", - "Events": "Events", - "Heartbeats": "Heartbeats", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/es-ES.js b/src/languages/es-ES.js index 96ce923ec..0f1183271 100644 --- a/src/languages/es-ES.js +++ b/src/languages/es-ES.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "Crea tu cuenta de administrador", "Repeat Password": "Repetir contraseña", respTime: "Tiempo de resp. (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/fr.js b/src/languages/fr.js index e4f999dce..7bfb4f9d3 100644 --- a/src/languages/fr.js +++ b/src/languages/fr.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "Créez votre compte administrateur", "Repeat Password": "Répéter le mot de passe", respTime: "Temps de réponse (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/ja.js b/src/languages/ja.js index 23de640cf..86c5b2030 100644 --- a/src/languages/ja.js +++ b/src/languages/ja.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "Create your admin account", "Repeat Password": "Repeat Password", respTime: "Resp. Time (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/ko-KR.js b/src/languages/ko-KR.js index 8493193cb..4a3c84a4a 100644 --- a/src/languages/ko-KR.js +++ b/src/languages/ko-KR.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "관리자 계정 만들기", "Repeat Password": "비밀번호 재입력", respTime: "응답 시간 (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/nl-NL.js b/src/languages/nl-NL.js index 60c5089c9..24e72910b 100644 --- a/src/languages/nl-NL.js +++ b/src/languages/nl-NL.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "Maak uw beheerdersaccount aan", "Repeat Password": "Herhaal wachtwoord", respTime: "resp. tijd (ms)", - notAvailableShort: "N.v.t." + notAvailableShort: "N.v.t.", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/ru-RU.js b/src/languages/ru-RU.js index f42f9c256..f2c7a0eee 100644 --- a/src/languages/ru-RU.js +++ b/src/languages/ru-RU.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "Создайте аккаунт администратора", "Repeat Password": "Повторите пароль", respTime: "Resp. Time (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/sr-latn.js b/src/languages/sr-latn.js index aa7d95cf9..60a90d859 100644 --- a/src/languages/sr-latn.js +++ b/src/languages/sr-latn.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "Naprivi administratorski nalog", "Repeat Password": "Ponovite lozinku", respTime: "Vreme odg. (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/sr.js b/src/languages/sr.js index 0bd084036..dfcee7cee 100644 --- a/src/languages/sr.js +++ b/src/languages/sr.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "Наприви администраторски налог", "Repeat Password": "Поновите лозинку", respTime: "Време одг. (мс)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/sv-SE.js b/src/languages/sv-SE.js index 8aa4e155b..dc76babd9 100644 --- a/src/languages/sv-SE.js +++ b/src/languages/sv-SE.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "Skapa ditt administratörskonto", "Repeat Password": "Upprepa Lösenord", respTime: "Svarstid (ms)", - notAvailableShort: "Ej Tillg." + notAvailableShort: "Ej Tillg.", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/zh-CN.js b/src/languages/zh-CN.js index d179a91af..d04eabdf4 100644 --- a/src/languages/zh-CN.js +++ b/src/languages/zh-CN.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "创建管理员账号", "Repeat Password": "重复密码", respTime: "Resp. Time (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "Are you sure want to delete all events for this monitor?", + clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?", + confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?", + "Clear Data": "Clear Data", + Events: "Events", + Heartbeats: "Heartbeats" } diff --git a/src/languages/zh-HK.js b/src/languages/zh-HK.js index 4bcc5029e..39532dfe2 100644 --- a/src/languages/zh-HK.js +++ b/src/languages/zh-HK.js @@ -108,5 +108,11 @@ export default { "Create your admin account": "製作你的管理員帳號", "Repeat Password": "重複密碼", respTime: "反應時間 (ms)", - notAvailableShort: "N/A" + notAvailableShort: "N/A", + clearEventsMsg: "是否確定刪除這個監測器的所有事件?", + clearHeartbeatsMsg: "是否確定刪除這個監測器的所有脈搏資料?", + confirmClearStatisticsMsg: "是否確定刪除所有監測器的脈搏資料?(您的監測器會繼續正常運作)", + "Clear Data": "清除資料", + Events: "事件", + Heartbeats: "脈搏" } From d4ff5d8b325571ebf4fe518bc09b9ac30cd51a95 Mon Sep 17 00:00:00 2001 From: Adam Stachowicz Date: Sun, 5 Sep 2021 20:55:25 +0200 Subject: [PATCH 06/25] [LANG] `pl` fixes --- src/languages/pl.js | 66 ++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/languages/pl.js b/src/languages/pl.js index 25f76430d..c95a1d6bc 100644 --- a/src/languages/pl.js +++ b/src/languages/pl.js @@ -1,20 +1,20 @@ export default { languageName: "Polski", - checkEverySecond: "sprawdzaj co {0} sekund.", - "Avg.": "Średnia. ", - retriesDescription: "Maksymalna liczba ponownych prób, zanim usługa zostanie oznaczona jako offline i zostanie wysłane powiadomienie.", - ignoreTLSError: "Ignoruj błąd TLS/SSL dla stron HTTPS.", + checkEverySecond: "Sprawdzaj co {0} sekund.", + "Avg.": "Średnia ", + retriesDescription: "Maksymalna liczba powtórzeń, zanim usługa zostanie oznaczona jako wyłączona i zostanie wysłane powiadomienie", + ignoreTLSError: "Ignoruj błąd TLS/SSL dla stron HTTPS", upsideDownModeDescription: "Odwróć status do góry nogami. Jeśli usługa jest osiągalna, to jest niedostępna.", - maxRedirectDescription: "Maksymalna liczba przekierowań do naśladowania. Ustaw na 0, aby wyłączyć przekierowania.", + maxRedirectDescription: "Maksymalna liczba przekierowań do wykonania. Ustaw na 0, aby wyłączyć przekierowania.", acceptedStatusCodesDescription: "Wybierz kody stanu, które są uważane za udaną odpowiedź.", - passwordNotMatchMsg: "Powtórzone hasło nie jest takie samo.", - notificationDescription: "Dodaj powiadomienie do monitorów, aby one działały.", - keywordDescription: "Wyszukaj słowo kluczowe w html lub JSON i wielkość liter ma znaczenie.", - pauseDashboardHome: "pauza", + passwordNotMatchMsg: "Powtórzone hasło nie pasuje.", + notificationDescription: "Proszę przypisać powiadomienie do monitora(ów), aby zadziałał.", + keywordDescription: "Wyszukiwanie słów kluczowych w zwykłym html lub odpowiedzi JSON. Wielkość liter ma znaczenie.", + pauseDashboardHome: "Pauza", deleteMonitorMsg: "Czy na pewno chcesz usunąć ten monitor?", - deleteNotificationMsg: "Czy na pewno chcesz usunąć to powiadomienie ze wszystkich monitorów?", - resoverserverDescription: "Cloudflare jest domyślnym serwerem, możesz zmienić serwer resolver w dowolnym momencie.", - rrtypeDescription: "Wybierz typ RR-Type który chcesz monitorować.", + deleteNotificationMsg: "Czy na pewno chcesz usunąć to powiadomienie dla wszystkich monitorów?", + resoverserverDescription: "Cloudflare jest domyślnym serwerem, możesz zmienić serwer resolver w każdej chwili.", + rrtypeDescription: "Wybierz RR-Type który chcesz monitorować", pauseMonitorMsg: "Czy na pewno chcesz wstrzymać?", Settings: "Ustawienia", Dashboard: "Panel", @@ -23,11 +23,11 @@ export default { Appearance: "Wygląd", Theme: "Motyw", General: "Ogólne", - Version: "Versja", + Version: "Wersja", "Check Update On GitHub": "Sprawdź aktualizację na GitHub.", List: "Lista", Add: "Dodaj", - "Add New Monitor": "Dodaj Nowy Monitor", + "Add New Monitor": "Dodaj nowy monitor", "Quick Stats": "Szybkie statystyki", Up: "Online", Down: "Offline", @@ -38,46 +38,46 @@ export default { Status: "Status", DateTime: "Data i godzina", Message: "Wiadomość", - "No important events": "Brak ważnych wydarzeń.", + "No important events": "Brak ważnych wydarzeń", Resume: "Wznów", Edit: "Edytuj", Delete: "Usuń", Current: "aktualny", - Uptime: "czas pracy", - "Cert Exp.": "Wygaśnięcie certyfikatu.", + Uptime: "Czas pracy", + "Cert Exp.": "Wygaśnięcie certyfikatu", days: "dni", day: "dzień", - "-day": "-dzień", + "-day": " dni", hour: "godzina", - "-hour": "-godzina", - Response: "odpowiedź", + "-hour": " godziny", + Response: "Odpowiedź", Ping: "Ping", "Monitor Type": "Typ monitora", - Keyword: "słowo kluczowe", - "Friendly Name": "Przyjazne imię", + Keyword: "Słowo kluczowe", + "Friendly Name": "Przyjazna nazwa", URL: "URL", - Hostname: "Hostname", + Hostname: "Nazwa hosta", Port: "Port", "Heartbeat Interval": "Interwał bicia serca", Retries: "Prób", Advanced: "Zaawansowane", "Upside Down Mode": "Tryb do góry nogami", - "Max. Redirects": "Maks. Przekierowania", + "Max. Redirects": "Maks. przekierowania", "Accepted Status Codes": "Akceptowane kody statusu", Save: "Zapisz", Notifications: "Powiadomienia", "Not available, please setup.": "Niedostępne, proszę skonfigurować.", - "Setup Notification": "Powiadomienie konfiguracji", + "Setup Notification": "Konfiguracja powiadomień", Light: "Jasny", Dark: "Ciemny", Auto: "Automatyczny", "Theme - Heartbeat Bar": "Motyw - pasek bicia serca", Normal: "Normalne", Bottom: "Na dole", - None: "Nic", + None: "Brak", Timezone: "Strefa czasowa", "Search Engine Visibility": "Widoczność w wyszukiwarce", - "Allow indexing": "Zezwól na indeksowanie", + "Allow indexing": "Pozwól na indeksowanie", "Discourage search engines from indexing site": "Zniechęcaj wyszukiwarki do indeksowania strony", "Change Password": "Zmień hasło", "Current Password": "Aktualne hasło", @@ -87,7 +87,7 @@ export default { "Disable Auth": "Wyłącz autoryzację", "Enable Auth": "Włącz autoryzację ", Logout: "Wyloguj się", - Leave: "Opuść", + Leave: "Zostaw", "I understand, please disable": "Rozumiem, proszę wyłączyć", Confirm: "Potwierdź", Yes: "Tak", @@ -95,8 +95,8 @@ export default { Username: "Nazwa użytkownika", Password: "Hasło", "Remember me": "Zapamiętaj mnie", - Login: "Zaloguj sie", - "No Monitors, please": "Proszę bez monitorów", + Login: "Zaloguj się", + "No Monitors, please": "Brak monitorów, proszę", "add one": "dodaj jeden", "Notification Type": "Typ powiadomienia", Email: "Email", @@ -104,10 +104,10 @@ export default { "Certificate Info": "Informacje o certyfikacie", "Resolver Server": "Server resolver", "Resource Record Type": "Typ rekordu zasobów", - "Last Result": "Ostatni rekord", + "Last Result": "Ostatni wynik", "Create your admin account": "Utwórz swoje konto administratora", "Repeat Password": "Powtórz hasło", - respTime: "Odp. Czas (ms)", + respTime: "Czas odp. (ms)", notAvailableShort: "N/A", - Create: "Create" + Create: "Stwórz" } From 424f20f8e125dd3cdfdfba2da5eff6fb5e523958 Mon Sep 17 00:00:00 2001 From: Adam Stachowicz Date: Sun, 5 Sep 2021 20:59:04 +0200 Subject: [PATCH 07/25] Better `upsideDownModeDescription` --- src/languages/pl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/pl.js b/src/languages/pl.js index c95a1d6bc..f416d5083 100644 --- a/src/languages/pl.js +++ b/src/languages/pl.js @@ -4,7 +4,7 @@ export default { "Avg.": "Średnia ", retriesDescription: "Maksymalna liczba powtórzeń, zanim usługa zostanie oznaczona jako wyłączona i zostanie wysłane powiadomienie", ignoreTLSError: "Ignoruj błąd TLS/SSL dla stron HTTPS", - upsideDownModeDescription: "Odwróć status do góry nogami. Jeśli usługa jest osiągalna, to jest niedostępna.", + upsideDownModeDescription: "Odwróć status do góry nogami. Jeśli usługa jest osiągalna, to jest oznaczona jako niedostępna.", maxRedirectDescription: "Maksymalna liczba przekierowań do wykonania. Ustaw na 0, aby wyłączyć przekierowania.", acceptedStatusCodesDescription: "Wybierz kody stanu, które są uważane za udaną odpowiedź.", passwordNotMatchMsg: "Powtórzone hasło nie pasuje.", From dcc77991083da699be4e5f8e7ea8d1a2f7c5f0ac Mon Sep 17 00:00:00 2001 From: Minvinea Date: Sun, 5 Sep 2021 21:34:32 +0200 Subject: [PATCH 08/25] Update few words and name of file https://prnt.sc/1rbosiy --- src/languages/{fr.js => fr-FR.js} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename src/languages/{fr.js => fr-FR.js} (99%) diff --git a/src/languages/fr.js b/src/languages/fr-FR.js similarity index 99% rename from src/languages/fr.js rename to src/languages/fr-FR.js index 4019b74d3..d49d0191d 100644 --- a/src/languages/fr.js +++ b/src/languages/fr-FR.js @@ -66,7 +66,7 @@ export default { "Theme - Heartbeat Bar": "Voir les services surveillés", Normal: "Général", Bottom: "En dessous", - None: "Non", + None: "Rien", Timezone: "Fuseau Horaire", "Search Engine Visibility": "Visibilité par les moteurs de recherche", "Allow indexing": "Autoriser l'indexation par des moteurs de recherche", @@ -109,5 +109,5 @@ export default { "Repeat Password": "Répéter le mot de passe", respTime: "Temps de réponse (ms)", notAvailableShort: "N/A", - Create: "Create" + Create: "Créer" } From e8b814733d4ec8a9e7dea1bf688d487d9ab16643 Mon Sep 17 00:00:00 2001 From: Adam Stachowicz Date: Sun, 5 Sep 2021 23:14:56 +0200 Subject: [PATCH 09/25] Fix typo --- src/languages/pl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/pl.js b/src/languages/pl.js index f416d5083..cc625d6de 100644 --- a/src/languages/pl.js +++ b/src/languages/pl.js @@ -8,7 +8,7 @@ export default { maxRedirectDescription: "Maksymalna liczba przekierowań do wykonania. Ustaw na 0, aby wyłączyć przekierowania.", acceptedStatusCodesDescription: "Wybierz kody stanu, które są uważane za udaną odpowiedź.", passwordNotMatchMsg: "Powtórzone hasło nie pasuje.", - notificationDescription: "Proszę przypisać powiadomienie do monitora(ów), aby zadziałał.", + notificationDescription: "Proszę przypisać powiadomienie do monitora(ów), aby zadziałało.", keywordDescription: "Wyszukiwanie słów kluczowych w zwykłym html lub odpowiedzi JSON. Wielkość liter ma znaczenie.", pauseDashboardHome: "Pauza", deleteMonitorMsg: "Czy na pewno chcesz usunąć ten monitor?", From 1197cfa11e923c658902ddd0281fce2725bb3456 Mon Sep 17 00:00:00 2001 From: Minvinea Date: Sun, 5 Sep 2021 23:37:26 +0200 Subject: [PATCH 10/25] Update file name --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 7ad9db089..e8bc92bfc 100644 --- a/src/main.js +++ b/src/main.js @@ -28,7 +28,7 @@ import zhHK from "./languages/zh-HK"; import deDE from "./languages/de-DE"; import nlNL from "./languages/nl-NL"; import esEs from "./languages/es-ES"; -import fr from "./languages/fr"; +import frFR from "./languages/fr-FR"; import ja from "./languages/ja"; import daDK from "./languages/da-DK"; import sr from "./languages/sr"; From 31648dc5e8cf322f76b18841652f0042787e0b73 Mon Sep 17 00:00:00 2001 From: Minvinea Date: Sun, 5 Sep 2021 23:41:57 +0200 Subject: [PATCH 11/25] Update #2 --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index e8bc92bfc..f34e9c43d 100644 --- a/src/main.js +++ b/src/main.js @@ -106,7 +106,7 @@ const languageList = { "de-DE": deDE, "nl-NL": nlNL, "es-ES": esEs, - "fr": fr, + "fr-FR": frFR, "ja": ja, "da-DK": daDK, "sr": sr, From edfaacbb5f07232eca182136e13d08838d12feba Mon Sep 17 00:00:00 2001 From: Ponkhy Date: Tue, 7 Sep 2021 02:24:02 +0200 Subject: [PATCH 12/25] Added component HiddenInput.vue --- src/components/HiddenInput.vue | 59 ++++++++++++++++++++++++++++++++++ src/icon.js | 4 +-- 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/components/HiddenInput.vue diff --git a/src/components/HiddenInput.vue b/src/components/HiddenInput.vue new file mode 100644 index 000000000..5b2b77aec --- /dev/null +++ b/src/components/HiddenInput.vue @@ -0,0 +1,59 @@ + + + diff --git a/src/icon.js b/src/icon.js index 960fa8c18..58583f0f8 100644 --- a/src/icon.js +++ b/src/icon.js @@ -1,10 +1,10 @@ import { library } from "@fortawesome/fontawesome-svg-core" -import { faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp } from "@fortawesome/free-solid-svg-icons" +import { faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp, faEye, faEyeSlash } from "@fortawesome/free-solid-svg-icons" //import { fa } from '@fortawesome/free-regular-svg-icons' import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome" // Add Free Font Awesome Icons here // https://fontawesome.com/v5.15/icons?d=gallery&p=2&s=solid&m=free -library.add(faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp); +library.add(faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp, faEye, faEyeSlash); export { FontAwesomeIcon } From 848296b77a0877dd71c2b06f1e5fa07dd5f1f6d1 Mon Sep 17 00:00:00 2001 From: Ponkhy Date: Tue, 7 Sep 2021 02:30:53 +0200 Subject: [PATCH 13/25] Changed input for sensitive data to HiddenInput --- src/components/NotificationDialog.vue | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 2fdb8fe18..8a79dba58 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -40,7 +40,7 @@