mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Networks section: Only show VPC dropdown for Advanced zones
This commit is contained in:
parent
ae45ed65c6
commit
21290ef8f1
@ -164,6 +164,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: {
|
||||
@ -178,7 +195,12 @@
|
||||
}
|
||||
});
|
||||
|
||||
var sectionsToShow = ['networks', 'vpc', 'vpnCustomerGateway'];
|
||||
var sectionsToShow = ['networks', 'vpnCustomerGateway'];
|
||||
|
||||
if (!havingBasicZones) {
|
||||
sectionsToShow.push('vpc');
|
||||
}
|
||||
|
||||
if(havingSecurityGroupNetwork == true)
|
||||
sectionsToShow.push('securityGroups');
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user