azkaban-uncached

Style changes.

11/25/2013 4:40:28 PM

Details

diff --git a/src/java/azkaban/webapp/servlet/velocity/flowexecutionpanel.vm b/src/java/azkaban/webapp/servlet/velocity/flowexecutionpanel.vm
index 0b88ebd..b752a56 100644
--- a/src/java/azkaban/webapp/servlet/velocity/flowexecutionpanel.vm
+++ b/src/java/azkaban/webapp/servlet/velocity/flowexecutionpanel.vm
@@ -68,6 +68,7 @@
 									<div id="notification-panel" class="side-panel">
 										<h4>Notify on failure</h4>
 										<p>On a job failure, notify on either the first failure, and/or when the failed flow finishes.</p>
+										<hr>
 										<label class="checkbox-inline">
 											<input id="notify-failure-first" type="checkbox" name="notify" value="first">First failure
 										</label>
@@ -101,6 +102,7 @@
 									<div id="failure-options" class="side-panel">
 										<h4>Failure Options</h4>
 										<p>When a failure first occurs in the flow, select the execution behavior.</p>
+										<hr>
 										<ul>
 											<li><strong>Finish Current Running</strong> finishes only the currently running job. It will not start any new jobs.</li>
 											<li><strong>Cancel All</strong> immediately kills all jobs and fails the flow.</li>
@@ -118,6 +120,7 @@
 									<div id="concurrent-panel" class="side-panel">
 										<h4>Concurrent Execution Options</h4>
 										<p>If the flow is currently running, these are the options that can be set.</p>
+										<hr>
 										<div class="radio">
 											<label>
 												<input type="radio" id="skip" name="concurrent" value="skip" checked="checked">
@@ -157,8 +160,9 @@
 
 									<div id="flow-parameters-panel" class="side-panel">
 										<h4>Flow Property Override</h4>
+										<hr>
 										<div id="editTable">
-											<table>
+											<table class="table table-striped">
 												<thead>
 													<tr>
 														<th>Name</th>
