mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
UI > Infrastructure > clusters > Add cluster dialog > change variable name for Nexus DVS fields to be more intuitive.
This commit is contained in:
parent
3b14b66b20
commit
d4d42bb22d
@ -10088,21 +10088,21 @@
|
|||||||
preFilter: function(args) {
|
preFilter: function(args) {
|
||||||
var $form = args.$form;
|
var $form = args.$form;
|
||||||
$form.click(function() {
|
$form.click(function() {
|
||||||
var $vsmFields = $form.find('.form-item').filter(function() {
|
var $nexusDvsOptFields = $form.find('.form-item').filter(function() {
|
||||||
var vsmFields = [
|
var nexusDvsOptFields = [
|
||||||
'vsmipaddress',
|
'vsmipaddress',
|
||||||
'vsmusername',
|
'vsmusername',
|
||||||
'vsmpassword'
|
'vsmpassword'
|
||||||
];
|
];
|
||||||
return $.inArray($(this).attr('rel'), vsmFields) > -1;
|
return $.inArray($(this).attr('rel'), nexusDvsOptFields) > -1;
|
||||||
});
|
});
|
||||||
var $vsmReqFields = $form.find('.form-item').filter(function() {
|
var $nexusDvsReqFields = $form.find('.form-item').filter(function() {
|
||||||
var vsmReqFields = [
|
var nexusDvsReqFields = [
|
||||||
'vsmipaddress_req',
|
'vsmipaddress_req',
|
||||||
'vsmusername_req',
|
'vsmusername_req',
|
||||||
'vsmpassword_req'
|
'vsmpassword_req'
|
||||||
];
|
];
|
||||||
return $.inArray($(this).attr('rel'), vsmReqFields) > -1;
|
return $.inArray($(this).attr('rel'), nexusDvsReqFields) > -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($form.find('.form-item[rel=hypervisor] select').val() == 'VMware' ) {
|
if ($form.find('.form-item[rel=hypervisor] select').val() == 'VMware' ) {
|
||||||
@ -10116,8 +10116,8 @@
|
|||||||
var $overrideGuestTraffic = $form.find('.form-item[rel=overrideguesttraffic] input[type=checkbox]');
|
var $overrideGuestTraffic = $form.find('.form-item[rel=overrideguesttraffic] input[type=checkbox]');
|
||||||
var $vSwitchGuestType = $form.find('.form-item[rel=vSwitchGuestType] select');
|
var $vSwitchGuestType = $form.find('.form-item[rel=vSwitchGuestType] select');
|
||||||
|
|
||||||
//***** 'vmware.use.dvswitch' : whether to show override traffic checkbox (begin) *****
|
|
||||||
var dvSwitchEnabled = false;
|
var useDvs = false;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listConfigurations'),
|
url: createURL('listConfigurations'),
|
||||||
data: {
|
data: {
|
||||||
@ -10126,16 +10126,15 @@
|
|||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||||
dvSwitchEnabled = true;
|
useDvs = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (dvSwitchEnabled == true) {
|
if (useDvs == true) { //If using Distributed vswitch, there is OverrideTraffic option.
|
||||||
$form.find('.form-item[rel=overridepublictraffic]').css('display', 'inline-block');
|
$form.find('.form-item[rel=overridepublictraffic]').css('display', 'inline-block');
|
||||||
$form.find('.form-item[rel=overrideguesttraffic]').css('display', 'inline-block');
|
$form.find('.form-item[rel=overrideguesttraffic]').css('display', 'inline-block');
|
||||||
|
|
||||||
//'vmware.use.nexus.vswitch': whether to show VSM fields (begin)
|
var useNexusDvs = false;
|
||||||
var vSwitchEnabled = false;
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listConfigurations'),
|
url: createURL('listConfigurations'),
|
||||||
data: {
|
data: {
|
||||||
@ -10144,27 +10143,26 @@
|
|||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||||
vSwitchEnabled = true;
|
useNexusDvs = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (vSwitchEnabled == true) {
|
if (useNexusDvs == true) { //If using Nexus Distributed vswitch, show Nexus Distributed vswitch fields (either required ones or optional ones).
|
||||||
if (($overridePublicTraffic.is(':checked') && $vSwitchPublicType.val() == 'nexusdvs') ||
|
if (($overridePublicTraffic.is(':checked') && $vSwitchPublicType.val() == 'nexusdvs') ||
|
||||||
($overrideGuestTraffic.is(':checked') && $vSwitchGuestType.val() == 'nexusdvs' )) {
|
($overrideGuestTraffic.is(':checked') && $vSwitchGuestType.val() == 'nexusdvs' )) {
|
||||||
$vsmReqFields.css('display', 'inline-block');
|
$nexusDvsReqFields.css('display', 'inline-block');
|
||||||
$vsmFields.hide();
|
$nexusDvsOptFields.hide();
|
||||||
} else {
|
} else {
|
||||||
$vsmFields.css('display', 'inline-block');
|
$nexusDvsOptFields.css('display', 'inline-block');
|
||||||
$vsmReqFields.hide();
|
$nexusDvsReqFields.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { //vSwitchEnabled == false
|
} else { //If not using Nexus Distributed vswitch, hide Nexus Distributed vswitch fields.
|
||||||
$vsmFields.hide();
|
$nexusDvsOptFields.hide();
|
||||||
$vsmReqFields.hide();
|
$nexusDvsReqFields.hide();
|
||||||
}
|
}
|
||||||
//***** 'vmware.use.dvswitch' : whether to show override traffic checkbox (end) *****
|
|
||||||
|
|
||||||
} else { //dvSwitchEnabled == false
|
} else { //useDvs == false
|
||||||
$form.find('.form-item[rel=overridepublictraffic]').css('display', 'none');
|
$form.find('.form-item[rel=overridepublictraffic]').css('display', 'none');
|
||||||
$form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
|
$form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
|
||||||
$form.find('.form-item[rel=vSwitchPublicName]').css('display', 'none');
|
$form.find('.form-item[rel=vSwitchPublicName]').css('display', 'none');
|
||||||
@ -10173,10 +10171,10 @@
|
|||||||
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
|
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
|
||||||
$form.find('.form-item[rel=vSwitchGuestName]').css('display', 'none');
|
$form.find('.form-item[rel=vSwitchGuestName]').css('display', 'none');
|
||||||
|
|
||||||
$vsmFields.hide();
|
$nexusDvsOptFields.hide();
|
||||||
$vsmReqFields.hide();
|
$nexusDvsReqFields.hide();
|
||||||
}
|
}
|
||||||
//***** 'vmware.use.dvswitch' (end) *****
|
|
||||||
|
|
||||||
} else { //XenServer, KVM, etc (non-VMware)
|
} else { //XenServer, KVM, etc (non-VMware)
|
||||||
$form.find('.form-item[rel=vCenterHost]').css('display', 'none');
|
$form.find('.form-item[rel=vCenterHost]').css('display', 'none');
|
||||||
@ -10187,8 +10185,8 @@
|
|||||||
|
|
||||||
$form.find('.form-item[rel=overridepublictraffic]').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=overrideguesttraffic]').css('display', 'none');
|
||||||
$vsmFields.hide();
|
$nexusDvsOptFields.hide();
|
||||||
$vsmReqFields.hide();
|
$nexusDvsReqFields.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($form.find('.form-item[rel=overridepublictraffic]').css('display') != 'none' && $overridePublicTraffic.is(':checked')) {
|
if ($form.find('.form-item[rel=overridepublictraffic]').css('display') != 'none' && $overridePublicTraffic.is(':checked')) {
|
||||||
@ -10396,7 +10394,7 @@
|
|||||||
vSwitchPublicType: {
|
vSwitchPublicType: {
|
||||||
label: 'Public Traffic vSwitch Type',
|
label: 'Public Traffic vSwitch Type',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
var vSwitchEnabled = false;
|
var useNexusDvs = false;
|
||||||
var items = []
|
var items = []
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listConfigurations'),
|
url: createURL('listConfigurations'),
|
||||||
@ -10406,12 +10404,12 @@
|
|||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||||
vSwitchEnabled = true;
|
useNexusDvs = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (vSwitchEnabled) {
|
if (useNexusDvs) {
|
||||||
items.push({
|
items.push({
|
||||||
id: "nexusdvs",
|
id: "nexusdvs",
|
||||||
description: "Cisco Nexus 1000v Distributed Virtual Switch"
|
description: "Cisco Nexus 1000v Distributed Virtual Switch"
|
||||||
@ -10465,7 +10463,7 @@
|
|||||||
select: function(args) {
|
select: function(args) {
|
||||||
var items = []
|
var items = []
|
||||||
|
|
||||||
var vSwitchEnabled = false;
|
var useNexusDvs = false;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listConfigurations'),
|
url: createURL('listConfigurations'),
|
||||||
data: {
|
data: {
|
||||||
@ -10474,13 +10472,13 @@
|
|||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||||
vSwitchEnabled = true;
|
useNexusDvs = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (vSwitchEnabled) {
|
if (useNexusDvs) {
|
||||||
items.push({
|
items.push({
|
||||||
id: "nexusdvs",
|
id: "nexusdvs",
|
||||||
description: "Cisco Nexus 1000v Distributed Virtual Switch"
|
description: "Cisco Nexus 1000v Distributed Virtual Switch"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user