You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2013/04/21 19:03:19 UTC

[08/49] git commit: updated refs/heads/marvin_refactor to 0b5fe9a

CLOUDSTACK-2038: cloudstack UI - mixed zone management - instance wizard.


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

Branch: refs/heads/marvin_refactor
Commit: d146f3d93aef1ea0b95ad3f6b81647fe926f5d53
Parents: fa8b835
Author: Jessica Wang <je...@citrix.com>
Authored: Mon Apr 15 13:55:51 2013 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Mon Apr 15 13:55:51 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instanceWizard.js |   37 +++++++++++++++++++++++++++----------
 1 files changed, 27 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d146f3d9/ui/scripts/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index e1aeafd..13828c8 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -70,14 +70,19 @@
     steps: [
     
 		// Step 1: Setup
-    function(args) {
-		  if(args.initArgs.pluginForm != null && args.initArgs.pluginForm.name == "vpcTierInstanceWizard") { //from VPC Tier chart			  
-			  //populate only one zone to the dropdown, the zone which the VPC is under.
-				zoneObjs = [{
-				  id: args.context.vpc[0].zoneid, 
-					name: args.context.vpc[0].zonename, 
-					networktype: 'Advanced'
-				}];	        		
+    function(args) {		  
+		  if(args.initArgs.pluginForm != null && args.initArgs.pluginForm.name == "vpcTierInstanceWizard") { //from VPC Tier chart	(VPC is only available in Advanced zone)	 
+				if(args.context.zoneType ==	'Basic'){  //Basic type
+				  zoneObjs = [];				
+        }
+        else { //Advanced type or all types          
+					//populate only one zone to the dropdown, the zone which the VPC is under. (networktype should be 'Advanced' since VPC is only available in Advanced zone)
+					zoneObjs = [{
+						id: args.context.vpc[0].zoneid, 
+						name: args.context.vpc[0].zonename, 
+						networktype: 'Advanced'
+					}];	   
+        }				
 				args.response.success({ data: {zones: zoneObjs}});
 			}
 			else { //from Instance page 			 
@@ -85,8 +90,20 @@
 					url: createURL("listZones&available=true"),
 					dataType: "json",
 					async: false,
-					success: function(json) {
-						zoneObjs = json.listzonesresponse.zone;						
+					success: function(json) {					  
+						if(args.context.zoneType == null || args.context.zoneType == '') { //all types
+						  zoneObjs = json.listzonesresponse.zone;			
+            }
+            else { //Basic type or Advanced type
+              zoneObjs = [];
+							var items = json.listzonesresponse.zone;
+							if(items != null) {
+							  for(var i = 0; i < items.length; i++) {
+								  if(items[i].networktype == args.context.zoneType) 
+								    zoneObjs.push(items[i]);
+								}
+							}
+            }						
 						args.response.success({ data: {zones: zoneObjs}});
 					}
 				});