Skip to content

Commit

Permalink
fix dhcp initial values
Browse files Browse the repository at this point in the history
  • Loading branch information
IldarKamalov committed Feb 14, 2025
1 parent e7a8db7 commit 14a2685
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
10 changes: 1 addition & 9 deletions client/src/components/Settings/Dhcp/FormDHCPv6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,14 @@ 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}
type="text"
data-testid="v6_range_end"
placeholder={t(ipv6placeholders.range_end)}
error={fieldState.error?.message}
disabled={!isInterfaceIncludesIpv6}
disabled
/>
)}
/>
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Settings/Dhcp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '',
},
});
Expand Down

0 comments on commit 14a2685

Please sign in to comment.