mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
auth fixes
This commit is contained in:
parent
5fff6b9bba
commit
e4af391d04
5 changed files with 39 additions and 52 deletions
|
@ -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')
|
||||
|
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 @@
|
|||
</div>
|
||||
<div id='form'>
|
||||
<div class='inputContainer'>
|
||||
<input type='password' placeholder='Jelszó' onkeyup="PWKeyUp(this)" type='text' id='pw' name='pw' autocomplete="off" autofocus/>
|
||||
<input type='text' placeholder='Jelszó' onkeyup="PWKeyUp(this)" type='text' id='pw' name='pw' autocomplete="off" autofocus/>
|
||||
<input type='hidden' id='cid' name='pw' autocomplete="off"/>
|
||||
</div>
|
||||
<button id='sendButton' onclick="Login(this)">Belépés</button>
|
||||
|
@ -130,7 +130,7 @@
|
|||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
pw: document.getElementById('pw').value,
|
||||
pw: document.getElementById('pw').value.trim(),
|
||||
cid: document.getElementById('cid').value
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 27211c7bc83e0e930fabc430ffb5615b52523106
|
||||
Subproject commit d06e9900445ca8af4ee354244b056f24bb76bc0c
|
|
@ -1 +1 @@
|
|||
Subproject commit 602e16046e6600a405ae68814c11349fde745244
|
||||
Subproject commit 3a67f2a1aa8903c534719d62ddaa69701448be9a
|
Loading…
Add table
Add a link
Reference in a new issue