Server stat fixes

This commit is contained in:
mrfry 2021-05-09 09:46:12 +02:00
parent 7e6ddd1e79
commit 5c69b07f05

View file

@ -5,7 +5,7 @@
const cols = process.stdout.columns const cols = process.stdout.columns
// const rows = process.stdout.rows // const rows = process.stdout.rows
const maxStatLength = Math.floor(cols / 4) const maxStatLength = Math.floor(cols / 4)
const statNameSpacing = 5 const statNameSpacing = 4
const beforeRowSpace = 13 const beforeRowSpace = 13
const coloredWords = { const coloredWords = {
red: ['lred', 'thanks'], red: ['lred', 'thanks'],
@ -64,7 +64,10 @@ const filterFromDailyStats = [
'.git', '.git',
'apple-touch-icon', 'apple-touch-icon',
'/.env', '/.env',
'/userFiles/' '/userFiles/',
'.min.js',
'.xml',
'.aspx',
] ]
// ----------------------------------------------------------------- // -----------------------------------------------------------------
@ -195,7 +198,7 @@ function pCols(cols, rowTitles, colorNames, firstRowColor, showDiff) {
cols cols
.forEach((val) => { .forEach((val) => {
if (!val[i]) { if (!val[i]) {
row.push(getLetterNTimes(' ', maxStatLength + 5)) row.push(getLetterNTimes(' ', maxStatLength + statNameSpacing + 2))
return return
} }
@ -228,7 +231,7 @@ function pCols(cols, rowTitles, colorNames, firstRowColor, showDiff) {
} }
let ammount = val[i].val ? val[i].val.toString() : '' let ammount = val[i].val ? val[i].val.toString() : ''
while (ammount.length < 4) { while (ammount.length < 5) {
ammount = ammount + ' ' ammount = ammount + ' '
} }
@ -373,20 +376,20 @@ pCols(
[ [
'Today', 'Today',
preProcessUIdTestSolving(clientIdTestSolving[getDayIndex()]), preProcessUIdTestSolving(clientIdTestSolving[getDayIndex()]),
preProcessUIdTestSolving(clientIdTestSolving[getDayIndex()], 2), preProcessUIdTestSolving(clientIdTestSolving[getDayIndex()], 5),
], ],
[ [
'Yesterday', 'Yesterday',
preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(-1)]), preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(-1)]),
preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(-1)], 2), preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(-1)], 5),
], ],
[ [
'Before Yesterday', 'Before Yesterday',
preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(-2)]), preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(-2)]),
preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(-2)], 2), preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(-2)], 5),
], ],
], ],
['', 'All', 'More than 2'], ['', 'All', 'More than 5'],
false, false,
'green' 'green'
) )