fix dhcp initial values

This commit is contained in:
Ildar Kamalov
2025-02-14 15:52:36 +03:00
parent e7a8db7afd
commit 14a2685ae3
2 changed files with 3 additions and 11 deletions

View File

@@ -77,14 +77,6 @@ const FormDHCPv6 = ({ processingConfig, ipv6placeholders, interfaces, onSubmit }
<Controller
name="v6.range_end"
control={control}
rules={{
validate: isInterfaceIncludesIpv6
? {
ipv6: validateIpv6,
required: validateRequiredValue,
}
: undefined,
}}
render={({ field, fieldState }) => (
<Input
{...field}
@@ -92,7 +84,7 @@ const FormDHCPv6 = ({ processingConfig, ipv6placeholders, interfaces, onSubmit }
data-testid="v6_range_end"
placeholder={t(ipv6placeholders.range_end)}
error={fieldState.error?.message}
disabled={!isInterfaceIncludesIpv6}
disabled
/>
)}
/>

View File

@@ -98,8 +98,8 @@ const Dhcp = () => {
const methods = useForm<DhcpFormValues>({
mode: 'onBlur',
defaultValues: {
v4: v4 || DEFAULT_V4_VALUES,
v6: v6 || DEFAULT_V6_VALUES,
v4,
v6,
interface_name: interfaceName || '',
},
});