From 41db2dcd1485134c76e69090ed7afc8f1a4bfabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 26 Mar 2015 16:32:17 -0400 Subject: [PATCH] removed idle added recent tags presence info --- public/less/admin/general/dashboard.less | 6 +- public/src/admin/general/dashboard.js | 98 +++++++++++++----------- src/socket.io/meta.js | 2 + src/views/admin/general/dashboard.tpl | 3 +- 4 files changed, 61 insertions(+), 48 deletions(-) diff --git a/public/less/admin/general/dashboard.less b/public/less/admin/general/dashboard.less index ebf65e9fd0..71c2298d31 100644 --- a/public/less/admin/general/dashboard.less +++ b/public/less/admin/general/dashboard.less @@ -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; + } } } } diff --git a/public/src/admin/general/dashboard.js b/public/src/admin/general/dashboard.js index 40ace1ecc1..a842c0d2af 100644 --- a/public/src/admin/general/dashboard.js +++ b/public/src/admin/general/dashboard.js @@ -141,10 +141,8 @@ define('admin/general/dashboard', ['semver'], function(semver) { '
Connections
' + ''; - 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(); } diff --git a/src/socket.io/meta.js b/src/socket.io/meta.js index 669d3533a3..60bb51bd4e 100644 --- a/src/socket.io/meta.js +++ b/src/socket.io/meta.js @@ -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 }, diff --git a/src/views/admin/general/dashboard.tpl b/src/views/admin/general/dashboard.tpl index 94f9125fab..db18b7cf02 100644 --- a/src/views/admin/general/dashboard.tpl +++ b/src/views/admin/general/dashboard.tpl @@ -110,7 +110,8 @@
  • On categories list
  • Reading posts
  • Browsing topics
  • -
  • Idle
  • +
  • Recent / Unread
  • +
  • Tags