bug 12614: cloudStack 3.0 new UI - system - Add Zone Wizard - basic zone - when securityGroupsEnabled checkbox is unchecked, exclude network offerings that has securityGroup service.

This commit is contained in:
Jessica Wang 2011-12-19 14:12:17 -08:00
parent 134b38bb2d
commit 3de22e41aa
1 changed files with 17 additions and 3 deletions

View File

@ -2851,23 +2851,37 @@
}
});
var networkOfferingObjsWithoutSG = [];
$.ajax({
url: createURL("listNetworkOfferings&state=Enabled&guestiptype=Shared"),
dataType: "json",
async: false,
success: function(json) {
networkOfferingObjs = json.listnetworkofferingsresponse.networkoffering;
$(networkOfferingObjs).each(function() {
var includingSGP = false;
var serviceObjArray = this.service;
for(var k = 0; k < serviceObjArray.length; k++) {
if(serviceObjArray[k].name == "SecurityGroup") {
includingSGP = true;
break;
}
}
if(includingSGP == false) //withoutSG
networkOfferingObjsWithoutSG.push(this);
});
}
});
args.response.success({
domains: domainObjs,
// Non-security-group-enabled offerings
networkOfferings: networkOfferingObjs,
networkOfferings: networkOfferingObjsWithoutSG,
// Security group-enabled offerings
securityGroupNetworkOfferings: []
securityGroupNetworkOfferings: networkOfferingObjs
});
},