diff --git a/src/components/PageComponents/Config/Network.tsx b/src/components/PageComponents/Config/Network.tsx index 9d899619..2fd9000d 100644 --- a/src/components/PageComponents/Config/Network.tsx +++ b/src/components/PageComponents/Config/Network.tsx @@ -132,32 +132,32 @@ export const Network = (): JSX.Element => { disabled={!ethEnabled} {...register("ethMode", { valueAsNumber: true })} > - {renderOptions(Protobuf.Config_NetworkConfig_WiFiMode)} + {renderOptions(Protobuf.Config_NetworkConfig_EthMode)} @@ -165,7 +165,6 @@ export const Network = (): JSX.Element => { label="NTP Server" description="NTP server for time synchronization" error={errors.ntpServer?.message} - disabled={!wifiEnabled && !ethEnabled} {...register("ntpServer")} /> diff --git a/src/validation/config/network.ts b/src/validation/config/network.ts index de7489c1..30b4f3cf 100644 --- a/src/validation/config/network.ts +++ b/src/validation/config/network.ts @@ -1,4 +1,4 @@ -import { IsBoolean, IsEnum, IsIP, Length } from "class-validator"; +import { IsBoolean, IsEnum, IsIP, IsOptional, Length } from "class-validator"; import { Protobuf } from "@meshtastic/meshtasticjs"; @@ -9,10 +9,12 @@ export class NetworkValidation implements Protobuf.Config_NetworkConfig { @IsEnum(Protobuf.Config_NetworkConfig_WiFiMode) wifiMode: Protobuf.Config_NetworkConfig_WiFiMode; - @Length(1, 33) + @Length(0, 33) //min 1 + @IsOptional({}) wifiSsid: string; - @Length(8, 64) + @Length(0, 64) //min 8 + @IsOptional() wifiPsk: string; @Length(2, 30) @@ -31,14 +33,18 @@ export class NetworkValidation_IpV4Config implements Protobuf.Config_NetworkConfig_IpV4Config { @IsIP() + @IsOptional() ip: number; @IsIP() + @IsOptional() gateway: number; @IsIP() + @IsOptional() subnet: number; @IsIP() + @IsOptional() dns: number; }