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