Node.js based forum software built for the modern web
closes #2986
psychobunny5c59aa77374b
diff --git a/public/less/admin/general/dashboard.less b/public/less/admin/general/dashboard.lessindex 71c2298d31..8cfad65459 100644--- a/public/less/admin/general/dashboard.less+++ b/public/less/admin/general/dashboard.less@@ -130,7 +130,7 @@}.monthly-pageviews {- width:50%;+ width:33%;}.motd textarea {diff --git a/public/src/admin/general/dashboard.js b/public/src/admin/general/dashboard.jsindex a842c0d2af..513ee745c1 100644--- a/public/src/admin/general/dashboard.js+++ b/public/src/admin/general/dashboard.js@@ -338,8 +338,10 @@ define('admin/general/dashboard', ['semver'], function(semver) {$('#pageViewsThisMonth').html(data.monthlyPageViews.thisMonth);$('#pageViewsLastMonth').html(data.monthlyPageViews.lastMonth);+ $('#pageViewsPastDay').html(data.pastDay);utils.addCommasToNumbers($('#pageViewsThisMonth'));utils.addCommasToNumbers($('#pageViewsLastMonth'));+ utils.addCommasToNumbers($('#pageViewsPastDay'));});}diff --git a/src/socket.io/admin.js b/src/socket.io/admin.jsindex ecf63997e5..937f5637f6 100644--- a/src/socket.io/admin.js+++ b/src/socket.io/admin.js@@ -234,7 +234,10 @@ SocketAdmin.analytics.get = function(socket, data, callback) {monthlyPageViews: function(next) {getMonthlyPageViews(next);}- }, callback);+ }, function(err, data) {+ data.pastDay = data.pageviews.reduce(function(a, b) {return parseInt(a, 10) + parseInt(b, 10);});+ callback(err, data);+ });}} else {callback(new Error('Invalid analytics call'));diff --git a/src/views/admin/general/dashboard.tpl b/src/views/admin/general/dashboard.tplindex db18b7cf02..af94ab2f19 100644--- a/src/views/admin/general/dashboard.tpl+++ b/src/views/admin/general/dashboard.tpl@@ -19,6 +19,10 @@<div><strong id="pageViewsThisMonth"></strong></div><div>Page views This Month</div></div>+ <div class="text-center pull-left monthly-pageviews">+ <div><strong id="pageViewsPastDay"></strong></div>+ <div>Page views in last 24 hours</div>+ </div></div></div>