mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
closes #2986
This commit is contained in:
@@ -130,7 +130,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.monthly-pageviews {
|
.monthly-pageviews {
|
||||||
width:50%;
|
width:33%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.motd textarea {
|
.motd textarea {
|
||||||
|
|||||||
@@ -338,8 +338,10 @@ define('admin/general/dashboard', ['semver'], function(semver) {
|
|||||||
|
|
||||||
$('#pageViewsThisMonth').html(data.monthlyPageViews.thisMonth);
|
$('#pageViewsThisMonth').html(data.monthlyPageViews.thisMonth);
|
||||||
$('#pageViewsLastMonth').html(data.monthlyPageViews.lastMonth);
|
$('#pageViewsLastMonth').html(data.monthlyPageViews.lastMonth);
|
||||||
|
$('#pageViewsPastDay').html(data.pastDay);
|
||||||
utils.addCommasToNumbers($('#pageViewsThisMonth'));
|
utils.addCommasToNumbers($('#pageViewsThisMonth'));
|
||||||
utils.addCommasToNumbers($('#pageViewsLastMonth'));
|
utils.addCommasToNumbers($('#pageViewsLastMonth'));
|
||||||
|
utils.addCommasToNumbers($('#pageViewsPastDay'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -234,7 +234,10 @@ SocketAdmin.analytics.get = function(socket, data, callback) {
|
|||||||
monthlyPageViews: function(next) {
|
monthlyPageViews: function(next) {
|
||||||
getMonthlyPageViews(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 {
|
} else {
|
||||||
callback(new Error('Invalid analytics call'));
|
callback(new Error('Invalid analytics call'));
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
<div><strong id="pageViewsThisMonth"></strong></div>
|
<div><strong id="pageViewsThisMonth"></strong></div>
|
||||||
<div>Page views This Month</div>
|
<div>Page views This Month</div>
|
||||||
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user