Skip to content

Commit bcd60da

Browse files
author
Jessica Wang
committed
CLOUDSTACK-496: cloudstack UI - zone wizard - replace Isolation mode VLAN/SecurityGroup radio buttons with one single checkbox SecurityGroup.
1 parent 57aeb17 commit bcd60da

1 file changed

Lines changed: 17 additions & 21 deletions

File tree

‎ui/scripts/zoneWizard.js‎

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
$('.setup-guest-traffic').removeClass('basic');
254254
$('.setup-guest-traffic').addClass('advanced');
255255

256-
if(args.data["zone-isolation-mode"] == "VLAN") {
256+
if(args.data["zone-advanced-sg-enabled"] != "on") {
257257
//skip the step if OVS tunnel manager is enabled
258258
skipGuestTrafficStep = false; //reset it before ajax call
259259
$.ajax({
@@ -276,7 +276,7 @@
276276
}
277277
});
278278
}
279-
else { //args.data["zone-isolation-mode"] == "SG"
279+
else { //args.data["zone-advanced-sg-enabled"] == "on"
280280
skipGuestTrafficStep = true;
281281
}
282282
}
@@ -309,10 +309,10 @@
309309
}
310310
else { //args.data['network-model'] == 'Advanced'
311311
args.$form.find('[rel=networkOfferingId]').hide();
312-
313-
if(args.data["zone-isolation-mode"] == "VLAN")
312+
313+
if(args.data["zone-advanced-sg-enabled"] != "on")
314314
args.$form.find('[rel=guestcidraddress]').show();
315-
else //args.data["zone-isolation-mode"] == "SG"
315+
else //args.data["zone-advanced-sg-enabled"] == "on
316316
args.$form.find('[rel=guestcidraddress]').hide();
317317
}
318318

@@ -1264,20 +1264,16 @@
12641264
var array1 = [];
12651265
var networkType = args.data.zone.networkType; //"Basic", "Advanced"
12661266
array1.push("&networktype=" + todb(networkType));
1267-
if(networkType == "Advanced") {
1268-
1269-
1270-
if(args.data.zone.isolationMode != null) {
1271-
if(args.data.zone.isolationMode == "VLAN") {
1272-
array1.push("&securitygroupenabled=false");
1273-
1274-
if(args.data.zone.guestcidraddress != null && args.data.zone.guestcidraddress.length > 0)
1275-
array1.push("&guestcidraddress=" + todb(args.data.zone.guestcidraddress));
1276-
}
1277-
else { // args.data.zone.isolationMode == "SG"
1278-
array1.push("&securitygroupenabled=true");
1279-
}
1280-
}
1267+
if(networkType == "Advanced") {
1268+
if(args.data.zone.sgEnabled != true) {
1269+
array1.push("&securitygroupenabled=false");
1270+
1271+
if(args.data.zone.guestcidraddress != null && args.data.zone.guestcidraddress.length > 0)
1272+
array1.push("&guestcidraddress=" + todb(args.data.zone.guestcidraddress));
1273+
}
1274+
else { // args.data.zone.sgEnabled == true
1275+
array1.push("&securitygroupenabled=true");
1276+
}
12811277
}
12821278

12831279
array1.push("&name=" + todb(args.data.zone.name));
@@ -2457,10 +2453,10 @@
24572453
array1.push("&forVirtualNetwork=true");
24582454
}
24592455
else if(args.data.zone.networkType == "Advanced") {
2460-
if(args.data.zone.isolationMode == "VLAN") { //VLAN
2456+
if(args.data.zone.sgEnabled != true) {
24612457
array1.push("&forVirtualNetwork=true");
24622458
}
2463-
else { //Security Group
2459+
else { //args.data.zone.sgEnabled == true
24642460
array1.push("&forVirtualNetwork=false");
24652461
}
24662462
}

0 commit comments

Comments
 (0)