mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
adding hostname to stats, changed data backup directory
This commit is contained in:
@@ -32,7 +32,7 @@ module.exports = function (options) {
|
|||||||
|
|
||||||
logger.LogReq(req, true, res.statusCode)
|
logger.LogReq(req, true, res.statusCode)
|
||||||
if (toLog) { logger.LogReq(req) }
|
if (toLog) { logger.LogReq(req) }
|
||||||
if (res.statusCode !== 404) { logger.LogStat(req.url, ip) }
|
if (res.statusCode !== 404) { logger.LogStat(req.url, ip, hostname) }
|
||||||
})
|
})
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
|
@@ -541,7 +541,7 @@ function GetApp () {
|
|||||||
utils.AppendToFile(utils.GetDateString() + '\n' + JSON.stringify(user) + '\n' + JSON.stringify(editedQuestions) + '\n\n', dataEditsLog)
|
utils.AppendToFile(utils.GetDateString() + '\n' + JSON.stringify(user) + '\n' + JSON.stringify(editedQuestions) + '\n\n', dataEditsLog)
|
||||||
|
|
||||||
// making backup
|
// making backup
|
||||||
utils.CopyFile('./' + dataFile, `./public/backs/data_before_${user.name}_${utils.GetDateString().replace(/ /g, '_')}`)
|
utils.CopyFile('./' + dataFile, `./qminingPublic/backs/data_before_${user.name}_${utils.GetDateString().replace(/ /g, '_')}`) // TODO: rewrite to dinamyc public!!!
|
||||||
logger.Log('Backup made')
|
logger.Log('Backup made')
|
||||||
// writing data
|
// writing data
|
||||||
utils.WriteFile(JSON.stringify(newData), dataFile)
|
utils.WriteFile(JSON.stringify(newData), dataFile)
|
||||||
|
Submodule modules/dataEditor/qmining-data-editor updated: 25b9f72093...6bc51fb387
Submodule qminingPublic/moodle-test-userscript updated: 2c815c8d20...f8d4bf2a41
@@ -191,7 +191,7 @@ function Load () {
|
|||||||
setNoLogReadInterval()
|
setNoLogReadInterval()
|
||||||
}
|
}
|
||||||
|
|
||||||
function LogStat (url, ip) {
|
function LogStat (url, ip, hostname) {
|
||||||
let nolog = noLogips.some((x) => {
|
let nolog = noLogips.some((x) => {
|
||||||
return x.includes(ip)
|
return x.includes(ip)
|
||||||
})
|
})
|
||||||
@@ -199,7 +199,7 @@ function LogStat (url, ip) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
url = url.split('?')[0]
|
url = hostname + url.split('?')[0]
|
||||||
Inc(url)
|
Inc(url)
|
||||||
AddVisitStat(url)
|
AddVisitStat(url)
|
||||||
Save()
|
Save()
|
||||||
|
Reference in New Issue
Block a user