@ -26,17 +26,19 @@
socket.on('api:get_all_rooms', function(data) {
socket.on('api:get_all_rooms', function(data) {
var active_users = document.getElementById('active_users'),
var active_users = document.getElementById('active_users'),
total = 0;
total = 0;
active_users.innerHTML = '';
for(var room in data) {
for(var room in data) {
if (room !== '') {
if (room !== '') {
var count = data[room].length;
var count = data[room].length;
total += count;
total += count;
active_users.innerHTML = active_users.innerHTML + "<div class='alert alert-success'><strong>" + room + "</strong> " + count + " active user" + (count > 1 ? "s" : "") + "</div> <br /> ";
active_users.innerHTML = active_users.innerHTML + "<div class='alert alert-success'><strong>" + room + "</strong> " + count + " active user" + (count > 1 ? "s" : "") + "</div> ";
}
}
}
}
document.getElementById('connections').innerHTML = total;
document.getElementById('connections').innerHTML = total;
});
});
app.enter_room('admin');
socket.emit('api:get_all_rooms');
socket.emit('api:get_all_rooms');
</script>
</script>