mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 05:55:48 +01:00
allow realtime updates of the traffic graph in ACP
This commit is contained in:
@@ -17,6 +17,7 @@ var async = require('async'),
|
||||
events = require('../events'),
|
||||
emailer = require('../emailer'),
|
||||
db = require('../database'),
|
||||
analytics = require('../analytics'),
|
||||
index = require('./index'),
|
||||
|
||||
|
||||
@@ -236,6 +237,7 @@ SocketAdmin.analytics.get = function(socket, data, callback) {
|
||||
}
|
||||
}, function(err, data) {
|
||||
data.pastDay = data.pageviews.reduce(function(a, b) {return parseInt(a, 10) + parseInt(b, 10);});
|
||||
data.pageviews[data.pageviews.length - 1] = parseInt(data.pageviews[data.pageviews.length - 1], 10) + analytics.getUnwrittenPageviews();
|
||||
callback(err, data);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user