CLOUDSTACK-4089: (WIP) Add new fields to zone wizard for configuring traffic type for VMware
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4c89be14 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4c89be14 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4c89be14 Branch: refs/heads/master Commit: 4c89be144afa7b66d7d108755587d25692e68fb3 Parents: 554c8b7 Author: Brian Federle <[email protected]> Authored: Mon Aug 5 12:08:03 2013 -0700 Committer: Brian Federle <[email protected]> Committed: Mon Aug 5 12:08:28 2013 -0700 ---------------------------------------------------------------------- .../classes/resources/messages.properties | 1 + ui/dictionary.jsp | 1 + ui/scripts/ui-custom/zoneWizard.js | 31 ++++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c89be14/client/WEB-INF/classes/resources/messages.properties ---------------------------------------------------------------------- diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 3920934..41284f1 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +label.switch.type=Switch Type label.service.state=Service State label.egress.default.policy=Egress Default Policy label.routing=Routing http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c89be14/ui/dictionary.jsp ---------------------------------------------------------------------- diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index 3f58c59..394700c 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -25,6 +25,7 @@ under the License. <% long now = System.currentTimeMillis(); %> <script language="javascript"> dictionary = { +'label.switch.type': '<fmt:message key="label.switch.type" />', 'label.service.state': '<fmt:message key="label.service.state" />', 'label.egress.default.policy': '<fmt:message key="label.egress.default.policy" />', 'label.routing': '<fmt:message key="label.routing" />', http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c89be14/ui/scripts/ui-custom/zoneWizard.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js index 8af873e..64dac26 100644 --- a/ui/scripts/ui-custom/zoneWizard.js +++ b/ui/scripts/ui-custom/zoneWizard.js @@ -295,17 +295,36 @@ var trafficData = $trafficType.data('traffic-type-data') ? $trafficType.data('traffic-type-data') : {}; var hypervisor = getData($trafficType.closest('.zone-wizard')).zone.hypervisor; + var fields = { + label: { + label: hypervisor + ' ' + _l('label.traffic.label'), + defaultValue: trafficData.label + } + }; + + if (hypervisor === 'VMware') { + $.extend(fields, { + vlanid: { label: 'VLAN ID' }, + switchType: { + label: 'label.switch.type', + select: function(args) { + args.response.success({ + data: [ + { id: 'vmwaresvs', description: 'VMware SVS' }, + { id: 'vmwaredvs', description: 'VMware DVS' }, + { id: 'nexusdvs', description: 'Nexus DVS' } + ] + }); + } + } + }); + } 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) {
