mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-30 14:36:19 +02:00
Finally implement "Total Calls Today" MCI: TT
+ Add findSystemLogEntries() to StatLog amongst others
This commit is contained in:
parent
ec97b3e8d4
commit
f471fd0ebe
9 changed files with 121 additions and 43 deletions
17
core/bbs.js
17
core/bbs.js
|
@ -12,6 +12,7 @@ const database = require('./database.js');
|
|||
const resolvePath = require('./misc_util.js').resolvePath;
|
||||
const UserProps = require('./user_property.js');
|
||||
const SysProps = require('./system_property.js');
|
||||
const SysLogKeys = require('./system_log.js');
|
||||
|
||||
// deps
|
||||
const async = require('async');
|
||||
|
@ -20,6 +21,7 @@ const _ = require('lodash');
|
|||
const mkdirs = require('fs-extra').mkdirs;
|
||||
const fs = require('graceful-fs');
|
||||
const paths = require('path');
|
||||
const moment = require('moment');
|
||||
|
||||
// our main entry point
|
||||
exports.main = main;
|
||||
|
@ -272,6 +274,21 @@ function initialize(cb) {
|
|||
return callback(null);
|
||||
});
|
||||
},
|
||||
function initCallsToday(callback) {
|
||||
const StatLog = require('./stat_log.js');
|
||||
const filter = {
|
||||
logName : SysLogKeys.UserLoginHistory,
|
||||
resultType : 'count',
|
||||
date : moment(),
|
||||
};
|
||||
|
||||
StatLog.findSystemLogEntries(filter, (err, callsToday) => {
|
||||
if(!err) {
|
||||
StatLog.setNonPersistentSystemStat(SysProps.LoginsToday, callsToday);
|
||||
}
|
||||
return callback(null);
|
||||
});
|
||||
},
|
||||
function initMCI(callback) {
|
||||
return require('./predefined_mci.js').init(callback);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue