mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
* Rework user.js and User object to ES6
* Update download stats for user when web download is completed
This commit is contained in:
parent
6406d32165
commit
058ff3f367
14 changed files with 569 additions and 516 deletions
|
@ -5,9 +5,7 @@
|
|||
const MenuModule = require('../core/menu_module.js').MenuModule;
|
||||
const ViewController = require('../core/view_controller.js').ViewController;
|
||||
const StatLog = require('../core/stat_log.js');
|
||||
const getUserName = require('../core/user.js').getUserName;
|
||||
const loadProperties = require('../core/user.js').loadProperties;
|
||||
const isRootUserId = require('../core/user.js').isRootUserId;
|
||||
const User = require('../core/user.js');
|
||||
const stringFormat = require('../core/string_format.js');
|
||||
|
||||
// deps
|
||||
|
@ -73,7 +71,7 @@ exports.getModule = class LastCallersModule extends MenuModule {
|
|||
|
||||
if(self.menuConfig.config.hideSysOpLogin) {
|
||||
const noOpLoginHistory = loginHistory.filter(lh => {
|
||||
return false === isRootUserId(parseInt(lh.log_value)); // log_value=userId
|
||||
return false === User.isRootUserId(parseInt(lh.log_value)); // log_value=userId
|
||||
});
|
||||
|
||||
//
|
||||
|
@ -106,11 +104,10 @@ exports.getModule = class LastCallersModule extends MenuModule {
|
|||
item.userId = parseInt(item.log_value);
|
||||
item.ts = moment(item.timestamp).format(dateTimeFormat);
|
||||
|
||||
getUserName(item.userId, (err, userName) => {
|
||||
item.userName = userName;
|
||||
getPropOpts.userId = item.userId;
|
||||
User.getUserName(item.userId, (err, userName) => {
|
||||
item.userName = userName;
|
||||
|
||||
loadProperties(getPropOpts, (err, props) => {
|
||||
User.loadProperties(item.userId, getPropOpts, (err, props) => {
|
||||
if(!err) {
|
||||
item.location = props.location;
|
||||
item.affiliation = item.affils = props.affiliation;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue