incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1438854 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/controllers/main/apps_controller.js ambari-web/app/styles/apps.less
Date Sat, 26 Jan 2013 05:28:24 GMT
Author: yusaku
Date: Sat Jan 26 05:28:24 2013
New Revision: 1438854

URL: http://svn.apache.org/viewvc?rev=1438854&view=rev
Log:
AMBARI-1265. Job Browser - Filter by Input, output and duration. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/main/apps_controller.js
    incubator/ambari/trunk/ambari-web/app/styles/apps.less

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1438854&r1=1438853&r2=1438854&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Sat Jan 26 05:28:24 2013
@@ -34,6 +34,8 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1265. Job Browser - Filter by Input, output and duration. (yusaku)
+
  AMBARI-1263. Refactoring of User Management code. (yusaku)
 
  AMBARI-1254. Modify App Browser to use server-side paging/sorting/filtering.

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/apps_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/apps_controller.js?rev=1438854&r1=1438853&r2=1438854&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/apps_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/apps_controller.js Sat Jan 26 05:28:24
2013
@@ -147,14 +147,9 @@ App.MainAppsController = Em.ArrayControl
      */
     duration:"",
     onDurationChange:function(){
-      var minMaxTmp = this.parseNumber(this.duration);
-      if(parseFloat(minMaxTmp.min) == parseFloat(minMaxTmp.max)){
-        this.set("minDuration" ,Math.ceil((parseFloat(minMaxTmp.min)-0.01)*1000));
-        this.set("maxDuration" ,Math.floor((parseFloat(minMaxTmp.max)+0.01)*1000));
-      }else{
-        this.set("minDuration", parseFloat(minMaxTmp.min)*1000);
-        this.set("maxDuration", parseFloat(minMaxTmp.max)*1000);
-      }
+      var minMaxTmp = this.parseDuration(this.duration);
+      this.set("minDuration", minMaxTmp.min);
+      this.set("maxDuration", minMaxTmp.max);
     }.observes("duration"),
 
     /**
@@ -167,6 +162,47 @@ App.MainAppsController = Em.ArrayControl
       this.set("maxStartTime", minMaxTmp.max);
     }.observes("runDate"),
 
+    parseDuration:function(value){
+      var tmp={
+        min:"",
+        max:""
+      };
+
+      var compareChar = isNaN(value.charAt(0)) ? value.charAt(0) : false;
+      var compareScale = value.match(/s|m|h/);
+      compareScale = compareScale ? compareScale[0] : "";
+      var compareValue = compareChar ? parseFloat(value.substr(1, value.length)) : parseFloat(value.substr(0,
value.length));
+      if(isNaN(compareValue)){
+        return tmp;
+      }
+      switch (compareScale) {
+        case 'h':
+        tmp.min = Math.ceil((parseFloat(compareValue)-0.0001)*1000*60*60);
+        tmp.max = Math.floor((parseFloat(compareValue)+0.0001)*1000*60*60);
+        break;
+        case 'm':
+        tmp.min = Math.ceil((parseFloat(compareValue)-0.001)*1000*60);
+        tmp.max = Math.floor((parseFloat(compareValue)+0.001)*1000*60);
+        break;
+        case 's':
+        tmp.min = Math.ceil((parseFloat(compareValue)-0.01)*1000);
+        tmp.max = Math.floor((parseFloat(compareValue)+0.01)*1000);
+        break;
+        default:
+          tmp.min = Math.max(1024,Math.ceil((compareValue-0.05)*1024));
+          tmp.max = Math.min(1048575,Math.floor((compareValue+0.05)*1024));
+      }
+      switch (compareChar) {
+        case '<':
+          tmp.min="";
+          break;
+        case '>':
+          tmp.max="";
+          break;
+      }
+      return tmp;
+    },
+
     parseDate:function(value){
       var tmp={
         min:"",
@@ -204,22 +240,24 @@ App.MainAppsController = Em.ArrayControl
         min:"",
         max:""
       };
+
       var compareChar = isNaN(value.charAt(0)) ? value.charAt(0) : false;
-      var compareScale = value.charAt(value.length - 1);
+      var compareScale = value.match(/kb|k|mb|m|gb|g/);
+      compareScale = compareScale ? compareScale[0] : "";
       var compareValue = compareChar ? parseFloat(value.substr(1, value.length)) : parseFloat(value.substr(0,
value.length));
       if(isNaN(compareValue)){
         return tmp;
       }
       switch (compareScale) {
-        case 'g':
+        case 'g': case 'gb':
           tmp.min = Math.max(1073741824,Math.ceil((compareValue-0.005)*1073741824));
           tmp.max = Math.floor((compareValue+0.005)*1073741824);
           break;
-        case 'm':
+        case 'm': case 'mb':
           tmp.min = Math.max(1048576,Math.ceil((compareValue-0.05)*1048576));
           tmp.max = Math.min(1073741823,Math.floor((compareValue+0.05)*1048576));
           break;
-        case 'k':
+        case 'k': case 'kb':
           tmp.min = Math.max(1024,Math.ceil((compareValue-0.05)*1024));
           tmp.max = Math.min(1048575,Math.floor((compareValue+0.05)*1024));
           break;

Modified: incubator/ambari/trunk/ambari-web/app/styles/apps.less
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/apps.less?rev=1438854&r1=1438853&r2=1438854&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/apps.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/apps.less Sat Jan 26 05:28:24 2013
@@ -37,6 +37,13 @@
       }
     }
   }
+  
+  #filter_buttons .selected{
+    cursor: default;
+  }
+  #filter_buttons{
+    cursor: pointer;
+  }
 
   .clear_filter{
     width:578px;



Mime
View raw message