mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
network page - detail view - Add Load Balancer tab - use a network's networkOffering's services instead of network's own services to determine whether or not to show Add Load Balancer tab
This commit is contained in:
parent
57e3a5a0aa
commit
df45347f3f
@ -444,22 +444,31 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
tabFilter: function(args) {
|
tabFilter: function(args) {
|
||||||
var showLbTab = false;
|
var networkOfferingHavingELB = false;
|
||||||
$(args.context.networks[0].service).each(function(){
|
$.ajax({
|
||||||
if(this.name == "Lb") {
|
url: createURL("listNetworkOfferings&id=" + args.context.networks[0].networkofferingid),
|
||||||
$(this.capability).each(function() {
|
dataType: "json",
|
||||||
if(this.name == "ElasticLb") {
|
async: false,
|
||||||
showLbTab = true;
|
success: function(json) {
|
||||||
return false; //break $.each loop
|
var networkoffering = json.listnetworkofferingsresponse.networkoffering[0];
|
||||||
|
$(networkoffering.service).each(function(){
|
||||||
|
var thisService = this;
|
||||||
|
if(thisService.name == "Lb") {
|
||||||
|
$(thisService.capability).each(function(){
|
||||||
|
if(this.name == "ElasticLb" && this.value == "true") {
|
||||||
|
networkOfferingHavingELB = true;
|
||||||
|
return false; //break $.each() loop
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false; //break $.each() loop
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false; //break $.each loop
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var hiddenTabs = [];
|
var hiddenTabs = [];
|
||||||
if(showLbTab == false)
|
if(networkOfferingHavingELB == false)
|
||||||
hiddenTabs.push("loadBalancer");
|
hiddenTabs.push("addloadBalancer");
|
||||||
return hiddenTabs;
|
return hiddenTabs;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -592,7 +601,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
loadBalancer: {
|
addloadBalancer: {
|
||||||
title: 'Add load balancer',
|
title: 'Add load balancer',
|
||||||
custom: function(args) {
|
custom: function(args) {
|
||||||
var context = args.context;
|
var context = args.context;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user