- added additional modem settings and ip validation
This commit is contained in:
@@ -184,3 +184,16 @@ export const reverseZoomMapping = (magnification: string) => {
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
export function ValidateIPaddress(ipaddress: string) {
|
||||
if (!ipaddress) {
|
||||
return undefined;
|
||||
} else if (
|
||||
!/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(
|
||||
ipaddress
|
||||
)
|
||||
) {
|
||||
return "Invalid IP";
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user