Skip to content

Commit 680a360

Browse files
committed
Merge branch 'dvswitch-UI'
2 parents 398b049 + b07f482 commit 680a360

2 files changed

Lines changed: 387 additions & 2 deletions

File tree

‎ui/scripts/system.js‎

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7347,6 +7347,7 @@
73477347
docID: 'helpClusterHypervisor',
73487348
select: function(args) {
73497349
var vSwitchEnabled = false;
7350+
var dvSwitchEnabled = false;
73507351

73517352
$.ajax({
73527353
url: createURL("listHypervisors"),
@@ -7375,6 +7376,21 @@
73757376
}
73767377
}
73777378
});
7379+
7380+
//Check whether dvSwitch is enabled or not
7381+
$.ajax({
7382+
url: createURL('listConfigurations'),
7383+
data: {
7384+
name: 'vmware.use.dvswitch'
7385+
},
7386+
async: false,
7387+
success: function(json) {
7388+
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
7389+
dvSwitchEnabled = true;
7390+
}
7391+
}
7392+
});
7393+
73787394

73797395
args.$select.bind("change", function(event) {
73807396
var $form = $(this).closest('form');
@@ -7390,6 +7406,31 @@
73907406

73917407
if ($(this).val() == "VMware") {
73927408
//$('li[input_sub_group="external"]', $dialogAddCluster).show();
7409+
7410+
if(dvSwitchEnabled){
7411+
// $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block');
7412+
// $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block');
7413+
// $form.find('.form-item[rel=vSwitchPublicName]').css('display','inline-block');
7414+
//$form.find('.form-item[rel=vSwitchGuestName]').css('display','inline-block');
7415+
$form.find('.form-item[rel=overridepublictraffic]').css('display','inline-block');
7416+
$form.find('.form-item[rel=overridepublictraffic]').find('input[type=checkbox]').removeAttr('checked');
7417+
7418+
$form.find('.form-item[rel=overrideguesttraffic]').css('display','inline-block');
7419+
$form.find('.form-item[rel=overrideguesttraffic]').find('input[type=checkbox]').removeAttr('checked');
7420+
7421+
7422+
7423+
}
7424+
else {
7425+
// $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
7426+
// $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
7427+
// $form.find('.form-item[rel=vSwitchPublicName]').css('display','none');
7428+
// $form.find('.form-item[rel=vSwitchGuestName]').css('display','none');
7429+
$form.find('.form-item[rel=overridepublictraffic]').css('display','none');
7430+
$form.find('.form-item[rel=overrideguesttraffic]').css('display','none');
7431+
7432+
7433+
}
73937434
$form.find('.form-item[rel=vCenterHost]').css('display', 'inline-block');
73947435
$form.find('.form-item[rel=vCenterUsername]').css('display', 'inline-block');
73957436
$form.find('.form-item[rel=vCenterPassword]').css('display', 'inline-block');
@@ -7401,6 +7442,16 @@
74017442
$vsmFields.css('display', 'none');
74027443
}
74037444
} else {
7445+
7446+
7447+
$form.find('.form-item[rel=overridepublictraffic]').css('display', 'none');
7448+
$form.find('.form-item[rel=overrideguesttraffic]').css('display', 'none');
7449+
$form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
7450+
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
7451+
$form.find('.form-item[rel=vSwitchPublicName]').css('display','none');
7452+
$form.find('.form-item[rel=vSwitchGuestName]').css('display','none');
7453+
7454+
74047455
$form.find('.form-item[rel=vCenterHost]').css('display', 'none');
74057456
$form.find('.form-item[rel=vCenterUsername]').css('display', 'none');
74067457
$form.find('.form-item[rel=vCenterPassword]').css('display', 'none');
@@ -7453,6 +7504,7 @@
74537504
},
74547505

74557506
//hypervisor==VMWare begins here
7507+
74567508
vCenterHost: {
74577509
label: 'label.vcenter.host',
74587510
docID: 'helpClustervCenterHost',
@@ -7474,6 +7526,133 @@
74747526
docID: 'helpClustervCenterDatacenter',
74757527
validation: { required: true }
74767528
},
7529+
7530+
overridepublictraffic:{
7531+
label:'Override Public-Traffic',
7532+
isBoolean:true,
7533+
isHidden:true,
7534+
isChecked:false
7535+
7536+
},
7537+
7538+
7539+
vSwitchPublicType:{
7540+
label: 'Public Traffic vSwitch Type',
7541+
select: function(args) {
7542+
var vSwitchEnabled = false;
7543+
var items = []
7544+
$.ajax({
7545+
url: createURL('listConfigurations'),
7546+
data: {
7547+
name: 'vmware.use.nexus.vswitch'
7548+
},
7549+
async: false,
7550+
success: function(json) {
7551+
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
7552+
vSwitchEnabled = true;
7553+
}
7554+
}
7555+
});
7556+
7557+
if(vSwitchEnabled) {
7558+
7559+
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
7560+
7561+
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
7562+
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
7563+
7564+
7565+
7566+
7567+
}
7568+
7569+
// items.push({id: "" , description:" " });
7570+
else{
7571+
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
7572+
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
7573+
7574+
7575+
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
7576+
}
7577+
7578+
args.response.success({data: items});
7579+
},
7580+
isHidden:true,
7581+
dependsOn:'overridepublictraffic'
7582+
},
7583+
7584+
vSwitchPublicName:{
7585+
label:'Public Traffic vSwitch Name',
7586+
dependsOn:'overridepublictraffic',
7587+
isHidden:true
7588+
7589+
7590+
},
7591+
7592+
overrideguesttraffic:{
7593+
label:'Override Guest-Traffic',
7594+
isBoolean:true,
7595+
isHidden:true,
7596+
isChecked:false
7597+
},
7598+
7599+
7600+
vSwitchGuestType:{
7601+
label: 'Guest Traffic vSwitch Type',
7602+
select: function(args) {
7603+
var items = []
7604+
// items.push({id: "" , description:" " });
7605+
7606+
var vSwitchEnabled = false;
7607+
$.ajax({
7608+
url: createURL('listConfigurations'),
7609+
data: {
7610+
name: 'vmware.use.nexus.vswitch'
7611+
},
7612+
async: false,
7613+
success: function(json) {
7614+
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
7615+
vSwitchEnabled = true;
7616+
}
7617+
}
7618+
});
7619+
7620+
7621+
if(vSwitchEnabled){
7622+
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
7623+
7624+
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
7625+
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
7626+
7627+
7628+
}
7629+
7630+
7631+
else{
7632+
7633+
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
7634+
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
7635+
7636+
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
7637+
7638+
7639+
}
7640+
args.response.success({data: items});
7641+
},
7642+
isHidden:true,
7643+
dependsOn:'overrideguesttraffic'
7644+
7645+
},
7646+
7647+
vSwitchGuestName:{
7648+
label:' Guest Traffic vSwitch Name',
7649+
dependsOn:'overrideguesttraffic',
7650+
isHidden:true
7651+
7652+
7653+
},
7654+
7655+
74777656
vsmipaddress: {
74787657
label: 'Nexus 1000v IP Address',
74797658
validation: { required: true },
@@ -7519,6 +7698,21 @@
75197698
if(args.data.hypervisor == "VMware") {
75207699
array1.push("&username=" + todb(args.data.vCenterUsername));
75217700
array1.push("&password=" + todb(args.data.vCenterPassword));
7701+
7702+
//vSwitch Public Type
7703+
if(args.data.vSwitchPublicType != "")
7704+
array1.push("&publicvswitchtype=" + args.data.vSwitchPublicType);
7705+
7706+
if(args.data.vSwitchPublicName != "")
7707+
array1.push("&publicvswitchname=" +args.data.vSwitchPublicName);
7708+
7709+
7710+
//vSwitch Guest Type
7711+
if(args.data.vSwitchGuestType != "")
7712+
array1.push("&guestvswitchtype=" + args.data.vSwitchGuestType);
7713+
7714+
if(args.data.vSwitchGuestName !="")
7715+
array1.push("&guestvswitchname=" +args.data.vSwitchGuestName);
75227716

75237717
if (args.data.vsmipaddress) {
75247718
array1.push('&vsmipaddress=' + args.data.vsmipaddress);

0 commit comments

Comments
 (0)