mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-15 23:13:07 +01:00
allow to change the Wifi AP Ip address and mask
This commit is contained in:
15
web/index.js
15
web/index.js
@@ -186,6 +186,21 @@ function checkAdminPass(v){
|
||||
return checkApPass(v);
|
||||
}
|
||||
|
||||
function checkApIp(v,allValues){
|
||||
if (! v) return "cannot be empty";
|
||||
let err1="must be in the form 192.168.x.x";
|
||||
if (! v.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/))return err1;
|
||||
let parts=v.split(".");
|
||||
if (parts.length != 4) return err1;
|
||||
for (let idx=0;idx < 4;idx++){
|
||||
let iv=parseInt(parts[idx]);
|
||||
if (iv < 0 || iv > 255) return err1;
|
||||
}
|
||||
}
|
||||
function checkNetMask(v,allValues){
|
||||
return checkApIp(v,allValues);
|
||||
}
|
||||
|
||||
function checkIpAddress(v,allValues,def){
|
||||
if (allValues.tclEnabled != "true") return;
|
||||
if (! v) return "cannot be empty";
|
||||
|
||||
Reference in New Issue
Block a user