Skip to content

Commit aebcec2

Browse files
author
Jessica Wang
committed
CLOUDSTACK-4142: listNetworkOfferings API has been changed to not return system owned network offerings to regular user. Therefore, change VPC tier detailView to get services from listNetworks API response instead of listNetworkOfferings API response.
1 parent da83e12 commit aebcec2

1 file changed

Lines changed: 23 additions & 25 deletions

File tree

‎ui/scripts/vpc.js‎

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3325,32 +3325,30 @@
33253325
},
33263326

33273327
tabFilter: function(args) {
3328-
var networkOfferingHavingELB = false;
3329-
$.ajax({
3330-
url: createURL("listNetworkOfferings&id=" + args.context.networks[0].networkofferingid),
3331-
dataType: "json",
3332-
async: false,
3333-
success: function(json) {
3334-
var networkoffering = json.listnetworkofferingsresponse.networkoffering[0];
3335-
$(networkoffering.service).each(function() {
3336-
var thisService = this;
3337-
if (thisService.name == "Lb") {
3338-
$(thisService.capability).each(function() {
3339-
if (this.name == "ElasticLb" && this.value == "true") {
3340-
networkOfferingHavingELB = true;
3341-
return false; //break $.each() loop
3342-
}
3343-
});
3344-
return false; //break $.each() loop
3345-
}
3346-
});
3347-
}
3348-
});
3349-
3350-
var hiddenTabs = ['ipAddresses', 'acl']; // Disable IP address tab; it is redundant with 'view all' button
3351-
3352-
if (networkOfferingHavingELB == false)
3328+
var hiddenTabs = ['ipAddresses', 'acl']; // Disable IP address tab; it is redundant with 'view all' button
3329+
3330+
var networkOfferingHavingELB = false;
3331+
var services = args.context.networks[0].service;
3332+
if(services != null) {
3333+
for(var i = 0; i < services.length; i++) {
3334+
if (services[i].name == "Lb") {
3335+
var capabilities = services[i].capability;
3336+
if(capabilities != null) {
3337+
for(var k = 0; k < capabilities.length; k++) {
3338+
if(capabilities[k].name == "ElasticLb") {
3339+
networkOfferingHavingELB = true;
3340+
break;
3341+
}
3342+
}
3343+
}
3344+
break;
3345+
}
3346+
}
3347+
}
3348+
if (networkOfferingHavingELB == false) {
33533349
hiddenTabs.push("addloadBalancer");
3350+
}
3351+
33543352
return hiddenTabs;
33553353
},
33563354

0 commit comments

Comments
 (0)