You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2013/08/26 23:28:52 UTC
git commit: updated refs/heads/master to ca85807
Updated Branches:
refs/heads/master bcd7e4870 -> ca8580717
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".
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ca858071
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ca858071
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ca858071
Branch: refs/heads/master
Commit: ca8580717cbba227c085a8815f4859674db1710e
Parents: bcd7e48
Author: Jessica Wang <je...@apache.org>
Authored: Mon Aug 26 14:24:22 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Mon Aug 26 14:28:43 2013 -0700
----------------------------------------------------------------------
ui/scripts/ui-custom/zoneWizard.js | 57 +++++++++++++++++++++++++++------
ui/scripts/zoneWizard.js | 29 ++++++++++++++++-
2 files changed, 76 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca858071/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js
index 8af873e..b8f77a4 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -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 &&
@@ -295,20 +294,60 @@
var trafficData = $trafficType.data('traffic-type-data') ?
$trafficType.data('traffic-type-data') : {};
var hypervisor = getData($trafficType.closest('.zone-wizard')).zone.hypervisor;
+
+ 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: {
- label: {
- label: hypervisor + ' ' + _l('label.traffic.label'),
- defaultValue: trafficData.label
- }
- }
+ fields: fields
},
- after: function(args) {
+ after: function(args) {
$trafficType.data('traffic-type-data', args.data);
}
});
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca858071/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index 02a68db..5811909 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -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) {