mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
Fixed issue where graph would always switch back to single-day
This commit is contained in:
@@ -11,7 +11,8 @@ define('admin/general/dashboard', ['semver'], function(semver) {
|
|||||||
graphData = {
|
graphData = {
|
||||||
rooms: {},
|
rooms: {},
|
||||||
traffic: {}
|
traffic: {}
|
||||||
};
|
},
|
||||||
|
currentGraph = 'hours';
|
||||||
|
|
||||||
var DEFAULTS = {
|
var DEFAULTS = {
|
||||||
roomInterval: 10000,
|
roomInterval: 10000,
|
||||||
@@ -302,7 +303,7 @@ define('admin/general/dashboard', ['semver'], function(semver) {
|
|||||||
|
|
||||||
socket.emit('admin.analytics.get', {
|
socket.emit('admin.analytics.get', {
|
||||||
graph: 'traffic',
|
graph: 'traffic',
|
||||||
units: units || 'hours'
|
units: units || currentGraph
|
||||||
}, function (err, data) {
|
}, function (err, data) {
|
||||||
if (JSON.stringify(graphData.traffic) === JSON.stringify(data)) {
|
if (JSON.stringify(graphData.traffic) === JSON.stringify(data)) {
|
||||||
return;
|
return;
|
||||||
@@ -334,6 +335,7 @@ define('admin/general/dashboard', ['semver'], function(semver) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
graphs.traffic.update();
|
graphs.traffic.update();
|
||||||
|
currentGraph = units;
|
||||||
|
|
||||||
$('#pageViewsThisMonth').html(data.monthlyPageViews.thisMonth);
|
$('#pageViewsThisMonth').html(data.monthlyPageViews.thisMonth);
|
||||||
$('#pageViewsLastMonth').html(data.monthlyPageViews.lastMonth);
|
$('#pageViewsLastMonth').html(data.monthlyPageViews.lastMonth);
|
||||||
|
|||||||
Reference in New Issue
Block a user