diff --git a/scripts/serverStats.js b/scripts/serverStats.js index 5f217c7..231d042 100644 --- a/scripts/serverStats.js +++ b/scripts/serverStats.js @@ -4,11 +4,16 @@ const cols = process.stdout.columns // const rows = process.stdout.rows -const maxStatLength = Math.floor(cols / 4) +const colWidth = 40 +const maxStatLength = colWidth // Math.floor(cols / 4) const statNameSpacing = 4 const beforeRowSpace = 13 +const rowsToPrint = Math.floor(cols / (colWidth + statNameSpacing + beforeRowSpace / 3 + 5)) || 1 const coloredWords = { - red: ['lred', 'thanks'], + red: [ + 'lred', + 'thanks' + ], cyan: [ 'getveteranpw', 'pwrequest', @@ -27,25 +32,31 @@ const coloredWords = { 'ranklist', 'allqr', 'possibleAnswers', - 'irc', 'faq', '/script', 'listUserDir', 'forumEntries', 'contacts.json', + 'patreon', + 'donate', + 'userfiles' ], - blue: ['isadding', 'ask', 'newUserDir', 'updateQuestion', 'uploadUserFile'], - magenta: [ - 'addPost', - 'tiszai', - 'install', - 'discord', - 'postfeedback', + blue: [ + 'isadding', + 'react', + 'ask', + 'newUserDir', + 'updateQuestion', + 'uploadUserFile', 'votetodo', 'registerscript', - 'quickvote', + 'install', + ], + magenta: [ + 'addPost', 'comment', - 'react' + 'postfeedback', + 'quickvote', ], } const filterFromDailyStats = [ @@ -68,6 +79,7 @@ const filterFromDailyStats = [ '.min.js', '.xml', '.aspx', + '/questionDbs/', ] // ----------------------------------------------------------------- @@ -180,10 +192,13 @@ function getLetterNTimes(letter, number) { return res } -function pCols(cols, rowTitles, colorNames, firstRowColor, showDiff) { +function pCols(cols, rowTitles, colorNames, firstRowColor) { // console.log(cols) let maxLength = 0 - cols.forEach((col) => { + cols.reverse().forEach((col, i) => { + if (i >= rowsToPrint) { + return + } if (col.length > maxLength) { maxLength = col.length } @@ -193,16 +208,17 @@ function pCols(cols, rowTitles, colorNames, firstRowColor, showDiff) { for (let i = 0; i < maxLength; i++) { const row = [] - const lastItems = [] cols - .forEach((val) => { + .forEach((val, colIndex) => { + if (colIndex >= rowsToPrint) { + return + } if (!val[i]) { row.push(getLetterNTimes(' ', maxStatLength + statNameSpacing + 2)) return } - lastItems.push(val[i]) const keyName = val[i].name || val[i] let slicedName = keyName.slice(0, maxStatLength) @@ -264,15 +280,6 @@ function pCols(cols, rowTitles, colorNames, firstRowColor, showDiff) { res = currRowTitle + row.join(getLetterNTimes(' ', statNameSpacing)) } // SHOW DIFF --------------------------------------------------- - if (showDiff && i !== 0) { - let diff = - lastItems[lastItems.length - 1] - lastItems[lastItems.length - 2] - if (diff > 0) { - diff = '+' + diff.toString() - } - res += C('blue') + diff + C() - } - console.log(res) } } @@ -412,7 +419,7 @@ function printLastDataCount(data) { res[i].push(dataCount.questionCount.toString()) }) - pCols(res, ['', 'Users', 'Subjects', 'Questions'], false, 'green', true) + pCols(res, ['', 'Users', 'Subjects', 'Questions'], false, 'green') } // ------------------------------------------------------------------------------ printHeader('Daily script install / update check count') diff --git a/src/modules.json b/src/modules.json index 479ca8f..3f3e5e5 100644 --- a/src/modules.json +++ b/src/modules.json @@ -44,25 +44,5 @@ "frylabs.net", "www.frylabs.net" ] - }, - "sio": { - "path": "./modules/sio/sio.js", - "publicdirs": [ - "publicDirs/sioPublic/" - ], - "name": "sio", - "urls": [ - "sio.frylabs.net" - ] - }, - "stuff": { - "path": "./modules/stuff/stuff.js", - "publicdirs": [ - "publicDirs/stuffPublic/" - ], - "name": "stuff", - "urls": [ - "stuff.frylabs.net" - ] } } diff --git a/src/sharedViews/login.ejs b/src/sharedViews/login.ejs index 7bc058d..c679ff6 100644 --- a/src/sharedViews/login.ejs +++ b/src/sharedViews/login.ejs @@ -47,7 +47,7 @@ font-size: 16px; color: white; background-color: #181a1b; - width: 300px;; + width: 360px;; padding: 12px 20px; margin: 8px 0; box-sizing: border-box; @@ -91,7 +91,7 @@