You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2012/08/12 22:20:33 UTC

[26/50] [abbrv] git commit: CS-15883: cloudstack 3.0 UI - VPC - VM Wizard - step 1 - zone dropdown - populate only one zone, the one that the VPC is under.

CS-15883: cloudstack 3.0 UI - VPC - VM Wizard - step 1 - zone dropdown - populate only one zone, the one that the VPC is under.


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

Branch: refs/heads/master
Commit: 60f1dbe572900b6805b4c6b573abcb924626138e
Parents: df4a4a6
Author: Jessica Wang <je...@citrix.com>
Authored: Thu Aug 9 17:07:09 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Thu Aug 9 17:09:19 2012 -0700

----------------------------------------------------------------------
 ui/scripts/instanceWizard.js |   43 +++++++++++++++++++------------------
 1 files changed, 22 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/60f1dbe5/ui/scripts/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index f2830a8..31025a0 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -36,28 +36,29 @@
 
     // Data providers for each wizard step
     steps: [
-      // Step 1: Setup
-      function(args) {
-      $.ajax({
-        url: createURL("listZones&available=true"),
-        dataType: "json",
-        async: false,
-        success: function(json) {
-          zoneObjs = json.listzonesresponse.zone;
-										
-					var items;
-					if(args.initArgs.pluginForm != null && args.initArgs.pluginForm.name == "vpcTierInstanceWizard") { //from VPC Tier chart
-					  items = $.grep(zoneObjs, function(zoneObj) {						  
-							return zoneObj.networktype == 'Advanced';
-						});
+    
+		// 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'
+				}];	        		
+				args.response.success({ data: {zones: zoneObjs}});
+			}
+			else { //from Instance page 			 
+				$.ajax({
+					url: createURL("listZones&available=true"),
+					dataType: "json",
+					async: false,
+					success: function(json) {
+						zoneObjs = json.listzonesresponse.zone;						
+						args.response.success({ data: {zones: zoneObjs}});
 					}
-			    else { //from Instance page 
-            items = zoneObjs;
-          }		         			
-					
-          args.response.success({ data: {zones: items}});
-        }
-      });
+				});				
+			}		
     },
 
     // Step 2: Select template