incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [6/43] git commit: refs/heads/ui-plugins - CLOUDSTACK-537: cloudstack UI - Advanced sg-enabled zone - VM Wizard - step 5 - select network screen - populate only sg networks (i.e. not show non-sg networks).
Date Fri, 08 Feb 2013 21:10:34 GMT
CLOUDSTACK-537: cloudstack UI - Advanced sg-enabled zone - VM Wizard - step 5 - select network
screen - populate only sg networks (i.e. not show non-sg networks).


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/cc24bebc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/cc24bebc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/cc24bebc

Branch: refs/heads/ui-plugins
Commit: cc24bebcb6c6f3bddcdb7bd26d7f6a7556c16c07
Parents: a02c665
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Thu Feb 7 13:19:55 2013 -0800
Committer: Jessica Wang <jessica.wang@citrix.com>
Committed: Thu Feb 7 13:19:55 2013 -0800

----------------------------------------------------------------------
 ui/scripts/instanceWizard.js |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cc24bebc/ui/scripts/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index e5e2fb7..d9260b0 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -360,14 +360,11 @@
 					canusefordeploy: true
         };
 				
-				// step5ContainerType of Advanced SG-enabled zone is 'select-security-group', so won't
come into this block
-				/*
 				if(selectedZoneObj.networktype == 'Advanced' && selectedZoneObj.securitygroupsenabled
== true) {
 				  $.extend(networkData, {
 					  type: 'Shared'
 					});
-				}
-				*/
+				}				
 				
         if (!(cloudStack.context.projects && cloudStack.context.projects[0])) {
           networkData.domainid = g_domainid;
@@ -386,22 +383,31 @@
           }
         });
         
+				var networkObjsToPopulate = [];
         $.ajax({
           url: createURL('listNetworks'),
           data: networkData,
           async: false,
           success: function(json) {
-            networkObjs = json.listnetworksresponse.network ? json.listnetworksresponse.network
: [];
-
+            networkObjs = json.listnetworksresponse.network ? json.listnetworksresponse.network
: [];            
 						if(networkObjs.length > 0) {
 						  for(var i = 0; i < networkObjs.length; i++) {
 								var networkObj = networkObjs[i];    
+								var includingSecurityGroup = false;
 								var serviceObjArray = networkObj.service;
 								for(var k = 0; k < serviceObjArray.length; k++) {
 									if(serviceObjArray[k].name == "SecurityGroup") {
-									  networkObjs[i].type = networkObjs[i].type + ' (sg)';																		
+									  networkObjs[i].type = networkObjs[i].type + ' (sg)';	
+                    includingSecurityGroup = true;
+										break;   								
 									}
-								}
+								}								
+								//for Advanced SG-enabled zone, list only SG network offerings 
+								if(selectedZoneObj.networktype == 'Advanced' && selectedZoneObj.securitygroupsenabled
== true) {
+									if(includingSecurityGroup == false)
+										continue; //skip to next network offering
+								}										
+								networkObjsToPopulate.push(networkObj);		
 							}
             }						
           }
@@ -439,7 +445,7 @@
         args.response.success({
           type: 'select-network',
           data: {            
-            networkObjs: networkObjs,
+            networkObjs: networkObjsToPopulate,
             securityGroups: [],
             networkOfferings: networkOfferingObjs,
             vpcs: vpcObjs


Mime
View raw message