Wizard: Add Hostname functionality
This adds a validated hostname input and new tests.
This commit is contained in:
parent
c98b7d9997
commit
5a514d1d04
7 changed files with 153 additions and 4 deletions
|
|
@ -90,3 +90,12 @@ export const isNtpServerValid = (ntpServer: string) => {
|
|||
/^([a-z0-9-]+)?(([.:/]{1,3}[a-z0-9-]+)){1,}$/.test(ntpServer)
|
||||
);
|
||||
};
|
||||
|
||||
export const isHostnameValid = (hostname: string) => {
|
||||
if (hostname !== '') {
|
||||
return /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/.test(
|
||||
hostname
|
||||
);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue