mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-4089: UI > zone wizard > hypervisor VMware > configure physical network > edit traffic type label > split "VMware Traffic Label" field into 3 fields: "vSwitch Name", "VLAN ID", "vSwitch Type".
This commit is contained in:
parent
bcd7e48701
commit
ca8580717c
@ -190,8 +190,7 @@
|
||||
var $configuredTrafficTypes = $trafficTypes.filter(function() {
|
||||
var $trafficType = $(this);
|
||||
|
||||
return $trafficType.data('traffic-type-data') &&
|
||||
$trafficType.data('traffic-type-data').label.length >= 1;
|
||||
return ($trafficType.data('traffic-type-data') != null);
|
||||
});
|
||||
|
||||
if ($enabledPhysicalNetworks.size() > 1 &&
|
||||
@ -296,16 +295,56 @@
|
||||
$trafficType.data('traffic-type-data') : {};
|
||||
var hypervisor = getData($trafficType.closest('.zone-wizard')).zone.hypervisor;
|
||||
|
||||
cloudStack.dialog.createForm({
|
||||
form: {
|
||||
title: _l('label.edit.traffic.type'),
|
||||
desc: _l('message.edit.traffic.type'),
|
||||
fields: {
|
||||
var fields;
|
||||
|
||||
if (hypervisor == 'VMware') {
|
||||
fields = {
|
||||
vSwitchName: {
|
||||
label: 'vSwitch Name' ,
|
||||
defaultValue: trafficData.vSwitchName
|
||||
},
|
||||
vlanId: {
|
||||
label: 'VLAN ID',
|
||||
defaultValue: trafficData.vlanId
|
||||
}
|
||||
};
|
||||
|
||||
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
|
||||
$.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: {
|
||||
label: hypervisor + ' ' + _l('label.traffic.label'),
|
||||
defaultValue: trafficData.label
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
cloudStack.dialog.createForm({
|
||||
form: {
|
||||
title: _l('label.edit.traffic.type'),
|
||||
desc: _l('message.edit.traffic.type'),
|
||||
fields: fields
|
||||
},
|
||||
|
||||
after: function(args) {
|
||||
|
||||
@ -34,7 +34,34 @@
|
||||
physicalNetworkID = zoneType == 'Advanced' ? physicalNetworkID : 0;
|
||||
var physicalNetwork = data.physicalNetworks ? data.physicalNetworks[physicalNetworkID] : null;
|
||||
var trafficConfig = physicalNetwork ? physicalNetwork.trafficTypeConfiguration[trafficTypeID] : null;
|
||||
var trafficLabel = trafficConfig ? trafficConfig.label : null;
|
||||
|
||||
var trafficLabel;
|
||||
if (trafficConfig != null) {
|
||||
if ('label' in trafficConfig) {
|
||||
trafficLabel = trafficConfig.label;
|
||||
}
|
||||
else {
|
||||
trafficLabel = '';
|
||||
|
||||
if ('vSwitchName' in trafficConfig) {
|
||||
trafficLabel += trafficConfig.vSwitchName;
|
||||
}
|
||||
if ('vlanId' in trafficConfig) {
|
||||
if (trafficLabel.length > 0)
|
||||
trafficLabel += ',';
|
||||
trafficLabel += trafficConfig.vlanId;
|
||||
}
|
||||
if ('vSwitchType' in trafficConfig) {
|
||||
if (trafficLabel.length > 0)
|
||||
trafficLabel += ',';
|
||||
trafficLabel += trafficConfig.vSwitchType;
|
||||
}
|
||||
|
||||
if (trafficLabel.length == 0) //trafficLabel == ''
|
||||
trafficLabel = null;
|
||||
}
|
||||
}
|
||||
|
||||
var hypervisorAttr, trafficLabelStr;
|
||||
|
||||
switch (hypervisor) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user