fix user presence graph

if nobody's using your forum at all, this thing stopped working
altogether
v1.18.x
psychobunny 10 years ago
parent c01f06214e
commit b69ea4564a

@ -238,6 +238,12 @@ define('admin/general/dashboard', ['semver'], function(semver) {
color: "#949FB1", color: "#949FB1",
highlight: "#A8B3C5", highlight: "#A8B3C5",
label: "Recent/Unread" label: "Recent/Unread"
},
{
value: 1,
color: "#4D5360",
highlight: "#A8B3C5",
label: "Other"
} }
], { ], {
responsive: true responsive: true
@ -311,6 +317,7 @@ define('admin/general/dashboard', ['semver'], function(semver) {
graphs.presence.segments[1].value = users.topics; graphs.presence.segments[1].value = users.topics;
graphs.presence.segments[2].value = users.category; graphs.presence.segments[2].value = users.category;
graphs.presence.segments[3].value = users.recent; graphs.presence.segments[3].value = users.recent;
graphs.presence.segments[4].value = users.other;
graphs.presence.update(); graphs.presence.update();
} }

@ -96,7 +96,8 @@ SocketMeta.rooms.getAll = function(socket, data, callback) {
categories: roomClients.categories ? roomClients.categories.length : 0, categories: roomClients.categories ? roomClients.categories.length : 0,
recent: roomClients.recent_posts ? roomClients.recent_posts.length : 0, recent: roomClients.recent_posts ? roomClients.recent_posts.length : 0,
topics: 0, topics: 0,
category: 0 category: 0,
other: 0
}, },
topics: {} topics: {}
}; };
@ -119,10 +120,14 @@ SocketMeta.rooms.getAll = function(socket, data, callback) {
} }
} else if (room.match(/^category/)) { } else if (room.match(/^category/)) {
socketData.users.category += roomClients[room].length; socketData.users.category += roomClients[room].length;
} else if (room !== 'categories' && room !== 'recent_posts') {
socketData.users.other += roomClients[room].length;
} }
} }
} }
var scoreKeys = Object.keys(scores), var scoreKeys = Object.keys(scores),
mostActive = scoreKeys.sort(); mostActive = scoreKeys.sort();

Loading…
Cancel
Save