Add Who's Online mod

This commit is contained in:
Bryan Ashby 2015-11-25 18:03:47 -07:00
parent e475bacdf8
commit 15cf37c55c
7 changed files with 22 additions and 6 deletions

View File

@ -11,7 +11,7 @@ var clientConnections = [];
exports.clientConnections = clientConnections; exports.clientConnections = clientConnections;
function getActiveConnections() { function getActiveConnections() {
return clientConnections.length; return clientConnections;
} }
function addNewClient(client, clientSock) { function addNewClient(client, clientSock) {

View File

@ -105,7 +105,7 @@ function getPredefinedMCIValue(client, code) {
// :TODO: cpu load average (over N seconds): http://stackoverflow.com/questions/9565912/convert-the-output-of-os-cpus-in-node-js-to-percentage // :TODO: cpu load average (over N seconds): http://stackoverflow.com/questions/9565912/convert-the-output-of-os-cpus-in-node-js-to-percentage
// :TODO: Node version/info // :TODO: Node version/info
AN : function activeNodes() { return clientConnections.getActiveConnections().toString(); }, AN : function activeNodes() { return clientConnections.getActiveConnections().length.toString(); },
TC : function totalCalls() { return sysProp.getSystemProperty('login_count').toString(); }, TC : function totalCalls() { return sysProp.getSystemProperty('login_count').toString(); },

View File

@ -5,7 +5,6 @@ var MenuModule = require('../core/menu_module.js').MenuModule;
var userDb = require('../core/database.js').dbs.user; var userDb = require('../core/database.js').dbs.user;
var ViewController = require('../core/view_controller.js').ViewController; var ViewController = require('../core/view_controller.js').ViewController;
var getSystemLoginHistory = require('../core/stats.js').getSystemLoginHistory; var getSystemLoginHistory = require('../core/stats.js').getSystemLoginHistory;
var colorCodes = require('../core/color_codes.js');
var moment = require('moment'); var moment = require('moment');
var async = require('async'); var async = require('async');
@ -89,8 +88,6 @@ LastCallersModule.prototype.mciReady = function(mciData, cb) {
}); });
}, },
function populateList(callback) { function populateList(callback) {
var callersView = vc.getView(MciCodeIds.CallerList);
var listFormat = self.menuConfig.config.listFormat || '{userName} - {location} - {affils} - {ts}'; var listFormat = self.menuConfig.config.listFormat || '{userName} - {location} - {affils} - {ts}';
var dateTimeFormat = self.menuConfig.config.dateTimeFormat || 'ddd MMM DD'; var dateTimeFormat = self.menuConfig.config.dateTimeFormat || 'ddd MMM DD';
@ -118,4 +115,4 @@ LastCallersModule.prototype.mciReady = function(mciData, cb) {
cb(err); cb(err);
} }
); );
} };

View File

@ -484,6 +484,10 @@
value: { command: "L" } value: { command: "L" }
action: @menu:mainMenuLastCallers action: @menu:mainMenuLastCallers
} }
{
value: { command: "W" }
action: @menu:mainMenuWhosOnline
}
{ {
value: { command: "Y" } value: { command: "Y" }
action: @menu:mainMenuUserStats action: @menu:mainMenuUserStats
@ -512,6 +516,12 @@
art: LASTCALL art: LASTCALL
options: { pause: true } options: { pause: true }
} }
mainMenuWhosOnline: {
desc: Who's Online
module: whos_online
art: WHOSON
options: { pause: true }
}
mainMenuUserStats: { mainMenuUserStats: {
desc: User Stats desc: User Stats
art: STATUS art: STATUS

Binary file not shown.

View File

@ -133,6 +133,15 @@
} }
} }
mainMenuWhosOnline: {
config: {
listFormat: "|00|01|36{node:<6.6}{userName:<17.17}{affils:<19.19}{action:<20.20}{timeOn:<8}"
}
mci: {
VM1: { height: 10 }
}
}
messageAreaMessageList: { messageAreaMessageList: {
config: { config: {
listFormat: "|00|01|37{msgNum:>4} |00|37- |36{subj:<29.29} {from:<20.20} {ts} |01|31{newIndicator}" listFormat: "|00|01|37{msgNum:>4} |00|37- |36{subj:<29.29} {from:<20.20} {ts} |01|31{newIndicator}"