Fix fixed ip switch issues

This commit is contained in:
Calvo 2022-08-08 10:23:11 +02:00
parent 33f9972293
commit ced2a0837c
1 changed files with 15 additions and 1 deletions

View File

@ -309,7 +309,7 @@ $table_ip .= '<div class="label_select_child_right">'.html_print_input(
'name' => 'fixed_ip',
'value' => $fixed_ip,
],
).__('Fix IP').ui_print_help_tip(__('Avoid automatic IP update when agent IP changes'), true).'</div>';
).__('Fix IP address').ui_print_help_tip(__('Avoid automatic IP address update when agent IP changes.'), true).'</div>';
$table_ip .= '</div></div>';
@ -1123,5 +1123,19 @@ ui_require_jquery_file('bgiframe');
}
$("#text-agente").prop('readonly', true);
// Disable fixed ip button if empty.
if($("#text-direccion").val() == '') {
$("#fixed_ip").prop('disabled',true);
}
$("#text-direccion").on('input',function(e){
if($("#text-direccion").val() == '') {
$("#fixed_ip").prop('disabled',true);
} else {
$("#fixed_ip").prop('disabled',false);
}
});
});
</script>