diff --git a/package.json b/package.json index aeb79920..e9e1f884 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "homepage": "https://meshtastic.org", "dependencies": { - "@bufbuild/protobuf": "^2.0.0", + "@bufbuild/protobuf": "^1.10.0", "@emeraldpay/hashicon-react": "^0.5.2", "@meshtastic/js": "2.3.7-1", "@radix-ui/react-accordion": "^1.2.0", @@ -63,7 +63,7 @@ }, "devDependencies": { "@biomejs/biome": "^1.8.2", - "@buf/meshtastic_protobufs.bufbuild_es": "2.0.0-20240906232734-3da561588c55.2", + "@buf/meshtastic_protobufs.bufbuild_es": "1.10.0-20240906232734-3da561588c55.1", "@types/chrome": "^0.0.263", "@types/node": "^20.14.9", "@types/react": "^18.3.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2072d627..8e4c4e27 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@bufbuild/protobuf': - specifier: ^2.0.0 - version: 2.0.0 + specifier: ^1.10.0 + version: 1.10.0 '@emeraldpay/hashicon-react': specifier: ^0.5.2 version: 0.5.2 @@ -130,8 +130,8 @@ importers: specifier: ^1.8.2 version: 1.8.2 '@buf/meshtastic_protobufs.bufbuild_es': - specifier: 2.0.0-20240906232734-3da561588c55.2 - version: 2.0.0-20240906232734-3da561588c55.2(@bufbuild/protobuf@2.0.0) + specifier: 1.10.0-20240906232734-3da561588c55.1 + version: 1.10.0-20240906232734-3da561588c55.1(@bufbuild/protobuf@1.10.0) '@types/chrome': specifier: ^0.0.263 version: 0.0.263 @@ -354,13 +354,13 @@ packages: cpu: [x64] os: [win32] - '@buf/meshtastic_protobufs.bufbuild_es@2.0.0-20240906232734-3da561588c55.2': - resolution: {tarball: https://buf.build/gen/npm/v1/@buf/meshtastic_protobufs.bufbuild_es/-/meshtastic_protobufs.bufbuild_es-2.0.0-20240906232734-3da561588c55.2.tgz} + '@buf/meshtastic_protobufs.bufbuild_es@1.10.0-20240906232734-3da561588c55.1': + resolution: {tarball: https://buf.build/gen/npm/v1/@buf/meshtastic_protobufs.bufbuild_es/-/meshtastic_protobufs.bufbuild_es-1.10.0-20240906232734-3da561588c55.1.tgz} peerDependencies: - '@bufbuild/protobuf': ^2.0.0 + '@bufbuild/protobuf': ^1.10.0 - '@bufbuild/protobuf@2.0.0': - resolution: {integrity: sha512-sw2JhwJyvyL0zlhG61aDzOVryEfJg2PDZFSV7i7IdC7nAE41WuXCru3QWLGiP87At0BMzKOoKO/FqEGoKygGZQ==} + '@bufbuild/protobuf@1.10.0': + resolution: {integrity: sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==} '@emeraldpay/hashicon-react@0.5.2': resolution: {integrity: sha512-XCoYKpq8QQOniiSZf5ouzdvXbKfG6q4ICHRqCO/GNofiF0Ra+LR/7+tomHlXVcLPBS9sDAoZQQw/Sr24KRAbJg==} @@ -3340,11 +3340,11 @@ snapshots: '@biomejs/cli-win32-x64@1.8.2': optional: true - '@buf/meshtastic_protobufs.bufbuild_es@2.0.0-20240906232734-3da561588c55.2(@bufbuild/protobuf@2.0.0)': + '@buf/meshtastic_protobufs.bufbuild_es@1.10.0-20240906232734-3da561588c55.1(@bufbuild/protobuf@1.10.0)': dependencies: - '@bufbuild/protobuf': 2.0.0 + '@bufbuild/protobuf': 1.10.0 - '@bufbuild/protobuf@2.0.0': {} + '@bufbuild/protobuf@1.10.0': {} '@emeraldpay/hashicon-react@0.5.2': dependencies: diff --git a/src/components/PageComponents/Config/LoRa.tsx b/src/components/PageComponents/Config/LoRa.tsx index 8556f880..79e7b810 100644 --- a/src/components/PageComponents/Config/LoRa.tsx +++ b/src/components/PageComponents/Config/LoRa.tsx @@ -56,6 +56,13 @@ export const LoRa = (): JSX.Element => { label: "Ignore MQTT", description: "Don't forward MQTT messages over the mesh", }, + { + type: "toggle", + name: "configOkToMqtt", + label: "OK to MQTT", + description: + "When set to true, this configuration indicates that the user approves the packet to be uploaded to MQTT. If set to false, remote nodes are requested not to forward packets to MQTT", + }, ], }, { diff --git a/src/components/PageComponents/Config/Security.tsx b/src/components/PageComponents/Config/Security.tsx index 2087f4b9..ccf9051a 100644 --- a/src/components/PageComponents/Config/Security.tsx +++ b/src/components/PageComponents/Config/Security.tsx @@ -23,7 +23,7 @@ export const Security = (): JSX.Element => { fromByteArray(config.security?.publicKey ?? new Uint8Array(0)), ); const [adminKey, setAdminKey] = useState( - fromByteArray(config.security?.adminKey ?? new Uint8Array(0)), + fromByteArray(config.security?.adminKey[0] ?? new Uint8Array(0)), ); const [adminKeyVisible, setAdminKeyVisible] = useState(false); const [adminKeyBitCount, setAdminKeyBitCount] = useState( @@ -41,7 +41,7 @@ export const Security = (): JSX.Element => { case: "security", value: { ...data, - adminKey: toByteArray(adminKey), + adminKey: [toByteArray(adminKey)], privateKey: toByteArray(privateKey), publicKey: toByteArray(publicKey), }, diff --git a/src/components/PageLayout.tsx b/src/components/PageLayout.tsx index 865ebe46..f6698b97 100644 --- a/src/components/PageLayout.tsx +++ b/src/components/PageLayout.tsx @@ -40,7 +40,7 @@ export const PageLayout = ({ className="transition-all hover:text-accent" onClick={action.onClick} > - + ))} diff --git a/src/pages/Messages.tsx b/src/pages/Messages.tsx index 066c3344..c308743d 100644 --- a/src/pages/Messages.tsx +++ b/src/pages/Messages.tsx @@ -80,13 +80,19 @@ export const MessagesPage = (): JSX.Element => { chatType === "direct" ? [ { - icon: nodes.get(activeChat)?.user?.publicKey && nodes.get(activeChat)?.user?.publicKey.length > 0 ? LockIcon : LockOpenIcon, - iconClasses: nodes.get(activeChat)?.user?.publicKey && nodes.get(activeChat)?.user?.publicKey.length > 0 ? "text-green-600" : "text-yellow-300", + icon: nodes.get(activeChat)?.user?.publicKey.length + ? LockIcon + : LockOpenIcon, + iconClasses: nodes.get(activeChat)?.user?.publicKey.length + ? "text-green-600" + : "text-yellow-300", async onClick() { const targetNode = nodes.get(activeChat)?.num; if (targetNode === undefined) return; toast({ - title: nodes.get(activeChat)?.user?.publicKey && nodes.get(activeChat)?.user?.publicKey.length > 0 ? "Chat is using PKI encryption." : "Chat is using PSK encryption.", + title: nodes.get(activeChat)?.user?.publicKey.length + ? "Chat is using PKI encryption." + : "Chat is using PSK encryption.", }); }, }, diff --git a/src/pages/Nodes.tsx b/src/pages/Nodes.tsx index 8b9b559e..10c51f19 100644 --- a/src/pages/Nodes.tsx +++ b/src/pages/Nodes.tsx @@ -75,7 +75,11 @@ export const NodesPage = (): JSX.Element => { {(node.snr + 10) * 5}raw , - { node.user?.publicKey && node.user?.publicKey.length > 0 ? : } + {node.user?.publicKey && node.user?.publicKey.length > 0 ? ( + + ) : ( + + )} , {node.lastHeard !== 0 diff --git a/src/validation/config/lora.ts b/src/validation/config/lora.ts index f5ef49d6..e8ff5cef 100644 --- a/src/validation/config/lora.ts +++ b/src/validation/config/lora.ts @@ -60,4 +60,7 @@ export class LoRaValidation @IsBoolean() ignoreMqtt: boolean; + + @IsBoolean() + configOkToMqtt: boolean; }