1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

B #2187: Fix IPv6 size not required with no-SLAAC (#1338)

(cherry picked from commit 8a563b9eefc6f922a6009d693430423bcb013209)
This commit is contained in:
Frederick Borges 2021-06-29 13:20:18 +02:00 committed by Tino Vazquez
parent 567e12cc3d
commit a41835a124
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
2 changed files with 11 additions and 6 deletions

View File

@ -92,9 +92,11 @@ define(function(require) {
if(slaac){
$('.slaac_true', ar_section).show();
$('.slaac_false', ar_section).hide();
$('input#'+str_ar_tab_id+'_size',ar_section).attr("required", "required");
}else{
$('.slaac_true', ar_section).hide();
$('.slaac_false', ar_section).show();
$('input#'+str_ar_tab_id+'_size',ar_section).removeAttr("required");
}
});
@ -166,8 +168,11 @@ define(function(require) {
var field=$(this);
if (field.val() != null && field.val().length){ //if has a length
if (field.attr('name') === "SLAAC" && field[0].checked) {
data[field.attr('name')] = "on";
if (field.attr('name') === "SLAAC") {
if (field[0].checked)
data[field.attr('name')] = "on";
else
data[field.attr('name')] = "off";
} else {
data[field.attr('name')] = field.val();
}

View File

@ -35,10 +35,10 @@
<label for="{{str_ar_tab_id}}_size">{{tr "Size"}}</label>
<input wizard_field="SIZE" required type="number" min="0" name="SIZE" id="{{str_ar_tab_id}}_size" />
</div>
<div class="medium-6 columns collapse ar_input type_ip4_6 type_ip6 switch left">
<label for="{{str_ar_tab_id}}_">{{tr "SLAAC"}}</label>
<input class="switch-input slaac" id="{{str_ar_tab_id}}_slaac" name="SLAAC" type="checkbox">
<label class="switch-paddle" for="{{str_ar_tab_id}}_slaac"></label>
<div class="medium-6 columns collapse ar_input type_ip4_6 type_ip6 switch left" style="margin-bottom:28px" >
<label for="{{str_ar_tab_id}}_">{{tr "SLAAC"}}</label>
<input class="switch-input slaac" id="{{str_ar_tab_id}}_slaac" name="SLAAC" type="checkbox">
<label class="switch-paddle" for="{{str_ar_tab_id}}_slaac"></label>
</div>
</div>
<div class="row slaac_true">