|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import type { NetworkValidation } from "@app/validation/config/network.tsx"; |
|
|
|
import type { NetworkValidation } from "@app/validation/config/network.ts"; |
|
|
|
import { create } from "@bufbuild/protobuf"; |
|
|
|
import { DynamicForm } from "@components/Form/DynamicForm.tsx"; |
|
|
|
import { useDevice } from "@core/stores/deviceStore.ts"; |
|
|
|
@ -12,6 +12,9 @@ export const Network = () => { |
|
|
|
const { config, setWorkingConfig } = useDevice(); |
|
|
|
|
|
|
|
const onSubmit = (data: NetworkValidation) => { |
|
|
|
|
|
|
|
console.log("Network data", data); |
|
|
|
|
|
|
|
setWorkingConfig( |
|
|
|
create(Protobuf.Config.ConfigSchema, { |
|
|
|
payloadVariant: { |
|
|
|
@ -21,7 +24,7 @@ export const Network = () => { |
|
|
|
ipv4Config: create( |
|
|
|
Protobuf.Config.Config_NetworkConfig_IpV4ConfigSchema, |
|
|
|
{ |
|
|
|
ip: convertIpAddressToInt(data.ipv4Config.ip) ?? 0, |
|
|
|
ip: convertIpAddressToInt(data?.ipv4Config?.ip) ?? 0, |
|
|
|
gateway: convertIpAddressToInt(data.ipv4Config.gateway) ?? 0, |
|
|
|
subnet: convertIpAddressToInt(data.ipv4Config.subnet) ?? 0, |
|
|
|
dns: convertIpAddressToInt(data.ipv4Config.dns) ?? 0, |
|
|
|
@ -165,6 +168,22 @@ export const Network = () => { |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "UDP Config", |
|
|
|
description: "UDP over Mesh configuration", |
|
|
|
fields: [ |
|
|
|
{ |
|
|
|
type: "select", |
|
|
|
name: "enabledProtocols", |
|
|
|
label: "Mesh via UDP enabled", |
|
|
|
properties: { |
|
|
|
enumValue: |
|
|
|
Protobuf.Config.Config_NetworkConfig_ProtocolFlags, |
|
|
|
formatEnumName: true, |
|
|
|
} |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "NTP Config", |
|
|
|
description: "NTP configuration", |
|
|
|
|