removed idle added recent tags presence info

v1.18.x
Barış Soner Uşaklı 10 years ago
parent 0d044c34c1
commit 41db2dcd14

@ -98,10 +98,14 @@
border-color: #FDB45C;
background-color: #FFC870;
}
&.idle {
&.recent {
border-color: #949FB1;
background-color: #A8B3C5;
}
&.tags {
border-color: #FDB45C;
background-color: #8FA633;
}
}
}
}

@ -141,10 +141,8 @@ define('admin/general/dashboard', ['semver'], function(semver) {
'<div>Connections</div>' +
'</div>';
var idle = data.socketCount - (data.users.categories + data.users.topics + data.users.category);
updateRegisteredGraph(data.onlineRegisteredCount, data.onlineGuestCount);
updatePresenceGraph(data.users.categories, data.users.topics, data.users.category, idle);
updatePresenceGraph(data.users);
updateTopicsGraph(data.topics);
$('#active-users').html(html);
@ -248,46 +246,52 @@ define('admin/general/dashboard', ['semver'], function(semver) {
});
graphs.registered = new Chart(registeredCtx).Doughnut([{
value: 1,
color:"#F7464A",
highlight: "#FF5A5E",
label: "Registered Users"
},
{
value: 1,
color: "#46BFBD",
highlight: "#5AD3D1",
label: "Anonymous Users"
}], {
responsive: true
});
value: 1,
color:"#F7464A",
highlight: "#FF5A5E",
label: "Registered Users"
},
{
value: 1,
color: "#46BFBD",
highlight: "#5AD3D1",
label: "Anonymous Users"
}], {
responsive: true
});
graphs.presence = new Chart(presenceCtx).Doughnut([{
value: 1,
color:"#F7464A",
highlight: "#FF5A5E",
label: "On categories list"
},
{
value: 1,
color: "#46BFBD",
highlight: "#5AD3D1",
label: "Reading posts"
},
{
value: 1,
color: "#FDB45C",
highlight: "#FFC870",
label: "Browsing topics"
},
{
value: 1,
color: "#949FB1",
highlight: "#A8B3C5",
label: "Idle"
}], {
responsive: true
});
value: 1,
color:"#F7464A",
highlight: "#FF5A5E",
label: "On categories list"
},
{
value: 1,
color: "#46BFBD",
highlight: "#5AD3D1",
label: "Reading posts"
},
{
value: 1,
color: "#FDB45C",
highlight: "#FFC870",
label: "Browsing topics"
},
{
value: 1,
color: "#949FB1",
highlight: "#A8B3C5",
label: "Recent/Unread"
},
{
value: 1,
color: "#8FA633",
highlight: "#3FA7B8",
label: "Tags"
}], {
responsive: true
});
graphs.topics = new Chart(topicsCtx).Doughnut([], {responsive: true});
topicsCanvas.onclick = function(evt){
@ -345,11 +349,13 @@ define('admin/general/dashboard', ['semver'], function(semver) {
graphs.registered.update();
}
function updatePresenceGraph(categories, posts, topics, idle) {
graphs.presence.segments[0].value = categories;
graphs.presence.segments[1].value = posts;
graphs.presence.segments[2].value = topics;
graphs.presence.segments[3].value = idle;
function updatePresenceGraph(users) {
graphs.presence.segments[0].value = users.categories;
graphs.presence.segments[1].value = users.topics;
graphs.presence.segments[2].value = users.category;
graphs.presence.segments[3].value = users.recent;
graphs.presence.segments[4].value = users.tags;
graphs.presence.update();
}

@ -88,6 +88,8 @@ SocketMeta.rooms.getAll = function(socket, data, callback) {
socketCount: websockets.getSocketCount(),
users: {
categories: roomClients.categories ? roomClients.categories.length : 0,
recent: roomClients.recent_posts ? roomClients.recent_posts.length : 0,
tags: roomClients.tags ? roomClients.tags.length : 0,
topics: 0,
category: 0
},

@ -110,7 +110,8 @@
<li><div class="on-categories"></div><span>On categories list</span></li>
<li><div class="reading-posts"></div><span>Reading posts</span></li>
<li><div class="browsing-topics"></div><span>Browsing topics</span></li>
<li><div class="idle"></div><span>Idle</span></li>
<li><div class="recent"></div><span>Recent / Unread</span></li>
<li><div class="tags"></div><span>Tags</span></li>
</ul>
<canvas id="analytics-presence"></canvas>
</div>

Loading…
Cancel
Save