mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-537: cloudstack UI - Advanced sg-enabled zone - VM Wizard - step 5 - select network screen - populate only sg networks (i.e. not show non-sg networks).
This commit is contained in:
parent
a02c66594f
commit
cc24bebcb6
@ -360,14 +360,11 @@
|
|||||||
canusefordeploy: true
|
canusefordeploy: true
|
||||||
};
|
};
|
||||||
|
|
||||||
// step5ContainerType of Advanced SG-enabled zone is 'select-security-group', so won't come into this block
|
|
||||||
/*
|
|
||||||
if(selectedZoneObj.networktype == 'Advanced' && selectedZoneObj.securitygroupsenabled == true) {
|
if(selectedZoneObj.networktype == 'Advanced' && selectedZoneObj.securitygroupsenabled == true) {
|
||||||
$.extend(networkData, {
|
$.extend(networkData, {
|
||||||
type: 'Shared'
|
type: 'Shared'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
if (!(cloudStack.context.projects && cloudStack.context.projects[0])) {
|
if (!(cloudStack.context.projects && cloudStack.context.projects[0])) {
|
||||||
networkData.domainid = g_domainid;
|
networkData.domainid = g_domainid;
|
||||||
@ -386,22 +383,31 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var networkObjsToPopulate = [];
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listNetworks'),
|
url: createURL('listNetworks'),
|
||||||
data: networkData,
|
data: networkData,
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
networkObjs = json.listnetworksresponse.network ? json.listnetworksresponse.network : [];
|
networkObjs = json.listnetworksresponse.network ? json.listnetworksresponse.network : [];
|
||||||
|
|
||||||
if(networkObjs.length > 0) {
|
if(networkObjs.length > 0) {
|
||||||
for(var i = 0; i < networkObjs.length; i++) {
|
for(var i = 0; i < networkObjs.length; i++) {
|
||||||
var networkObj = networkObjs[i];
|
var networkObj = networkObjs[i];
|
||||||
|
var includingSecurityGroup = false;
|
||||||
var serviceObjArray = networkObj.service;
|
var serviceObjArray = networkObj.service;
|
||||||
for(var k = 0; k < serviceObjArray.length; k++) {
|
for(var k = 0; k < serviceObjArray.length; k++) {
|
||||||
if(serviceObjArray[k].name == "SecurityGroup") {
|
if(serviceObjArray[k].name == "SecurityGroup") {
|
||||||
networkObjs[i].type = networkObjs[i].type + ' (sg)';
|
networkObjs[i].type = networkObjs[i].type + ' (sg)';
|
||||||
|
includingSecurityGroup = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//for Advanced SG-enabled zone, list only SG network offerings
|
||||||
|
if(selectedZoneObj.networktype == 'Advanced' && selectedZoneObj.securitygroupsenabled == true) {
|
||||||
|
if(includingSecurityGroup == false)
|
||||||
|
continue; //skip to next network offering
|
||||||
|
}
|
||||||
|
networkObjsToPopulate.push(networkObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -439,7 +445,7 @@
|
|||||||
args.response.success({
|
args.response.success({
|
||||||
type: 'select-network',
|
type: 'select-network',
|
||||||
data: {
|
data: {
|
||||||
networkObjs: networkObjs,
|
networkObjs: networkObjsToPopulate,
|
||||||
securityGroups: [],
|
securityGroups: [],
|
||||||
networkOfferings: networkOfferingObjs,
|
networkOfferings: networkOfferingObjs,
|
||||||
vpcs: vpcObjs
|
vpcs: vpcObjs
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user