incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cr...@apache.org
Subject [11/11] git commit: Added an activity indicator on queries page next to the tables
Date Fri, 20 Jun 2014 02:11:58 GMT
Added an activity indicator on queries page next to the tables


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/f10433a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/f10433a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/f10433a1

Branch: refs/heads/apache-blur-0.2
Commit: f10433a1a76484d55c74c3b8035bb0e4a5b17753
Parents: e65cc1e
Author: Chris Rohr <rohr.chris@gmail.com>
Authored: Thu Jun 19 22:11:41 2014 -0400
Committer: Chris Rohr <rohr.chris@gmail.com>
Committed: Thu Jun 19 22:11:41 2014 -0400

----------------------------------------------------------------------
 .../src/main/webapp/js/blurconsole.queries.js   |   31 +-
 ...console.9c5692891382a5b44b51b02ec2798ef3.css | 6592 -----------------
 .../src/main/webapp/public/css/blurconsole.css  | 6611 +-----------------
 ...ole.css.0212975e50782bb2f0d4b89d196e90dc.map |    7 -
 .../main/webapp/public/css/blurconsole.css.map  |    2 +-
 blur-console/src/main/webapp/public/index.html  |    4 +-
 ...rconsole.fdfdf622e539d17c4daa4b622d866cd2.js |   27 -
 .../src/main/webapp/public/js/blurconsole.js    |    6 +-
 ...sole.js.241e872aab2dd244acdeb1b403c6f2f6.map |    1 -
 .../main/webapp/public/js/blurconsole.js.map    |    2 +-
 10 files changed, 52 insertions(+), 13231 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f10433a1/blur-console/src/main/webapp/js/blurconsole.queries.js
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/js/blurconsole.queries.js b/blur-console/src/main/webapp/js/blurconsole.queries.js
index 9b3d6b0..f010821 100644
--- a/blur-console/src/main/webapp/js/blurconsole.queries.js
+++ b/blur-console/src/main/webapp/js/blurconsole.queries.js
@@ -20,7 +20,7 @@ under the License.
 /*global blurconsole:false */
 blurconsole.queries = (function() {
     'use strict';
-  
+
     //------------------------ Configuration and State --------------------
     var configMap = {
         view: 'views/queries.tpl.html',
@@ -55,7 +55,7 @@ blurconsole.queries = (function() {
         currentSort: null
     },
     jqueryMap = {};
-  
+
     //----------------------------------- Private methods ----------------------------
 
     function _setJqueryMap() {
@@ -150,7 +150,7 @@ blurconsole.queries = (function() {
                             panelContent += ' active';
                             _drawQueries();
                         }
-                        panelContent += '">' + table.name + '</a>';
+                        panelContent += '">' + table.name + ' <i class="glyphicon glyphicon-exclamation-sign"
data-table="' + table.name + '" style="display:none"></i></a>';
                     });
                     panelContent += '</div>';
                 } else {
@@ -171,14 +171,35 @@ blurconsole.queries = (function() {
             jqueryMap.$queryHolder.html('<div class="alert alert-info">Select a table
on the left to see the current queries</div>');
         }
     }
-  
+
+    function _updateActivityIndicators() {
+        var clusters = blurconsole.model.tables.getClusters();
+
+        $.each(clusters, function(i, cluster) {
+            var clusterHasActivity = false,
+                tables = blurconsole.model.tables.getEnabledTables(cluster);
+
+            $.each(tables, function(i, table){
+                if (blurconsole.model.queries.tableHasActivity(table.name)) {
+                    clusterHasActivity = true;
+                    $('i[data-table="' + table.name + '"]').show();
+                } else {
+                    $('i[data-table="' + table.name + '"]').hide();
+                }
+            });
+        });
+    }
+
     //-------------------------- Public API ---------------------------------
 
     function initModule($container) {
         $container.load(configMap.view, function() {
             stateMap.$container = $container;
             _setJqueryMap();
-            $.gevent.subscribe(jqueryMap.$container, 'queries-updated', _drawQueries);
+            $.gevent.subscribe(jqueryMap.$container, 'queries-updated', function() {
+                _drawQueries();
+                _updateActivityIndicators();
+            });
             $.gevent.subscribe(jqueryMap.$container, 'tables-updated', _drawTableList);
             _registerPageEvents();
             _waitForData();


Mime
View raw message