From 60cec46333da34937475a98c150e82940ae7baef Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 14 Nov 2012 14:39:54 -0800 Subject: [PATCH] CLOUDSTACK-484: cloudstack UI - zone wizard - Hide Guest CIDR field when Advanced/SecurityGroup is selected. Show it otherwise. --- ui/scripts/zoneWizard.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 6cbcb694234..901ab1e5700 100644 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -304,7 +304,11 @@ } else { //args.data['network-model'] == 'Advanced' args.$form.find('[rel=networkOfferingId]').hide(); - args.$form.find('[rel=guestcidraddress]').show(); + + if(args.data["zone-isolation-mode"] == "VLAN") + args.$form.find('[rel=guestcidraddress]').show(); + else //args.data["zone-isolation-mode"] == "SG" + args.$form.find('[rel=guestcidraddress]').hide(); } setTimeout(function() { @@ -1256,14 +1260,18 @@ var networkType = args.data.zone.networkType; //"Basic", "Advanced" array1.push("&networktype=" + todb(networkType)); if(networkType == "Advanced") { - if(args.data.zone.guestcidraddress != null && args.data.zone.guestcidraddress.length > 0) - array1.push("&guestcidraddress=" + todb(args.data.zone.guestcidraddress)); + - if(args.data.zone.isolationMode != null) { - if(args.data.zone.isolationMode == "SG") - array1.push("&securitygroupenabled=true"); - else if(args.data.zone.isolationMode == "VLAN") - array1.push("&securitygroupenabled=false"); + if(args.data.zone.isolationMode != null) { + if(args.data.zone.isolationMode == "VLAN") { + array1.push("&securitygroupenabled=false"); + + if(args.data.zone.guestcidraddress != null && args.data.zone.guestcidraddress.length > 0) + array1.push("&guestcidraddress=" + todb(args.data.zone.guestcidraddress)); + } + else { // args.data.zone.isolationMode == "SG" + array1.push("&securitygroupenabled=true"); + } } }