Skip to content

Commit 4c89be1

Browse files
committed
CLOUDSTACK-4089: (WIP) Add new fields to zone wizard for configuring traffic type for VMware
1 parent 554c8b7 commit 4c89be1

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

‎client/WEB-INF/classes/resources/messages.properties‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
label.switch.type=Switch Type
1718
label.service.state=Service State
1819
label.egress.default.policy=Egress Default Policy
1920
label.routing=Routing

‎ui/dictionary.jsp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ under the License.
2525
<% long now = System.currentTimeMillis(); %>
2626
<script language="javascript">
2727
dictionary = {
28+
'label.switch.type': '<fmt:message key="label.switch.type" />',
2829
'label.service.state': '<fmt:message key="label.service.state" />',
2930
'label.egress.default.policy': '<fmt:message key="label.egress.default.policy" />',
3031
'label.routing': '<fmt:message key="label.routing" />',

‎ui/scripts/ui-custom/zoneWizard.js‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,36 @@
295295
var trafficData = $trafficType.data('traffic-type-data') ?
296296
$trafficType.data('traffic-type-data') : {};
297297
var hypervisor = getData($trafficType.closest('.zone-wizard')).zone.hypervisor;
298+
var fields = {
299+
label: {
300+
label: hypervisor + ' ' + _l('label.traffic.label'),
301+
defaultValue: trafficData.label
302+
}
303+
};
304+
305+
if (hypervisor === 'VMware') {
306+
$.extend(fields, {
307+
vlanid: { label: 'VLAN ID' },
308+
switchType: {
309+
label: 'label.switch.type',
310+
select: function(args) {
311+
args.response.success({
312+
data: [
313+
{ id: 'vmwaresvs', description: 'VMware SVS' },
314+
{ id: 'vmwaredvs', description: 'VMware DVS' },
315+
{ id: 'nexusdvs', description: 'Nexus DVS' }
316+
]
317+
});
318+
}
319+
}
320+
});
321+
}
298322

299323
cloudStack.dialog.createForm({
300324
form: {
301325
title: _l('label.edit.traffic.type'),
302326
desc: _l('message.edit.traffic.type'),
303-
fields: {
304-
label: {
305-
label: hypervisor + ' ' + _l('label.traffic.label'),
306-
defaultValue: trafficData.label
307-
}
308-
}
327+
fields: fields
309328
},
310329

311330
after: function(args) {

0 commit comments

Comments
 (0)