|
|
@ -78,7 +78,7 @@ type NetworkInterfaceInputMap = Record< |
|
|
|
>; |
|
|
|
>; |
|
|
|
|
|
|
|
|
|
|
|
type NetworkInitFormValues = { |
|
|
|
type NetworkInitFormValues = { |
|
|
|
domainNameServerCSV?: string; |
|
|
|
dns?: string; |
|
|
|
gateway?: string; |
|
|
|
gateway?: string; |
|
|
|
gatewayInterface?: string; |
|
|
|
gatewayInterface?: string; |
|
|
|
networks: Omit<NetworkInput, 'ipAddressInputRef' | 'subnetMaskInputRef'>[]; |
|
|
|
networks: Omit<NetworkInput, 'ipAddressInputRef' | 'subnetMaskInputRef'>[]; |
|
|
@ -148,7 +148,7 @@ const NODE_REQUIRED_NETWORKS: NetworkInput[] = [ |
|
|
|
|
|
|
|
|
|
|
|
const MAX_INTERFACES_PER_NETWORK = 2; |
|
|
|
const MAX_INTERFACES_PER_NETWORK = 2; |
|
|
|
const IT_IDS = { |
|
|
|
const IT_IDS = { |
|
|
|
dnsCSV: 'domainNameServerCSV', |
|
|
|
dnsCSV: 'dns', |
|
|
|
gateway: 'gateway', |
|
|
|
gateway: 'gateway', |
|
|
|
networkInterfaces: (prefix: string) => `${prefix}Interface`, |
|
|
|
networkInterfaces: (prefix: string) => `${prefix}Interface`, |
|
|
|
networkIPAddress: (prefix: string) => `${prefix}IPAddress`, |
|
|
|
networkIPAddress: (prefix: string) => `${prefix}IPAddress`, |
|
|
@ -645,7 +645,7 @@ const NetworkInitForm = forwardRef< |
|
|
|
messageGroupRef.current.setMessageRe?.call(null, re, message), |
|
|
|
messageGroupRef.current.setMessageRe?.call(null, re, message), |
|
|
|
[], |
|
|
|
[], |
|
|
|
); |
|
|
|
); |
|
|
|
const setDomainNameServerCSVInputMessage = useCallback( |
|
|
|
const setDnsInputMessage = useCallback( |
|
|
|
(message?: Message) => setMessage(IT_IDS.dnsCSV, message), |
|
|
|
(message?: Message) => setMessage(IT_IDS.dnsCSV, message), |
|
|
|
[setMessage], |
|
|
|
[setMessage], |
|
|
|
); |
|
|
|
); |
|
|
@ -743,13 +743,13 @@ const NetworkInitForm = forwardRef< |
|
|
|
defaults: { |
|
|
|
defaults: { |
|
|
|
getValue: () => dnsCSVInputRef.current.getValue?.call(null), |
|
|
|
getValue: () => dnsCSVInputRef.current.getValue?.call(null), |
|
|
|
onSuccess: () => { |
|
|
|
onSuccess: () => { |
|
|
|
setDomainNameServerCSVInputMessage(); |
|
|
|
setDnsInputMessage(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
tests: [ |
|
|
|
tests: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
onFailure: () => { |
|
|
|
onFailure: () => { |
|
|
|
setDomainNameServerCSVInputMessage({ |
|
|
|
setDnsInputMessage({ |
|
|
|
children: |
|
|
|
children: |
|
|
|
'Domain name servers should be a comma-separated list of IPv4 addresses without trailing comma(s).', |
|
|
|
'Domain name servers should be a comma-separated list of IPv4 addresses without trailing comma(s).', |
|
|
|
}); |
|
|
|
}); |
|
|
@ -958,7 +958,7 @@ const NetworkInitForm = forwardRef< |
|
|
|
return tests; |
|
|
|
return tests; |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
networkInputs, |
|
|
|
networkInputs, |
|
|
|
setDomainNameServerCSVInputMessage, |
|
|
|
setDnsInputMessage, |
|
|
|
setGatewayInputMessage, |
|
|
|
setGatewayInputMessage, |
|
|
|
setMessage, |
|
|
|
setMessage, |
|
|
|
subnetContains, |
|
|
|
subnetContains, |
|
|
@ -1166,7 +1166,7 @@ const NetworkInitForm = forwardRef< |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
() => ({ |
|
|
|
() => ({ |
|
|
|
get: () => ({ |
|
|
|
get: () => ({ |
|
|
|
domainNameServerCSV: dnsCSVInputRef.current.getValue?.call(null), |
|
|
|
dns: dnsCSVInputRef.current.getValue?.call(null), |
|
|
|
gateway: gatewayInputRef.current.getValue?.call(null), |
|
|
|
gateway: gatewayInputRef.current.getValue?.call(null), |
|
|
|
gatewayInterface, |
|
|
|
gatewayInterface, |
|
|
|
networks: networkInputs.map( |
|
|
|
networks: networkInputs.map( |
|
|
@ -1400,7 +1400,7 @@ const NetworkInitForm = forwardRef< |
|
|
|
testInputToToggleSubmitDisabled({ |
|
|
|
testInputToToggleSubmitDisabled({ |
|
|
|
inputs: { [IT_IDS.dnsCSV]: { value } }, |
|
|
|
inputs: { [IT_IDS.dnsCSV]: { value } }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
setDomainNameServerCSVInputMessage(); |
|
|
|
setDnsInputMessage(); |
|
|
|
}} |
|
|
|
}} |
|
|
|
label="Domain name server(s)" |
|
|
|
label="Domain name server(s)" |
|
|
|
value={xDns} |
|
|
|
value={xDns} |
|
|
|