var pages = function(dbot) { var connections = dbot.instance.connections; return { '/connections': function(req, res) { var connections = Object.keys(dbot.instance.connections); res.render('connections', { 'name': dbot.config.name, 'connections': connections }); }, '/channels/:connection': function(req, res) { var connection = req.params.connection; if(dbot.instance.connections.hasOwnProperty(connection)) { var channels = Object.keys(dbot.instance.connections[connection].channels); res.render('channels', { 'name': dbot.config.name, 'connection': connection, 'channels': channels}); } else { res.render_core('error', { 'name': dbot.config.name, 'message': 'No such connection.' }); } }, '/users/:connection/:channel': function(req, res) { var connection = req.params.connection; var channel = '#' + req.params.channel; var connections = dbot.instance.connections; if(connections.hasOwnProperty(connection) && connections[connection].channels.hasOwnProperty(channel)) { var channelUsers = dbot.db.knownUsers[connection].channelUsers[channel]; var usersData = {}; for(var i=0;i