Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E6F57EA6F for ; Sat, 26 Jan 2013 05:28:47 +0000 (UTC) Received: (qmail 80412 invoked by uid 500); 26 Jan 2013 05:28:47 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 80391 invoked by uid 500); 26 Jan 2013 05:28:47 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 80378 invoked by uid 99); 26 Jan 2013 05:28:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Jan 2013 05:28:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Jan 2013 05:28:44 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C2D5823889E1; Sat, 26 Jan 2013 05:28:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: ambari-commits@incubator.apache.org From: yusaku@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130126052824.C2D5823889E1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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;