chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r1033674 - in /incubator/chukwa/trunk: CHANGES.txt src/web/hicc/jsp/graph_explorer.jsp
Date Wed, 10 Nov 2010 19:42:18 GMT
Author: asrabkin
Date: Wed Nov 10 19:42:17 2010
New Revision: 1033674

URL: http://svn.apache.org/viewvc?rev=1033674&view=rev
Log:
CHUKWA-548. Gray out options with no data. Contributed by Michael Chang.

Modified:
    incubator/chukwa/trunk/CHANGES.txt
    incubator/chukwa/trunk/src/web/hicc/jsp/graph_explorer.jsp

Modified: incubator/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/CHANGES.txt?rev=1033674&r1=1033673&r2=1033674&view=diff
==============================================================================
--- incubator/chukwa/trunk/CHANGES.txt (original)
+++ incubator/chukwa/trunk/CHANGES.txt Wed Nov 10 19:42:17 2010
@@ -24,6 +24,8 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
 
+    CHUKWA-548. Gray out options with no data. (Michael Chang via asrabkin)
+
     CHUKWA-546. SocketAdaptor. (Eric Yang via asrabkin)
 
     CHUKWA-493. Change release artifact naming. (Eric Yang via asrabkin)

Modified: incubator/chukwa/trunk/src/web/hicc/jsp/graph_explorer.jsp
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/web/hicc/jsp/graph_explorer.jsp?rev=1033674&r1=1033673&r2=1033674&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/web/hicc/jsp/graph_explorer.jsp (original)
+++ incubator/chukwa/trunk/src/web/hicc/jsp/graph_explorer.jsp Wed Nov 10 19:42:17 2010
@@ -33,12 +33,31 @@
   <script src="/hicc/js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
   <script src="/hicc/js/autoHeight.js" type="text/javascript" charset="utf-8"></script>
   <script>
+    var checkDataLength = function(curOption) {
+      return function(data) {
+        if (data.length == 0) {
+          curOption.attr('disabled', 'disabled');
+        }
+      }
+    };
+
     $.ajax({ url: "/hicc/v1/metrics/schema", dataType: "json", success: function(data){
       for(var i in data) {
         $('#table').append("<option>"+data[i]+"</option>");
       }
+      // Look through each table option and see if it has anything in its family?
+      $('#table').children().each(
+        function() {
+          var table = $(this).text();
+          $.ajax({ url: "/hicc/v1/metrics/schema/"+table, 
+                   dataType: "json", 
+                   success: checkDataLength($(this))
+          });
+        }
+      );
     }});
 
+
     function getFamilies() {
       var size = $('#family option').size();
       $('#family').find('option').remove();
@@ -47,6 +66,17 @@
         for(var i in data) {
           $('#family').append("<option>"+data[i]+"</option>");
         }
+        // Look through each family option and see if it has any columns
+        var table = $('#table').val();
+        $('#family').children().each(
+          function() {
+            var family = $(this).text();
+            $.ajax({ url: "/hicc/v1/metrics/schema/"+table+"/"+family, 
+                     dataType: "json", 
+                     success: checkDataLength($(this))
+            });
+          }
+        );
       }});
     }
 
@@ -62,6 +92,18 @@
           for(var i in data) {
             $('#column').append("<option>"+data[i]+"</option>");
           }
+          // Look through each column option and see if it has any rows
+          var table = $('#table').val();
+          var family = $('#family').val();
+          $('#column').children().each(
+            function() {
+              var column = $(this).text();
+              $.ajax({ url: "/hicc/v1/metrics/schema/"+table+"/"+family+"/"+column, 
+                       dataType: "json", 
+                       success: checkDataLength($(this))
+              });
+            }
+          );
         }});
       });
     }



Mime
View raw message