mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Merge branch 'dvswitch-UI'
This commit is contained in:
commit
680a360624
@ -7347,6 +7347,7 @@
|
||||
docID: 'helpClusterHypervisor',
|
||||
select: function(args) {
|
||||
var vSwitchEnabled = false;
|
||||
var dvSwitchEnabled = false;
|
||||
|
||||
$.ajax({
|
||||
url: createURL("listHypervisors"),
|
||||
@ -7375,6 +7376,21 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//Check whether dvSwitch is enabled or not
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.dvswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
dvSwitchEnabled = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
args.$select.bind("change", function(event) {
|
||||
var $form = $(this).closest('form');
|
||||
@ -7390,6 +7406,31 @@
|
||||
|
||||
if ($(this).val() == "VMware") {
|
||||
//$('li[input_sub_group="external"]', $dialogAddCluster).show();
|
||||
|
||||
if(dvSwitchEnabled){
|
||||
// $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block');
|
||||
// $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block');
|
||||
// $form.find('.form-item[rel=vSwitchPublicName]').css('display','inline-block');
|
||||
//$form.find('.form-item[rel=vSwitchGuestName]').css('display','inline-block');
|
||||
$form.find('.form-item[rel=overridepublictraffic]').css('display','inline-block');
|
||||
$form.find('.form-item[rel=overridepublictraffic]').find('input[type=checkbox]').removeAttr('checked');
|
||||
|
||||
$form.find('.form-item[rel=overrideguesttraffic]').css('display','inline-block');
|
||||
$form.find('.form-item[rel=overrideguesttraffic]').find('input[type=checkbox]').removeAttr('checked');
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
// $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
|
||||
// $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
|
||||
// $form.find('.form-item[rel=vSwitchPublicName]').css('display','none');
|
||||
// $form.find('.form-item[rel=vSwitchGuestName]').css('display','none');
|
||||
$form.find('.form-item[rel=overridepublictraffic]').css('display','none');
|
||||
$form.find('.form-item[rel=overrideguesttraffic]').css('display','none');
|
||||
|
||||
|
||||
}
|
||||
$form.find('.form-item[rel=vCenterHost]').css('display', 'inline-block');
|
||||
$form.find('.form-item[rel=vCenterUsername]').css('display', 'inline-block');
|
||||
$form.find('.form-item[rel=vCenterPassword]').css('display', 'inline-block');
|
||||
@ -7401,6 +7442,16 @@
|
||||
$vsmFields.css('display', 'none');
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
$form.find('.form-item[rel=overridepublictraffic]').css('display', 'none');
|
||||
$form.find('.form-item[rel=overrideguesttraffic]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vSwitchPublicName]').css('display','none');
|
||||
$form.find('.form-item[rel=vSwitchGuestName]').css('display','none');
|
||||
|
||||
|
||||
$form.find('.form-item[rel=vCenterHost]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vCenterUsername]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vCenterPassword]').css('display', 'none');
|
||||
@ -7453,6 +7504,7 @@
|
||||
},
|
||||
|
||||
//hypervisor==VMWare begins here
|
||||
|
||||
vCenterHost: {
|
||||
label: 'label.vcenter.host',
|
||||
docID: 'helpClustervCenterHost',
|
||||
@ -7474,6 +7526,133 @@
|
||||
docID: 'helpClustervCenterDatacenter',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
overridepublictraffic:{
|
||||
label:'Override Public-Traffic',
|
||||
isBoolean:true,
|
||||
isHidden:true,
|
||||
isChecked:false
|
||||
|
||||
},
|
||||
|
||||
|
||||
vSwitchPublicType:{
|
||||
label: 'Public Traffic vSwitch Type',
|
||||
select: function(args) {
|
||||
var vSwitchEnabled = false;
|
||||
var items = []
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.nexus.vswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
vSwitchEnabled = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(vSwitchEnabled) {
|
||||
|
||||
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
|
||||
|
||||
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
|
||||
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// items.push({id: "" , description:" " });
|
||||
else{
|
||||
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
|
||||
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
|
||||
|
||||
|
||||
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
|
||||
}
|
||||
|
||||
args.response.success({data: items});
|
||||
},
|
||||
isHidden:true,
|
||||
dependsOn:'overridepublictraffic'
|
||||
},
|
||||
|
||||
vSwitchPublicName:{
|
||||
label:'Public Traffic vSwitch Name',
|
||||
dependsOn:'overridepublictraffic',
|
||||
isHidden:true
|
||||
|
||||
|
||||
},
|
||||
|
||||
overrideguesttraffic:{
|
||||
label:'Override Guest-Traffic',
|
||||
isBoolean:true,
|
||||
isHidden:true,
|
||||
isChecked:false
|
||||
},
|
||||
|
||||
|
||||
vSwitchGuestType:{
|
||||
label: 'Guest Traffic vSwitch Type',
|
||||
select: function(args) {
|
||||
var items = []
|
||||
// items.push({id: "" , description:" " });
|
||||
|
||||
var vSwitchEnabled = false;
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.nexus.vswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
vSwitchEnabled = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if(vSwitchEnabled){
|
||||
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
|
||||
|
||||
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
|
||||
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
else{
|
||||
|
||||
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
|
||||
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
|
||||
|
||||
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
|
||||
|
||||
|
||||
}
|
||||
args.response.success({data: items});
|
||||
},
|
||||
isHidden:true,
|
||||
dependsOn:'overrideguesttraffic'
|
||||
|
||||
},
|
||||
|
||||
vSwitchGuestName:{
|
||||
label:' Guest Traffic vSwitch Name',
|
||||
dependsOn:'overrideguesttraffic',
|
||||
isHidden:true
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
vsmipaddress: {
|
||||
label: 'Nexus 1000v IP Address',
|
||||
validation: { required: true },
|
||||
@ -7519,6 +7698,21 @@
|
||||
if(args.data.hypervisor == "VMware") {
|
||||
array1.push("&username=" + todb(args.data.vCenterUsername));
|
||||
array1.push("&password=" + todb(args.data.vCenterPassword));
|
||||
|
||||
//vSwitch Public Type
|
||||
if(args.data.vSwitchPublicType != "")
|
||||
array1.push("&publicvswitchtype=" + args.data.vSwitchPublicType);
|
||||
|
||||
if(args.data.vSwitchPublicName != "")
|
||||
array1.push("&publicvswitchname=" +args.data.vSwitchPublicName);
|
||||
|
||||
|
||||
//vSwitch Guest Type
|
||||
if(args.data.vSwitchGuestType != "")
|
||||
array1.push("&guestvswitchtype=" + args.data.vSwitchGuestType);
|
||||
|
||||
if(args.data.vSwitchGuestName !="")
|
||||
array1.push("&guestvswitchname=" +args.data.vSwitchGuestName);
|
||||
|
||||
if (args.data.vsmipaddress) {
|
||||
array1.push('&vsmipaddress=' + args.data.vsmipaddress);
|
||||
|
||||
@ -732,7 +732,7 @@
|
||||
});
|
||||
|
||||
var vSwitchEnabled = false;
|
||||
|
||||
var dvSwitchEnabled = false;
|
||||
// Check whether vSwitch capability is enabled
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
@ -747,6 +747,17 @@
|
||||
}
|
||||
});
|
||||
|
||||
//Check whether dvSwitch is enabled or not
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.dvswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) { if (json.listconfigurationsresponse.configuration[0].value == 'true') { dvSwitchEnabled = true;
|
||||
}
|
||||
} });
|
||||
|
||||
args.$select.bind("change", function(event) {
|
||||
var $form = $(this).closest('form');
|
||||
var $vsmFields = $form.find('[rel]').filter(function() {
|
||||
@ -761,6 +772,35 @@
|
||||
|
||||
if($(this).val() == "VMware") {
|
||||
//$('li[input_sub_group="external"]', $dialogAddCluster).show();
|
||||
if(dvSwitchEnabled ){
|
||||
/* $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block');
|
||||
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block');
|
||||
|
||||
$form.find('.form-item[rel=vSwitchPublicName]').css('display','inline-block');
|
||||
$form.find('.form-item[rel=vSwitchGuestName]').css('display','inline-block');
|
||||
|
||||
$form.find('.form-item[rel=overridepublictraffic]').find('input[type=checkbox]').css('display','inline-block');
|
||||
$form.find('.form-item[rel=overrideguesttraffic]').find('input[type=checkbox]').css('display','inline-block');*/
|
||||
|
||||
$form.find('.form-item[rel=overridepublictraffic]').css('display','inline-block');
|
||||
$form.find('.form-item[rel=overridepublictraffic]').find('input[type=checkbox]').removeAttr('checked');
|
||||
|
||||
$form.find('.form-item[rel=overrideguesttraffic]').css('display','inline-block');
|
||||
$form.find('.form-item[rel=overrideguesttraffic]').find('input[type=checkbox]').removeAttr('checked');
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
/* $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vSwitchPublicName]').css('display','none');
|
||||
$form.find('.form-item[rel=vSwitchGuestName]').css('display','none');*/
|
||||
$form.find('.form-item[rel=overridepublictraffic]').css('display','none');
|
||||
$form.find('.form-item[rel=overrideguesttraffic]').css('display','none');
|
||||
|
||||
}
|
||||
|
||||
$form.find('[rel=vCenterHost]').css('display', 'block');
|
||||
$form.find('[rel=vCenterUsername]').css('display', 'block');
|
||||
$form.find('[rel=vCenterPassword]').css('display', 'block');
|
||||
@ -775,6 +815,15 @@
|
||||
}
|
||||
else {
|
||||
//$('li[input_group="vmware"]', $dialogAddCluster).hide();
|
||||
|
||||
$form.find('.form-item[rel=overridepublictraffic]').css('display', 'none');
|
||||
$form.find('.form-item[rel=overrideguesttraffic]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
|
||||
$form.find('.form-item[rel=vSwitchPublicName]').css('display','none');
|
||||
$form.find('.form-item[rel=vSwitchGuestName]').css('display','none');
|
||||
|
||||
|
||||
$form.find('[rel=vCenterHost]').css('display', 'none');
|
||||
$form.find('[rel=vCenterUsername]').css('display', 'none');
|
||||
$form.find('[rel=vCenterPassword]').css('display', 'none');
|
||||
@ -791,6 +840,7 @@
|
||||
},
|
||||
|
||||
//hypervisor==VMWare begins here
|
||||
|
||||
vCenterHost: {
|
||||
label: 'label.vcenter.host',
|
||||
validation: { required: true }
|
||||
@ -808,6 +858,131 @@
|
||||
label: 'label.vcenter.datacenter',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
overridepublictraffic:{
|
||||
label:'Override Public-Traffic',
|
||||
isBoolean:true,
|
||||
isHidden:true
|
||||
|
||||
},
|
||||
|
||||
|
||||
vSwitchPublicType:{
|
||||
label: 'Public Traffic vSwitch Type',
|
||||
select: function(args) {
|
||||
var items = []
|
||||
var vSwitchEnabled = false;
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.nexus.vswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
vSwitchEnabled = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(vSwitchEnabled) {
|
||||
|
||||
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
|
||||
|
||||
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
|
||||
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// items.push({id: " ", description: " "});
|
||||
else{
|
||||
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
|
||||
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
|
||||
|
||||
|
||||
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
|
||||
|
||||
}
|
||||
args.response.success({data: items});
|
||||
},
|
||||
isHidden:true,
|
||||
dependsOn:'overridepublictraffic'
|
||||
},
|
||||
|
||||
vSwitchPublicName:{
|
||||
label:'vSwitch Public Traffic Name',
|
||||
dependsOn:'overridepublictraffic',
|
||||
isHidden:true
|
||||
|
||||
|
||||
},
|
||||
|
||||
overrideguesttraffic:{
|
||||
label:'Override Guest-Traffic',
|
||||
isBoolean:true,
|
||||
isHidden:true
|
||||
|
||||
},
|
||||
|
||||
|
||||
vSwitchGuestType:{
|
||||
label: 'Guest Traffic vSwitch Type',
|
||||
select: function(args) {
|
||||
var items = []
|
||||
//items.push({ id:" ", description:" "});
|
||||
|
||||
var vSwitchEnabled = false;
|
||||
var items = []
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.nexus.vswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
vSwitchEnabled = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(vSwitchEnabled) {
|
||||
|
||||
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
|
||||
|
||||
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
|
||||
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"});
|
||||
items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"});
|
||||
|
||||
items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"});
|
||||
|
||||
}
|
||||
args.response.success({data: items});
|
||||
|
||||
}, isHidden:true,
|
||||
dependsOn:'overrideguesttraffic'
|
||||
|
||||
},
|
||||
|
||||
vSwitchGuestName:{
|
||||
label:'vSwitch Guest Traffic Name',
|
||||
dependsOn:'overrideguesttraffic',
|
||||
isHidden:true
|
||||
|
||||
},
|
||||
|
||||
//Cisco Nexus Vswitch
|
||||
vsmipaddress: {
|
||||
label: 'Nexus 1000v IP Address',
|
||||
validation: { required: true },
|
||||
@ -2917,7 +3092,23 @@
|
||||
array1.push("&username=" + todb(args.data.cluster.vCenterUsername));
|
||||
array1.push("&password=" + todb(args.data.cluster.vCenterPassword));
|
||||
|
||||
if (args.data.cluster.vsmipaddress) { // vSwitch is enabled
|
||||
//dvswitch is enabled
|
||||
if(args.data.cluster.vSwitchPublicType != "")
|
||||
array1.push('&publicvswitchtype=' + args.data.cluster.vSwitchPublicType);
|
||||
|
||||
if(args.data.cluster.vSwitchPublicName != "")
|
||||
array1.push("&publicvswitchname=" +args.data.cluster.vSwitchPublicName);
|
||||
|
||||
|
||||
|
||||
if(args.data.cluster.vSwitchGuestType != "")
|
||||
array1.push('&guestvswitchtype=' + args.data.cluster.vSwitchGuestType);
|
||||
|
||||
if(args.data.cluster.vSwitchGuestName !="")
|
||||
array1.push("&guestvswitchname=" +args.data.cluster.vSwitchGuestName);
|
||||
|
||||
|
||||
if (args.data.cluster.vsmipaddress) { // vSwitch is enabled
|
||||
array1.push('&vsmipaddress=' + args.data.cluster.vsmipaddress);
|
||||
array1.push('&vsmusername=' + args.data.cluster.vsmusername);
|
||||
array1.push('&vsmpassword=' + args.data.cluster.vsmpassword);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user