CLOUDSTACK-4089: (WIP) Add new fields to zone wizard for configuring traffic type for VMware

This commit is contained in:
Brian Federle 2013-08-05 12:08:03 -07:00
parent 554c8b7ac1
commit 4c89be144a
3 changed files with 27 additions and 6 deletions

View File

@ -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

View File

@ -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" />',

View File

@ -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) {