mirror of https://github.com/apache/cloudstack.git
Networks section: Only show VPC dropdown for Advanced zones
This commit is contained in:
parent
3d2d1a2efc
commit
3d8f17119e
|
|
@ -160,6 +160,23 @@
|
|||
sectionSelect: {
|
||||
preFilter: function(args) {
|
||||
var havingSecurityGroupNetwork = false;
|
||||
var havingBasicZones = false;
|
||||
|
||||
// Get basic zones
|
||||
$.ajax({
|
||||
url: createURL('listZones'),
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var zones = json.listzonesresponse.zone ?
|
||||
json.listzonesresponse.zone : [];
|
||||
var basicZones = $.grep(zones, function(zone) {
|
||||
return zone.networktype == 'Basic';
|
||||
});
|
||||
|
||||
havingBasicZones = basicZones.length ? true : false;
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL('listNetworks', { ignoreProject: true }),
|
||||
data: {
|
||||
|
|
@ -174,7 +191,12 @@
|
|||
}
|
||||
});
|
||||
|
||||
var sectionsToShow = ['networks', 'vpc', 'vpnCustomerGateway'];
|
||||
var sectionsToShow = ['networks', 'vpnCustomerGateway'];
|
||||
|
||||
if (!havingBasicZones) {
|
||||
sectionsToShow.push('vpc');
|
||||
}
|
||||
|
||||
if(havingSecurityGroupNetwork == true)
|
||||
sectionsToShow.push('securityGroups');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue