diff --git a/scripts/serverStats.js b/scripts/serverStats.js index 858e9c3..68cd387 100644 --- a/scripts/serverStats.js +++ b/scripts/serverStats.js @@ -195,7 +195,9 @@ function getDayName(day) { case -2: return 'Before yesterday' default: - return `Day ${d.toString()}` + const now = new Date() + now.setDate(now.getDate() + d); + return now.toDateString() } } @@ -266,7 +268,7 @@ function pCols(cols, rowTitles, colorNames, firstRowColor) { slicedName = slicedName + sep } - let ammount = val[i].val ? val[i].val.toString() : '' + let ammount = val[i].val ? val[i].val.toLocaleString() : '' while (ammount.length < 5) { ammount = ammount + ' ' } @@ -446,9 +448,9 @@ try { return [getDayName(-x)] }) data.forEach((dataCount, i) => { - res[i].push(dataCount.userCount.toString()) - res[i].push(dataCount.subjectCount.toString()) - res[i].push(dataCount.questionCount.toString()) + res[i].push(dataCount.userCount.toLocaleString()) + res[i].push(dataCount.subjectCount.toLocaleString()) + res[i].push(dataCount.questionCount.toLocaleString()) }) pCols(res, ['', 'Users', 'Subjects', 'Questions'], false, 'green') @@ -470,8 +472,8 @@ try { } return [ getDayName(day), - countLinesMatching(log, '?install').toString(), - countLinesMatching(log, '?up').toString(), + countLinesMatching(log, '?install').toLocaleString(), + countLinesMatching(log, '?up').toLocaleString(), ] } diff --git a/src/modules/api/submodules/chat.ts b/src/modules/api/submodules/chat.ts index a244bd8..47e6140 100644 --- a/src/modules/api/submodules/chat.ts +++ b/src/modules/api/submodules/chat.ts @@ -148,6 +148,9 @@ function setup(data: SubmoduleData): void { socket.on('chat message', (message) => { const { reciever, msg, type } = message + if (!reciever || !msg || !type) { + return + } const recieverUser = dbtools.Select(userDB, 'users', { id: reciever, })[0] diff --git a/src/modules/main/views/main.ejs b/src/modules/main/views/main.ejs index 3ab5d0d..5d2af9b 100755 --- a/src/modules/main/views/main.ejs +++ b/src/modules/main/views/main.ejs @@ -1,41 +1,39 @@ +
+ +- ____ __ __ - / __/_____ __ / /__ _/ / ___ - / _// __/ // / / / _ `/ _ \(_-< -/_/ /_/ \_, / /_/\_,_/_.__/___/ - /___/ -- -
/$$$$$$$$ /$$ /$$ /$$ +| $$_____/ | $$ | $$ | $$ +| $$ /$$$$$$ /$$ /$$| $$ /$$$$$$ | $$$$$$$ /$$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$ +| $$$$$ /$$__ $$| $$ | $$| $$ |____ $$| $$__ $$ /$$_____/ | $$__ $$ /$$__ $$|_ $$_/ +| $$__/| $$ \__/| $$ | $$| $$ /$$$$$$$| $$ \ $$| $$$$$$ | $$ \ $$| $$$$$$$$ | $$ +| $$ | $$ | $$ | $$| $$ /$$__ $$| $$ | $$ \____ $$ | $$ | $$| $$_____/ | $$ /$$ +| $$ | $$ | $$$$$$$| $$| $$$$$$$| $$$$$$$/ /$$$$$$$//$$| $$ | $$| $$$$$$$ | $$$$/ +|__/ |__/ \____ $$|__/ \_______/|_______/ |_______/|__/|__/ |__/ \_______/ \___/ + /$$ | $$ + | $$$$$$/ + \______/+