diff --git a/src/web/js/azkaban.ajax.utils.js b/src/web/js/azkaban.ajax.utils.js
index 96d4b28..22647b7 100644
--- a/src/web/js/azkaban.ajax.utils.js
+++ b/src/web/js/azkaban.ajax.utils.js
@@ -15,142 +15,137 @@
  */
 
 function ajaxCall(requestURL, data, callback) {
-	$.get(
-		requestURL,
-		data,
-		function(data) {
-			if (data.error == "session") {
-				// We need to relogin.
-				var errorDialog = document.getElementById("invalid-session");
-				if (errorDialog) {
-					  $(errorDialog).modal({
-					      closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
-					      position: ["20%",],
-					      containerId: 'confirm-container',
-					      containerCss: {
-					        'height': '220px',
-					        'width': '565px'
-					      },
-					      onClose: function (dialog) {
-					      	window.location.reload();
-					      }
-					    });
-				}
-			}
-			else {
-				callback.call(this,data);
+	
+	var successHandler = function(data) {
+		if (data.error == "session") {
+			// We need to relogin.
+			var errorDialog = document.getElementById("invalid-session");
+			if (errorDialog) {
+				$(errorDialog).modal({
+					closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
+					position: ["20%",],
+					containerId: 'confirm-container',
+					containerCss: {
+						'height': '220px',
+						'width': '565px'
+					},
+					onClose: function (dialog) {
+						window.location.reload();
+					}
+				});
 			}
-		},
-		"json"
-	);
+		}
+		else {
+			callback.call(this,data);
+		}
+	};
+	$.get(requestURL, data, successHandler, "json");
 }
 
 function executeFlow(executingData) {
 	executeURL = contextURL + "/executor";
-	$.get(
-		executeURL,
-		executingData,
-		function(data) {
-			if (data.error) {
-				messageDialogView.show("Error Executing Flow", data.error);
-			}
-			else {
-				messageDialogView.show("Flow submitted", data.message,
-					function() {
-						var redirectURL = contextURL + "/executor?execid=" + data.execid;
-						window.location.href = redirectURL;
-					}
-				);
-			}
-		},
-		"json"
-	);
+	var successHandler = function(data) {
+		if (data.error) {
+			messageDialogView.show("Error Executing Flow", data.error);
+		}
+		else {
+			messageDialogView.show("Flow submitted", data.message,
+				function() {
+					var redirectURL = contextURL + "/executor?execid=" + data.execid;
+					window.location.href = redirectURL;
+				}
+			);
+		}
+	};
+
+	$.get(executeURL, executingData, successHandler, "json");
 }
 
 function fetchFlowInfo(model, projectName, flowId, execId) {
-  	var fetchData = {"project": projectName, "ajax":"flowInfo", "flow":flowId};
-  	if (execId) {
-  		fetchData.execid = execId;
-  	}
-  	
-  	var executeURL = contextURL + "/executor";
-  	$.ajax({
-  		url: executeURL,
-  		data: fetchData,
-  		success: function(data) {
-			if (data.error) {
-				alert(data.error);
-			}
-			else {
-				model.set({
-					"successEmails": data.successEmails, 
-					"failureEmails": data.failureEmails,
-					"failureAction": data.failureAction,
-					"notifyFailure": {"first": data.notifyFailureFirst, "last":data.notifyFailureLast},
-					"flowParams": data.flowParam,
-					"isRunning": data.running,
-					"nodeStatus": data.nodeStatus,
-					"concurrentOption": data.concurrentOptions,
-					"pipelineLevel": data.pipelineLevel,
-					"pipelineExecution": data.pipelineExecution,
-					"queueLevel":data.queueLevel
-				});
-			}
-			
-			model.trigger("change:flowinfo");
-		},
+	var fetchData = {"project": projectName, "ajax":"flowInfo", "flow":flowId};
+	if (execId) {
+		fetchData.execid = execId;
+	}
+	
+	var executeURL = contextURL + "/executor";
+	var successHandler = function(data) {
+		if (data.error) {
+			alert(data.error);
+		}
+		else {
+			model.set({
+				"successEmails": data.successEmails, 
+				"failureEmails": data.failureEmails,
+				"failureAction": data.failureAction,
+				"notifyFailure": {"first": data.notifyFailureFirst, "last":data.notifyFailureLast},
+				"flowParams": data.flowParam,
+				"isRunning": data.running,
+				"nodeStatus": data.nodeStatus,
+				"concurrentOption": data.concurrentOptions,
+				"pipelineLevel": data.pipelineLevel,
+				"pipelineExecution": data.pipelineExecution,
+				"queueLevel":data.queueLevel
+			});
+		}
+		model.trigger("change:flowinfo");
+	};
+
+	$.ajax({
+		url: executeURL,
+		data: fetchData,
+		success: successHandler,
 		dataType: "json",
 		async: false
-  	});
+	});
 }
 
 function fetchFlow(model, projectName, flowId, sync) {
 	// Just in case people don't set sync
 	sync = sync ? true : false;
-
-  	var managerUrl = contextURL + "/manager";
-  	var fetchData = {
-  		"ajax" : "fetchflowgraph",
-  		"project" : projectName,
-  		"flow" : flowId
-  	};
+	var managerUrl = contextURL + "/manager";
+	var fetchData = {
+		"ajax" : "fetchflowgraph",
+		"project" : projectName,
+		"flow" : flowId
+	};
+	var successHandler = function(data) {
+		if (data.error) {
+			alert(data.error);
+		}
+		else {
+			var disabled = data.disabled ? data.disabled : {};
+			model.set({flowId: data.flowId, data:data, disabled: disabled});
+			
+			var nodeMap = {};
+			for (var i = 0; i < data.nodes.length; ++i) {
+				var node = data.nodes[i];
+				nodeMap[node.id] = node;
+			}
+			
+			for (var i = 0; i < data.edges.length; ++i) {
+				 var edge = data.edges[i];
+				 
+				 if (!nodeMap[edge.target].in) {
+					nodeMap[edge.target].in = {};
+				 }
+				 var targetInMap = nodeMap[edge.target].in;
+				 targetInMap[edge.from] = nodeMap[edge.from];
+				 
+				 if (!nodeMap[edge.from].out) {
+					nodeMap[edge.from].out = {};
+				 }
+				 var sourceOutMap = nodeMap[edge.from].out;
+				 sourceOutMap[edge.target] = nodeMap[edge.target];
+			}
+			
+			model.set({nodeMap: nodeMap});
+		}
+	};
 
 	$.ajax({
 		url: managerUrl,
 		data: fetchData,
-		success: function(data) {
-			if (data.error) {
-				alert(data.error);
-			}
-			else {
-				var disabled = data.disabled ? data.disabled : {};
-				model.set({flowId: data.flowId, data:data, disabled: disabled});
-				
-				var nodeMap = {};
-				for (var i = 0; i < data.nodes.length; ++i) {
-					var node = data.nodes[i];
-					nodeMap[node.id] = node;
-				}
-				
-				for (var i = 0; i < data.edges.length; ++i) {
-					 var edge = data.edges[i];
-					 
-					 if (!nodeMap[edge.target].in) {
-					 	nodeMap[edge.target].in = {};
-					 }
-					 var targetInMap = nodeMap[edge.target].in;
-					 targetInMap[edge.from] = nodeMap[edge.from];
-					 
-					 if (!nodeMap[edge.from].out) {
-					 	nodeMap[edge.from].out = {};
-					 }
-					 var sourceOutMap = nodeMap[edge.from].out;
-					 sourceOutMap[edge.target] = nodeMap[edge.target];
-				}
-				
-				model.set({nodeMap: nodeMap});
-			}
-		},
+		success: successHandler,
 		dataType: "json",
 		async: !sync
 	});
@@ -164,34 +159,39 @@ function flowExecutingStatus(projectName, flowId) {
 	var requestURL = contextURL + "/executor";
 	
 	var executionIds;
-	$.ajax( {
+	var successHandler = function(data) {
+		if (data.error == "session") {
+			// We need to relogin.
+			var errorDialog = document.getElementById("invalid-session");
+			if (errorDialog) {
+				$(errorDialog).modal({
+					closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
+					position: ["20%",],
+					containerId: 'confirm-container',
+					containerCss: {
+						'height': '220px',
+						'width': '565px'
+					},
+					onClose: function (dialog) {
+						window.location.reload();
+					}
+				});
+			}
+		}
+		else {
+			executionIds = data.execIds;
+		}
+	};
+	$.ajax({
 		url: requestURL,
 		async: false,
-		data: {"ajax":"getRunning", "project":projectName, "flow":flowId},
+		data: {
+			"ajax": "getRunning", 
+			"project": projectName, 
+			"flow": flowId
+		},
 		error: function(data) {},
-		success: function(data) {
-			if (data.error == "session") {
-				// We need to relogin.
-				var errorDialog = document.getElementById("invalid-session");
-				if (errorDialog) {
-					  $(errorDialog).modal({
-					      closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
-					      position: ["20%",],
-					      containerId: 'confirm-container',
-					      containerCss: {
-					        'height': '220px',
-					        'width': '565px'
-					      },
-					      onClose: function (dialog) {
-					      	window.location.reload();
-					      }
-					    });
-				}
-			}
-			else {
-				executionIds = data.execIds;
-			}
-		}
+		success: successHandler
 	});
 	
 	return executionIds;
diff --git a/src/web/js/azkaban.flow.execute.view.js b/src/web/js/azkaban.flow.execute.view.js
index f8d9cfb..a3a0bb0 100644
--- a/src/web/js/azkaban.flow.execute.view.js
+++ b/src/web/js/azkaban.flow.execute.view.js
@@ -18,7 +18,6 @@ $.namespace('azkaban');
 
 function recurseAllAncestors(nodes, disabledMap, id, disable) {
 	var node = nodes[id];
-	
 	if (node.in) {
 		for (var key in node.in) {
 			disabledMap[key] = disable;
@@ -29,7 +28,6 @@ function recurseAllAncestors(nodes, disabledMap, id, disable) {
 
 function recurseAllDescendents(nodes, disabledMap, id, disable) {
 	var node = nodes[id];
-	
 	if (node.out) {
 		for (var key in node.out) {
 			disabledMap[key] = disable;
@@ -40,33 +38,36 @@ function recurseAllDescendents(nodes, disabledMap, id, disable) {
 
 var flowExecuteDialogView;
 azkaban.FlowExecuteDialogView = Backbone.View.extend({
-	events : {
+	events: {
 		"click .closeExecPanel": "hideExecutionOptionPanel",
-		"click #schedule-btn" : "scheduleClick",
-		"click #execute-btn" : "handleExecuteFlow"
+		"click #schedule-btn": "scheduleClick",
+		"click #execute-btn": "handleExecuteFlow"
 	},
-	initialize : function(settings) {
+	
+	initialize: function(settings) {
 		this.model.bind('change:flowinfo', this.changeFlowInfo, this);
 		$("#overrideSuccessEmails").click(function(evt) {
-			if($(this).is(':checked')){
-				$('#successEmails').attr('disabled',null);
+			if($(this).is(':checked')) {
+				$('#successEmails').attr('disabled', null);
 			}
 			else {
-				$('#successEmails').attr('disabled',"disabled");
+				$('#successEmails').attr('disabled', "disabled");
 			}
-				});
+		});
 				
-			$("#overrideFailureEmails").click(function(evt) {
-			if($(this).is(':checked')){
-				$('#failureEmails').attr('disabled',null);
+		$("#overrideFailureEmails").click(function(evt) {
+			if($(this).is(':checked')) {
+				$('#failureEmails').attr('disabled', null);
 			}
 			else {
-				$('#failureEmails').attr('disabled',"disabled");
+				$('#failureEmails').attr('disabled', "disabled");
 			}
 		});
 	},
+	
 	render: function() {
 	},
+	
 	getExecutionOptionData: function() {
 		var failureAction = $('#failureAction').val();
 		var failureEmails = $('#failureEmails').val();
@@ -127,6 +128,7 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
 		
 		return executingData;
 	},
+	
 	changeFlowInfo: function() {
 		var successEmails = this.model.get("successEmails");
 		var failureEmails = this.model.get("failureEmails");