Author: yusaku
Date: Sat Feb 2 02:28:28 2013
New Revision: 1441689
URL: http://svn.apache.org/viewvc?rev=1441689&view=rev
Log:
AMBARI-1337. Refactor Job Browser filter. (yusaku)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-web/app/controllers/main/apps_controller.js
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1441689&r1=1441688&r2=1441689&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Sat Feb 2 02:28:28 2013
@@ -38,6 +38,8 @@ Trunk (unreleased changes):
IMPROVEMENTS
+ AMBARI-1337. Refactor Job Browser filter. (yusaku)
+
AMBARI-1336. Externalize text to messages.js. (yusaku)
AMBARI-1334. Show hosts that have failed install tasks as "red" to allow the
user
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=1441689&r1=1441688&r2=1441689&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 Feb 2 02:28:28 2013
@@ -318,63 +318,20 @@ App.MainAppsController = Em.ArrayControl
createAppLink:function(){
var link = "/jobhistory/datatable?";
- if(this.sSearch_0){
- link += "sSearch_0=" + this.sSearch_0 + "&";
- }
- if(this.sSearch_1){
- link += "sSearch_1=" + this.sSearch_1 + "&";
- }
- if(this.sSearch_2 && this.sSearch_2 != "Any"){
- link += "sSearch_2=" + this.sSearch_2 + "&";
- }
- if(this.sSearch_3){
- link += "sSearch_3=" + this.sSearch_3 + "&";
- }
- if(this.minJobs){
- link += "minJobs=" + this.minJobs + "&";
- }
- if(this.maxJobs){
- link += "maxJobs=" + this.maxJobs + "&";
- }
- if(this.minInputBytes){
- link += "minInputBytes=" + this.minInputBytes + "&";
- }
- if(this.maxInputBytes){
- link += "maxInputBytes=" + this.maxInputBytes + "&";
- }
- if(this.minOutputBytes){
- link += "minOutputBytes=" + this.minOutputBytes + "&";
- }
- if(this.maxOutputBytes){
- link += "maxOutputBytes=" + this.maxOutputBytes + "&";
- }
- if(this.minDuration){
- link += "minDuration=" + this.minDuration + "&";
- }
- if(this.maxDuration){
- link += "maxDuration=" + this.maxDuration + "&";
- }
- if(this.minStartTime){
- link += "minStartTime=" + this.minStartTime + "&";
- }
- if(this.maxStartTime){
- link += "maxStartTime=" + this.maxStartTime + "&";
- }
- if(this.sSearch){
- link += "sSearch=" + this.sSearch + "&";
- }
- if(this.iDisplayLength){
- link += "iDisplayLength=" + this.iDisplayLength + "&";
- }
- if(this.iDisplayStart){
- link += "iDisplayStart=" + this.iDisplayStart + "&";
- }
- if(this.iSortCol_0){
- link += "iSortCol_0=" + this.iSortCol_0 + "&";
- }
- if(this.sSortDir_0){
- link += "sSortDir_0=" + this.sSortDir_0 + "&";
- }
+
+ var arr = [
+ "sSearch_0", "sSearch_1", "sSearch_2", "sSearch_3", "minJobs",
+ "maxJobs", "minInputBytes", "maxInputBytes", "minOutputBytes",
+ "maxOutputBytes", "minDuration", "maxDuration", "minStartTime",
+ "maxStartTime", "sSearch", "iDisplayLength", "iDisplayStart",
+ "iSortCol_0", "sSortDir_0"
+ ];
+
+ for (var n=0; n<arr.length;n++) {
+ if(this.get(arr[n])){
+ link += arr[n] + "=" + this.get(arr[n]) + "&";
+ }
+ };
link = link.slice(0,link.length-1);