mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
fixed admin page active sockets
This commit is contained in:
@@ -18,6 +18,13 @@ define(function() {
|
||||
};
|
||||
|
||||
Admin.updateRoomUsage = function(err, data) {
|
||||
function getUserCountIn(room) {
|
||||
var count = 0;
|
||||
for(var user in data[room]) {
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
var active_users = $('#active_users'),
|
||||
total = 0;
|
||||
|
||||
@@ -31,7 +38,7 @@ define(function() {
|
||||
|
||||
for (var room in data) {
|
||||
if (room !== '') {
|
||||
var count = $(data[room]).length;
|
||||
var count = getUserCountIn(room);
|
||||
total += count;
|
||||
usersHtml += "<div class='alert alert-success'><strong>" + room + "</strong> " + count + " active user" + (count > 1 ? "s" : "") + "</div>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user