From 9ad8e5f56a6e544fca4c13086556ed7db73c3775 Mon Sep 17 00:00:00 2001 From: Andreas Brett Date: Fri, 22 Oct 2021 13:05:52 +0200 Subject: [PATCH 01/62] show logged in user --- server/server.js | 21 +++++++++++++++++++++ src/languages/de-DE.js | 1 + src/languages/en.js | 1 + src/pages/Settings.vue | 8 ++++++++ 4 files changed, 31 insertions(+) diff --git a/server/server.js b/server/server.js index c4d18869e..9b670b767 100644 --- a/server/server.js +++ b/server/server.js @@ -865,6 +865,27 @@ exports.entryPage = "dashboard"; } }); + socket.on("getUsername", async (callback) => { + try { + checkLogin(socket); + + let user = await R.findOne("user", " id = ? AND active = 1 ", [ + socket.userID, + ]); + + callback({ + ok: true, + data: user.username, + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + socket.on("getSettings", async (callback) => { try { checkLogin(socket); diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index 5e69899d8..0e47701e1 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -197,4 +197,5 @@ export default { pushbullet: "Pushbullet", line: "Line Messenger", mattermost: "Mattermost", + "Current User": "Aktueller Benutzer", }; diff --git a/src/languages/en.js b/src/languages/en.js index 4542d72b2..bb8d96357 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -305,4 +305,5 @@ export default { "One record": "One record", "Showing {from} to {to} of {count} records": "Showing {from} to {to} of {count} records", steamApiKeyDescription: "For monitoring a Steam Gameserver you need a steam Web-API key. You can register your api key here: ", + "Current User": "Current User", }; diff --git a/src/pages/Settings.vue b/src/pages/Settings.vue index dc0198531..292098107 100644 --- a/src/pages/Settings.vue +++ b/src/pages/Settings.vue @@ -149,6 +149,7 @@ - @@ -217,7 +237,7 @@ export default { } .period-options { - padding: 0.3em 1.5em; + padding: 0.3em 2.2em; margin-bottom: -1.5em; float: right; position: relative; From 445674aacb0c58ca5eb96dc2c7c033a4d70c8670 Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Fri, 22 Oct 2021 18:44:11 +0800 Subject: [PATCH 11/62] Chore: Improve code formatting & comments --- src/components/PingChart.vue | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/components/PingChart.vue b/src/components/PingChart.vue index 0c76721cf..cd5e239c2 100644 --- a/src/components/PingChart.vue +++ b/src/components/PingChart.vue @@ -1,7 +1,12 @@