mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CS-14116: cloudstack 3.0 UI - add guest network dialog: make vlan/gateway/netmask required when network offering is Isolated with no SourceNat.
This commit is contained in:
parent
b8058e7a5e
commit
d6edced466
@ -1258,7 +1258,7 @@
|
|||||||
var selectedNetworkOfferingId = $(this).val();
|
var selectedNetworkOfferingId = $(this).val();
|
||||||
$(networkOfferingObjs).each(function(){
|
$(networkOfferingObjs).each(function(){
|
||||||
if(this.id == selectedNetworkOfferingId) {
|
if(this.id == selectedNetworkOfferingId) {
|
||||||
if(this.guestiptype == "Isolated") {
|
if(this.guestiptype == "Isolated") { //*** Isolated ***
|
||||||
if(this.specifyipranges == false) {
|
if(this.specifyipranges == false) {
|
||||||
$form.find('.form-item[rel=guestStartIp]').hide();
|
$form.find('.form-item[rel=guestStartIp]').hide();
|
||||||
$form.find('.form-item[rel=guestEndIp]').hide();
|
$form.find('.form-item[rel=guestEndIp]').hide();
|
||||||
@ -1268,10 +1268,24 @@
|
|||||||
$form.find('.form-item[rel=guestEndIp]').css('display', 'inline-block');
|
$form.find('.form-item[rel=guestEndIp]').css('display', 'inline-block');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var includingSourceNat = false;
|
||||||
|
var serviceObjArray = this.service;
|
||||||
|
for(var k = 0; k < serviceObjArray.length; k++) {
|
||||||
|
if(serviceObjArray[k].name == "SourceNat") {
|
||||||
|
includingSourceNat = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(includingSourceNat == true) { //Isolated with SourceNat
|
||||||
cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestGateway]')); //make guestGateway optional
|
cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestGateway]')); //make guestGateway optional
|
||||||
cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask optional
|
cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask optional
|
||||||
}
|
}
|
||||||
else { //this.guestiptype == "Shared"
|
else { //Isolated with no SourceNat
|
||||||
|
cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestGateway]')); //make guestGateway required
|
||||||
|
cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask required
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { //*** Shared ***
|
||||||
$form.find('.form-item[rel=guestStartIp]').css('display', 'inline-block');
|
$form.find('.form-item[rel=guestStartIp]').css('display', 'inline-block');
|
||||||
$form.find('.form-item[rel=guestEndIp]').css('display', 'inline-block');
|
$form.find('.form-item[rel=guestEndIp]').css('display', 'inline-block');
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user