CLOUDSTACK-6722: [OVS][UI] Network created with StretchedL2Subnet is not available for vm deployement in other zones

This commit is contained in:
Gabor Apati-Nagy 2014-06-02 17:59:59 +01:00 committed by Brian Federle
parent a698c3e276
commit 3077510838
1 changed files with 41 additions and 0 deletions

View File

@ -509,6 +509,47 @@
}
});
//In addition to the networks in the current zone, find networks in other zones that have stretchedL2subnet==true
//capability and show them on the UI
var allOtherAdvancedZones = [];
$.ajax({
url: createURL('listZones'),
dataType: "json",
async: false,
success: function(json) {
var result = $.grep(json.listzonesresponse.zone, function(zone) {
return (zone.networktype == 'Advanced');
});
$(result).each(function() {
if (selectedZoneObj.id != this.id)
allOtherAdvancedZones.push(this);
});
}
});
if (allOtherAdvancedZones.length > 0) {
for (var i = 0; i < allOtherAdvancedZones.length; i++) {
var networkDataForZone = {
zoneId: allOtherAdvancedZones[i].id,
canusefordeploy: true
};
$.ajax({
url: createURL('listNetworks'),
data: networkDataForZone,
async: false,
success: function(json) {
var networksInThisZone = json.listnetworksresponse.network ? json.listnetworksresponse.network : [];
if (networksInThisZone.length > 0) {
for (var i = 0; i < networksInThisZone.length; i++) {
if (networksInThisZone[i].strechedl2subnet) {
networkObjsToPopulate.push(networksInThisZone[i]);
}
}
}
}
});
}
}
$.ajax({
url: createURL("listNetworkOfferings"),
dataType: "json",