Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8FD66F5AB for ; Mon, 15 Apr 2013 20:56:44 +0000 (UTC) Received: (qmail 67462 invoked by uid 500); 15 Apr 2013 20:56:44 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 67421 invoked by uid 500); 15 Apr 2013 20:56:44 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 67412 invoked by uid 99); 15 Apr 2013 20:56:44 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Apr 2013 20:56:44 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1ACA41B871; Mon, 15 Apr 2013 20:56:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jessicawang@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/ui-mixed-zone-management to d146f3d Date: Mon, 15 Apr 2013 20:56:44 +0000 (UTC) Updated Branches: refs/heads/ui-mixed-zone-management fa8b83581 -> d146f3d93 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/ui-mixed-zone-management Commit: d146f3d93aef1ea0b95ad3f6b81647fe926f5d53 Parents: fa8b835 Author: Jessica Wang Authored: Mon Apr 15 13:55:51 2013 -0700 Committer: Jessica Wang 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}}); } });