mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
closes #2986
This commit is contained in:
@@ -130,7 +130,7 @@
|
||||
}
|
||||
|
||||
.monthly-pageviews {
|
||||
width:50%;
|
||||
width:33%;
|
||||
}
|
||||
|
||||
.motd textarea {
|
||||
|
||||
@@ -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'));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user