v1.18.x
psychobunny 10 years ago
parent 9c8395808c
commit e20747c191

@ -17,7 +17,9 @@ define('forum/admin/general/dashboard', ['semver'], function(semver) {
clearInterval(updateIntervalId); clearInterval(updateIntervalId);
} }
updateIntervalId = setInterval(function() { updateIntervalId = setInterval(function() {
if (app.isFocused) {
socket.emit('meta.rooms.getAll', Admin.updateRoomUsage); socket.emit('meta.rooms.getAll', Admin.updateRoomUsage);
}
}, 5000); }, 5000);
$('#logout-link').on('click', function() { $('#logout-link').on('click', function() {
@ -303,6 +305,10 @@ define('forum/admin/general/dashboard', ['semver'], function(semver) {
} }
function updateTrafficGraph() { function updateTrafficGraph() {
if (!app.isFocused) {
return;
}
socket.emit('admin.analytics.get', {graph: "traffic"}, function (err, data) { socket.emit('admin.analytics.get', {graph: "traffic"}, function (err, data) {
for (var i = 0, ii = data.pageviews.length; i < ii; i++) { for (var i = 0, ii = data.pageviews.length; i < ii; i++) {
graphs.traffic.datasets[0].points[i].value = data.pageviews[i]; graphs.traffic.datasets[0].points[i].value = data.pageviews[i];

Loading…
Cancel
Save