CLOUDSTACK-9269: Missing field for Switch type for Management and Storage traffic types

Showing vswitchtype for all traffic types in case of VMware.
This commit is contained in:
Nitin Kumar Maharana 2016-02-02 23:23:42 +05:30 committed by Nitin Kumar Maharana
parent decb2e4d2d
commit 13e66c5e78
1 changed files with 49 additions and 51 deletions

View File

@ -310,69 +310,67 @@
};
if(zoneType == 'Advanced') {
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
if(trafficData.vSwitchType == null) {
var useDvs = false;
if(trafficData.vSwitchType == null) {
var useDvs = false;
$.ajax({
url: createURL('listConfigurations'),
data: {
name: 'vmware.use.dvswitch'
},
async: false,
success: function(json) {
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
useDvs = true;
}
}
});
if (useDvs == true) {
var useNexusDvs = false;
$.ajax({
url: createURL('listConfigurations'),
data: {
name: 'vmware.use.dvswitch'
name: 'vmware.use.nexus.vswitch'
},
async: false,
success: function(json) {
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
useDvs = true;
useNexusDvs = true;
}
}
});
if (useDvs == true) {
var useNexusDvs = false;
$.ajax({
url: createURL('listConfigurations'),
data: {
name: 'vmware.use.nexus.vswitch'
},
async: false,
success: function(json) {
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
useNexusDvs = true;
}
}
});
if (useNexusDvs == true) {
trafficData.vSwitchType = 'nexusdvs';
fields.vSwitchName.defaultValue = 'epp0';
} else {
trafficData.vSwitchType = 'vmwaredvs';
fields.vSwitchName.defaultValue = 'dvSwitch0';
}
} else { //useDvs == false
trafficData.vSwitchType = 'vmwaresvs';
fields.vSwitchName.defaultValue = 'vSwitch0';
if (useNexusDvs == true) {
trafficData.vSwitchType = 'nexusdvs';
fields.vSwitchName.defaultValue = 'epp0';
} else {
trafficData.vSwitchType = 'vmwaredvs';
fields.vSwitchName.defaultValue = 'dvSwitch0';
}
}
$.extend(fields, {
vSwitchType: {
label: 'label.vSwitch.type',
select: function (args) {
args.response.success({
data: [{
id: 'nexusdvs',
description: 'Cisco Nexus 1000v Distributed Virtual Switch'
}, {
id: 'vmwaresvs',
description: 'VMware vNetwork Standard Virtual Switch'
}, {
id: 'vmwaredvs',
description: 'VMware vNetwork Distributed Virtual Switch'
}]
});
},
defaultValue: trafficData.vSwitchType
}
});
} else { //useDvs == false
trafficData.vSwitchType = 'vmwaresvs';
fields.vSwitchName.defaultValue = 'vSwitch0';
}
}
$.extend(fields, {
vSwitchType: {
label: 'label.vSwitch.type',
select: function (args) {
args.response.success({
data: [{
id: 'nexusdvs',
description: 'Cisco Nexus 1000v Distributed Virtual Switch'
}, {
id: 'vmwaresvs',
description: 'VMware vNetwork Standard Virtual Switch'
}, {
id: 'vmwaredvs',
description: 'VMware vNetwork Distributed Virtual Switch'
}]
});
},
defaultValue: trafficData.vSwitchType
}
});
}
} else {
fields = {