mirror of
				https://gitlab.com/MrFry/mrfrys-node-server
				synced 2025-04-01 20:24:18 +02:00 
			
		
		
		
	Server stat fixes
This commit is contained in:
		@@ -29,9 +29,12 @@ const coloredWords = {
 | 
			
		||||
    'possibleAnswers',
 | 
			
		||||
    'irc',
 | 
			
		||||
    'faq',
 | 
			
		||||
    '/script'
 | 
			
		||||
    '/script',
 | 
			
		||||
    'listUserDir',
 | 
			
		||||
    'forumEntries',
 | 
			
		||||
    'contacts.json',
 | 
			
		||||
  ],
 | 
			
		||||
  blue: ['isadding', 'ask'],
 | 
			
		||||
  blue: ['isadding', 'ask', 'newUserDir', 'updateQuestion', 'uploadUserFile'],
 | 
			
		||||
  magenta: [
 | 
			
		||||
    'addPost',
 | 
			
		||||
    'tiszai',
 | 
			
		||||
@@ -60,7 +63,8 @@ const filterFromDailyStats = [
 | 
			
		||||
  '/f/',
 | 
			
		||||
  '.git',
 | 
			
		||||
  'apple-touch-icon',
 | 
			
		||||
  '/.env'
 | 
			
		||||
  '/.env',
 | 
			
		||||
  '/userFiles/'
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
// -----------------------------------------------------------------
 | 
			
		||||
@@ -176,19 +180,22 @@ function getLetterNTimes(letter, number) {
 | 
			
		||||
function pCols(cols, rowTitles, colorNames, firstRowColor, showDiff) {
 | 
			
		||||
  // console.log(cols)
 | 
			
		||||
  let maxLength = 0
 | 
			
		||||
  Object.keys(cols).forEach((key) => {
 | 
			
		||||
    if (cols[key].length > maxLength) {
 | 
			
		||||
      maxLength = cols[key].length
 | 
			
		||||
  cols.forEach((col) => {
 | 
			
		||||
    if (col.length > maxLength) {
 | 
			
		||||
      maxLength = col.length
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  cols.reverse()
 | 
			
		||||
 | 
			
		||||
  for (let i = 0; i < maxLength; i++) {
 | 
			
		||||
    const row = []
 | 
			
		||||
    const lastItems = []
 | 
			
		||||
    Object.keys(cols)
 | 
			
		||||
      .reverse()
 | 
			
		||||
      .forEach((key) => {
 | 
			
		||||
        const val = cols[key]
 | 
			
		||||
 | 
			
		||||
    cols
 | 
			
		||||
      .forEach((val) => {
 | 
			
		||||
        if (!val[i]) {
 | 
			
		||||
          row.push(getLetterNTimes(' ', maxStatLength + 5))
 | 
			
		||||
          return
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -277,11 +284,34 @@ function preProcessDailyStats(obj) {
 | 
			
		||||
      return key.toLowerCase().includes(keyword.toLowerCase())
 | 
			
		||||
    })
 | 
			
		||||
    if (!includes) {
 | 
			
		||||
      acc.push({ name: key, val: obj[key] })
 | 
			
		||||
      acc.push({ name: key.replace(/\.html/g, ''), val: obj[key] })
 | 
			
		||||
    }
 | 
			
		||||
    return acc
 | 
			
		||||
  }, [])
 | 
			
		||||
  return formatted.sort((a, b) => {
 | 
			
		||||
 | 
			
		||||
  const merged = formatted.reduce((acc, x) => {
 | 
			
		||||
    const index = acc.findIndex((y) => {
 | 
			
		||||
      return x.name === y.name
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    if (index !== -1) {
 | 
			
		||||
      acc = acc.map((z, i) => {
 | 
			
		||||
        if (i === index) {
 | 
			
		||||
          return {
 | 
			
		||||
            ...x,
 | 
			
		||||
            val: z.val + x.val
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        return z
 | 
			
		||||
      })
 | 
			
		||||
    } else {
 | 
			
		||||
      acc.push(x)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return acc
 | 
			
		||||
  }, [])
 | 
			
		||||
 | 
			
		||||
  return merged.sort((a, b) => {
 | 
			
		||||
    if (a.name > b.name) {
 | 
			
		||||
      return 1
 | 
			
		||||
    } else if (a.name < b.name) {
 | 
			
		||||
 
 | 
			
		||||
 Submodule submodules/qmining-page updated: c16015a339...5d233f549d
									
								
							
		Reference in New Issue
	
	Block a user