airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata-php-gateway git commit: fixing queue names not updating issue in create app deployment
Date Thu, 27 Jul 2017 16:14:32 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 355cb7586 -> 2a1394395


fixing queue names not updating issue in create app deployment


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/2a139439
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/2a139439
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/2a139439

Branch: refs/heads/develop
Commit: 2a13943958c46a43d89e563daee465b617bc6624
Parents: 355cb75
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Thu Jul 27 12:14:31 2017 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Thu Jul 27 12:14:31 2017 -0400

----------------------------------------------------------------------
 public/js/deployment.js | 72 +++++++++++++++++++++++++-------------------
 1 file changed, 41 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2a139439/public/js/deployment.js
----------------------------------------------------------------------
diff --git a/public/js/deployment.js b/public/js/deployment.js
index a895193..3a4476b 100644
--- a/public/js/deployment.js
+++ b/public/js/deployment.js
@@ -71,45 +71,55 @@ $( document).ready( function(){
         	$(".delete-deploymentId").val( deploymentId )
         });
 
+	updateQueueNamesForCreateAppDep();
 	$("#create-app-deployment-block").on('change', '.computeHostId', function () {
-		var computeResourceCompleteList = $.parseJSON($("#compute-resource-full-objects").val());
-		$('#create-app-deployment-block .default-queue-name-select').find('option').remove();
-		for(i = 0; i< computeResourceCompleteList.length; i++){
-			computeResource = computeResourceCompleteList[i];
-			if(computeResource.computeResourceId.startsWith(this.value)){
-				queues = computeResource.batchQueues;
-				if(queues != null){
-					for(j=0; j<queues.length; j++){
-						queue = queues[j];
-						$("#create-app-deployment-block .default-queue-name-select").append("<option value="+queue.queueName+">"+queue.queueName+"</option>");
-					}
-				}
-			}
-		}
+		updateQueueNamesForCreateAppDep();
 	});
 
+	updateQueueNamesForEditAppDep();
 	$("#edit-app-deployment-block").on('change', '.computeHostId', function () {
-		var computeResourceCompleteList = $.parseJSON($("#compute-resource-full-objects").val());
-		var appDeploymentObject = $.parseJSON($("#app-deployment-object").val());
-		$('#edit-app-deployment-block .default-queue-name-select').find('option').remove();
-		for(i = 0; i< computeResourceCompleteList.length; i++){
-			computeResource = computeResourceCompleteList[i];
-			if(computeResource.computeResourceId.startsWith(this.value)){
-				queues = computeResource.batchQueues;
-				if(queues != null){
-					for(j=0; j<queues.length; j++){
-						queue = queues[j];
-						if(appDeploymentObject.defaultQueueName == queue.queueName){
-							$("#edit-app-deployment-block .default-queue-name-select").append("<option value="+queue.queueName+"
selected>"+queue.queueName+"</option>");
-						}else{
-							$("#edit-app-deployment-block .default-queue-name-select").append("<option value="+queue.queueName+">"+queue.queueName+"</option>");
-						}
+		updateQueueNamesForEditAppDep();
+	});
+});
+
+function updateQueueNamesForCreateAppDep(){
+	var computeResourceCompleteList = $.parseJSON($("#compute-resource-full-objects").val());
+	$('#create-app-deployment-block .default-queue-name-select').find('option').remove();
+	for(i = 0; i< computeResourceCompleteList.length; i++){
+		computeResource = computeResourceCompleteList[i];
+		if(computeResource.computeResourceId.startsWith(this.value)){
+			queues = computeResource.batchQueues;
+			if(queues != null){
+				for(j=0; j<queues.length; j++){
+					queue = queues[j];
+					$("#create-app-deployment-block .default-queue-name-select").append("<option value="+queue.queueName+">"+queue.queueName+"</option>");
+				}
+			}
+		}
+	}
+}
+
+function updateQueueNamesForEditAppDep(){
+	var computeResourceCompleteList = $.parseJSON($("#compute-resource-full-objects").val());
+	var appDeploymentObject = $.parseJSON($("#app-deployment-object").val());
+	$('#edit-app-deployment-block .default-queue-name-select').find('option').remove();
+	for(i = 0; i< computeResourceCompleteList.length; i++){
+		computeResource = computeResourceCompleteList[i];
+		if(computeResource.computeResourceId.startsWith(this.value)){
+			queues = computeResource.batchQueues;
+			if(queues != null){
+				for(j=0; j<queues.length; j++){
+					queue = queues[j];
+					if(appDeploymentObject.defaultQueueName == queue.queueName){
+						$("#edit-app-deployment-block .default-queue-name-select").append("<option value="+queue.queueName+"
selected>"+queue.queueName+"</option>");
+					}else{
+						$("#edit-app-deployment-block .default-queue-name-select").append("<option value="+queue.queueName+">"+queue.queueName+"</option>");
 					}
 				}
 			}
 		}
-	});
-});
+	}
+}
 
 function clearInputs( elem, removeJustReadOnly){
 


Mime
View raw message