From 22577917da9f3727101ca3a7e6dd20d5914e10b3 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 16 Sep 2014 10:37:10 -0400 Subject: [PATCH] closes https://github.com/NodeBB/NodeBB/issues/2093 --- src/controllers/admin.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/controllers/admin.js b/src/controllers/admin.js index 13b0bfde7b..241afa9699 100644 --- a/src/controllers/admin.js +++ b/src/controllers/admin.js @@ -38,6 +38,9 @@ adminController.home = function(req, res, next) { stats: function(next) { getStats(next); }, + pageviews: function(next) { + getPageviews(next); + }, notices: function(next) { var notices = [ {done: !meta.restartRequired, doneText: 'Restart not required', notDoneText:'Restart required'}, @@ -53,11 +56,24 @@ adminController.home = function(req, res, next) { res.render('admin/index', { version: pkg.version, notices: results.notices, - stats: results.stats + stats: results.stats, + pageviews: results.pageviews }); }); }; +function getPageviews(callback) { + async.parallel({ + monthly: function(next) { + db.get('pageviews:monthly', next); + }, + daily: function(next) { + db.get('pageviews:daily', next); + } + }, function(err, results) { + callback(null, results); + }); +} function getStats(callback) { async.parallel([ function(next) {