mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-4089: zone wizard > hypervisor VMware > if zoneType is Basic, not show vSwitchType dropdown in Edit Traffic Type for Guest.
This commit is contained in:
parent
0720139117
commit
356a39077e
|
|
@ -294,7 +294,7 @@
|
|||
var trafficData = $trafficType.data('traffic-type-data') ?
|
||||
$trafficType.data('traffic-type-data') : {};
|
||||
var hypervisor = getData($trafficType.closest('.zone-wizard')).zone.hypervisor;
|
||||
|
||||
var zoneType = getData($trafficType.closest('.zone-wizard')).zone.networkType;
|
||||
var fields;
|
||||
|
||||
if (hypervisor == 'VMware') {
|
||||
|
|
@ -309,69 +309,71 @@
|
|||
}
|
||||
};
|
||||
|
||||
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
|
||||
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.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';
|
||||
}
|
||||
}
|
||||
|
||||
$.extend(fields, {
|
||||
vSwitchType: {
|
||||
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
|
||||
}
|
||||
});
|
||||
}
|
||||
if(zoneType == 'Advanced') {
|
||||
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
|
||||
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.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';
|
||||
}
|
||||
}
|
||||
|
||||
$.extend(fields, {
|
||||
vSwitchType: {
|
||||
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 = {
|
||||
label: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue