mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-2038: cloudstack UI - mixed zone management - network menu - show different sections upon selected zone type on top menu.
This commit is contained in:
parent
d146f3d93a
commit
f85ab8a26b
|
|
@ -281,29 +281,7 @@
|
|||
id: 'network',
|
||||
sectionSelect: {
|
||||
preFilter: function(args) {
|
||||
var havingSecurityGroupNetwork = false;
|
||||
var havingBasicZones = false;
|
||||
var havingAdvancedZones = true;
|
||||
|
||||
// Get zone types
|
||||
$.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';
|
||||
});
|
||||
var advancedZones = $.grep(zones, function(zone) {
|
||||
return zone.networktype == 'Advanced';
|
||||
});
|
||||
|
||||
|
||||
havingBasicZones = basicZones.length ? true : false;
|
||||
havingAdvancedZones = advancedZones.length ? true : false;
|
||||
}
|
||||
});
|
||||
var havingSecurityGroupNetwork = false;
|
||||
|
||||
$.ajax({
|
||||
url: createURL('listNetworks', { ignoreProject: true }),
|
||||
|
|
@ -322,11 +300,10 @@
|
|||
|
||||
var sectionsToShow = ['networks'];
|
||||
|
||||
if (havingAdvancedZones) {
|
||||
if(args.context.zoneType != 'Basic') { //Advanced type or all types
|
||||
sectionsToShow.push('vpc');
|
||||
sectionsToShow.push('vpnCustomerGateway');
|
||||
}
|
||||
|
||||
|
||||
if(havingSecurityGroupNetwork == true)
|
||||
sectionsToShow.push('securityGroups');
|
||||
|
|
|
|||
Loading…
Reference in New Issue