mirror of
https://github.com/unraid/webgui.git
synced 2026-02-24 03:10:39 -06:00
remove leading zeros in IPv4 address
This commit is contained in:
@@ -76,6 +76,7 @@ array_multisort($sort_eth0,$vlan_eth0);
|
||||
refresh(); // automatically include new ethernet ports
|
||||
<?endif;?>
|
||||
Array.prototype.same = function(){return this.sort().filter(function(v,i,o){return i&&v===o[i-1]?v:0;}).length;}
|
||||
String.prototype.peel = function(){return this.split('.').map(Number).join('.');}
|
||||
|
||||
function prepareSettings(form) {
|
||||
var bondnics = [], brnics = [];
|
||||
@@ -109,6 +110,10 @@ function prepareSettings(form) {
|
||||
swal({title:'Duplicate metrics',text:'List of default gateways contains duplicate metric values',type:'error',html:true,confirmButtonText:"_(Ok)_"});
|
||||
return false;
|
||||
}
|
||||
// remove leading zeros in IPv4 address
|
||||
$(form).find('input[name^="IPADDR:"]').each(function(){
|
||||
$(this).val($(this).val().peel());
|
||||
});
|
||||
if (form.TYPE.value == 'access') {
|
||||
$(form).find('input[name^="VLANID:"]').prop('disabled',false).val('');
|
||||
$(form).find('input[name^="DESCRIPTION:"]').not('input[name$=":0"]').prop('disabled',false).val('');
|
||||
|
||||
Reference in New Issue
Block a user