mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Added some colors
This commit is contained in:
parent
d6edfa15e1
commit
e55c7beb37
3 changed files with 15 additions and 5 deletions
14
actions.js
14
actions.js
|
@ -44,12 +44,12 @@ function Process(d, file) {
|
||||||
var oldRes = CheckData(oldFile);
|
var oldRes = CheckData(oldFile);
|
||||||
|
|
||||||
if (newRes.count > 0)
|
if (newRes.count > 0)
|
||||||
logger.Log("[NLOD]: new file result: " + newRes.count);
|
logger.Log("[NLOD]: new file result: " + newRes.count, logger.GetColor("blue"));
|
||||||
else
|
else
|
||||||
logger.Log("[NLOD]: new file NLOD error, " + newRes.log, logger.GetColor("redbg"), true);
|
logger.Log("[NLOD]: new file NLOD error, " + newRes.log, logger.GetColor("redbg"), true);
|
||||||
|
|
||||||
if (oldRes.count > 0)
|
if (oldRes.count > 0)
|
||||||
logger.Log("[NLOD]: old public result: " + oldRes.count);
|
logger.Log("[NLOD]: old public result: " + oldRes.count, logger.GetColor("blue"));
|
||||||
else
|
else
|
||||||
logger.Log("[NLOD]: old public NLOD error, " + oldRes.log, logger.GetColor("redbg"), true);
|
logger.Log("[NLOD]: old public NLOD error, " + oldRes.log, logger.GetColor("redbg"), true);
|
||||||
|
|
||||||
|
@ -60,11 +60,13 @@ function Process(d, file) {
|
||||||
} else
|
} else
|
||||||
logger.Log("[PCES]: No new data.");
|
logger.Log("[PCES]: No new data.");
|
||||||
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Beep();
|
Beep();
|
||||||
logger.Log("[ERR ]: Error at processing data! File: " + file, logger.GetColor("redbg"));
|
logger.Log("[ERR ]: Error at processing data! File: " + file, logger.GetColor("redbg"));
|
||||||
logger.Log(e.toString(), logger.GetColor("redbg"));
|
logger.Log(e.toString(), logger.GetColor("redbg"));
|
||||||
}
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ProcessIncomingRequest(data) {
|
function ProcessIncomingRequest(data) {
|
||||||
|
@ -93,6 +95,14 @@ function ProcessIncomingRequest(data) {
|
||||||
Process(d, publicFile);
|
Process(d, publicFile);
|
||||||
Process(d, staticFile);
|
Process(d, staticFile);
|
||||||
}*/
|
}*/
|
||||||
|
try {
|
||||||
|
var splitted = d.alldata.split("\n");
|
||||||
|
var count = 0;
|
||||||
|
for (var i = 0; i < splitted.length; i++)
|
||||||
|
if (splitted[i][0] == '?')
|
||||||
|
count ++;
|
||||||
|
logger.Log("[PCES]: Test all question count: " + count, logger.GetColor("blue"));
|
||||||
|
} catch (e) {console.log("Error :c"); console.log(e);}
|
||||||
var newPubItems = Process(d, publicFile);
|
var newPubItems = Process(d, publicFile);
|
||||||
var newStatItems = Process(d, staticFile);
|
var newStatItems = Process(d, staticFile);
|
||||||
|
|
||||||
|
|
|
@ -243,7 +243,7 @@ app.post('*', function(req, res) {
|
||||||
|
|
||||||
stat.Load();
|
stat.Load();
|
||||||
app.listen(port);
|
app.listen(port);
|
||||||
logger.Log("[START]: Server listening on port " + port + "...");
|
logger.Log("[START]: Server listening on port " + port + "...", logger.GetColor("yellow"));
|
||||||
|
|
||||||
function Log(req, toFile) {
|
function Log(req, toFile) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -21,9 +21,9 @@ greasyforkon</a>
|
||||||
|
|
|
|
||||||
<a href="http://questionmining.tk/manual">Manual</a>
|
<a href="http://questionmining.tk/manual">Manual</a>
|
||||||
|
|
|
|
||||||
<a href="https://questionmining.tk/servergit">Szerver repó</a>
|
<a href="http://questionmining.tk/servergit">Szerver repó</a>
|
||||||
|
|
|
|
||||||
<a href="https://questionmining.tk/scriptgit">Userscript repó</a>
|
<a href="http://questionmining.tk/scriptgit">Userscript repó</a>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue