Fix protobufs, add configOkToMqtt, add PKI icons

This commit is contained in:
Hunter Thornsberry
2024-09-09 16:22:48 -04:00
parent 78a35544c7
commit 2af93f1acd
8 changed files with 41 additions and 21 deletions
+2 -2
View File
@@ -21,7 +21,7 @@
}, },
"homepage": "https://meshtastic.org", "homepage": "https://meshtastic.org",
"dependencies": { "dependencies": {
"@bufbuild/protobuf": "^2.0.0", "@bufbuild/protobuf": "^1.10.0",
"@emeraldpay/hashicon-react": "^0.5.2", "@emeraldpay/hashicon-react": "^0.5.2",
"@meshtastic/js": "2.3.7-1", "@meshtastic/js": "2.3.7-1",
"@radix-ui/react-accordion": "^1.2.0", "@radix-ui/react-accordion": "^1.2.0",
@@ -63,7 +63,7 @@
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^1.8.2", "@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/chrome": "^0.0.263",
"@types/node": "^20.14.9", "@types/node": "^20.14.9",
"@types/react": "^18.3.3", "@types/react": "^18.3.3",
+12 -12
View File
@@ -9,8 +9,8 @@ importers:
.: .:
dependencies: dependencies:
'@bufbuild/protobuf': '@bufbuild/protobuf':
specifier: ^2.0.0 specifier: ^1.10.0
version: 2.0.0 version: 1.10.0
'@emeraldpay/hashicon-react': '@emeraldpay/hashicon-react':
specifier: ^0.5.2 specifier: ^0.5.2
version: 0.5.2 version: 0.5.2
@@ -130,8 +130,8 @@ importers:
specifier: ^1.8.2 specifier: ^1.8.2
version: 1.8.2 version: 1.8.2
'@buf/meshtastic_protobufs.bufbuild_es': '@buf/meshtastic_protobufs.bufbuild_es':
specifier: 2.0.0-20240906232734-3da561588c55.2 specifier: 1.10.0-20240906232734-3da561588c55.1
version: 2.0.0-20240906232734-3da561588c55.2(@bufbuild/protobuf@2.0.0) version: 1.10.0-20240906232734-3da561588c55.1(@bufbuild/protobuf@1.10.0)
'@types/chrome': '@types/chrome':
specifier: ^0.0.263 specifier: ^0.0.263
version: 0.0.263 version: 0.0.263
@@ -354,13 +354,13 @@ packages:
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
'@buf/meshtastic_protobufs.bufbuild_es@2.0.0-20240906232734-3da561588c55.2': '@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-2.0.0-20240906232734-3da561588c55.2.tgz} 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: peerDependencies:
'@bufbuild/protobuf': ^2.0.0 '@bufbuild/protobuf': ^1.10.0
'@bufbuild/protobuf@2.0.0': '@bufbuild/protobuf@1.10.0':
resolution: {integrity: sha512-sw2JhwJyvyL0zlhG61aDzOVryEfJg2PDZFSV7i7IdC7nAE41WuXCru3QWLGiP87At0BMzKOoKO/FqEGoKygGZQ==} resolution: {integrity: sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==}
'@emeraldpay/hashicon-react@0.5.2': '@emeraldpay/hashicon-react@0.5.2':
resolution: {integrity: sha512-XCoYKpq8QQOniiSZf5ouzdvXbKfG6q4ICHRqCO/GNofiF0Ra+LR/7+tomHlXVcLPBS9sDAoZQQw/Sr24KRAbJg==} resolution: {integrity: sha512-XCoYKpq8QQOniiSZf5ouzdvXbKfG6q4ICHRqCO/GNofiF0Ra+LR/7+tomHlXVcLPBS9sDAoZQQw/Sr24KRAbJg==}
@@ -3340,11 +3340,11 @@ snapshots:
'@biomejs/cli-win32-x64@1.8.2': '@biomejs/cli-win32-x64@1.8.2':
optional: true 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: 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': '@emeraldpay/hashicon-react@0.5.2':
dependencies: dependencies:
@@ -56,6 +56,13 @@ export const LoRa = (): JSX.Element => {
label: "Ignore MQTT", label: "Ignore MQTT",
description: "Don't forward MQTT messages over the mesh", 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",
},
], ],
}, },
{ {
@@ -23,7 +23,7 @@ export const Security = (): JSX.Element => {
fromByteArray(config.security?.publicKey ?? new Uint8Array(0)), fromByteArray(config.security?.publicKey ?? new Uint8Array(0)),
); );
const [adminKey, setAdminKey] = useState<string>( const [adminKey, setAdminKey] = useState<string>(
fromByteArray(config.security?.adminKey ?? new Uint8Array(0)), fromByteArray(config.security?.adminKey[0] ?? new Uint8Array(0)),
); );
const [adminKeyVisible, setAdminKeyVisible] = useState<boolean>(false); const [adminKeyVisible, setAdminKeyVisible] = useState<boolean>(false);
const [adminKeyBitCount, setAdminKeyBitCount] = useState<number>( const [adminKeyBitCount, setAdminKeyBitCount] = useState<number>(
@@ -41,7 +41,7 @@ export const Security = (): JSX.Element => {
case: "security", case: "security",
value: { value: {
...data, ...data,
adminKey: toByteArray(adminKey), adminKey: [toByteArray(adminKey)],
privateKey: toByteArray(privateKey), privateKey: toByteArray(privateKey),
publicKey: toByteArray(publicKey), publicKey: toByteArray(publicKey),
}, },
+1 -1
View File
@@ -40,7 +40,7 @@ export const PageLayout = ({
className="transition-all hover:text-accent" className="transition-all hover:text-accent"
onClick={action.onClick} onClick={action.onClick}
> >
<action.icon className={action.iconClasses}/> <action.icon className={action.iconClasses} />
</button> </button>
))} ))}
</div> </div>
+9 -3
View File
@@ -80,13 +80,19 @@ export const MessagesPage = (): JSX.Element => {
chatType === "direct" chatType === "direct"
? [ ? [
{ {
icon: nodes.get(activeChat)?.user?.publicKey && nodes.get(activeChat)?.user?.publicKey.length > 0 ? LockIcon : LockOpenIcon, icon: nodes.get(activeChat)?.user?.publicKey.length
iconClasses: nodes.get(activeChat)?.user?.publicKey && nodes.get(activeChat)?.user?.publicKey.length > 0 ? "text-green-600" : "text-yellow-300", ? LockIcon
: LockOpenIcon,
iconClasses: nodes.get(activeChat)?.user?.publicKey.length
? "text-green-600"
: "text-yellow-300",
async onClick() { async onClick() {
const targetNode = nodes.get(activeChat)?.num; const targetNode = nodes.get(activeChat)?.num;
if (targetNode === undefined) return; if (targetNode === undefined) return;
toast({ 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.",
}); });
}, },
}, },
+5 -1
View File
@@ -75,7 +75,11 @@ export const NodesPage = (): JSX.Element => {
{(node.snr + 10) * 5}raw {(node.snr + 10) * 5}raw
</Mono>, </Mono>,
<Mono key="pki"> <Mono key="pki">
{ node.user?.publicKey && node.user?.publicKey.length > 0 ? <LockIcon className="text-green-600"/> : <LockOpenIcon className="text-yellow-300"/> } {node.user?.publicKey && node.user?.publicKey.length > 0 ? (
<LockIcon className="text-green-600" />
) : (
<LockOpenIcon className="text-yellow-300" />
)}
</Mono>, </Mono>,
<Mono key="hops"> <Mono key="hops">
{node.lastHeard !== 0 {node.lastHeard !== 0
+3
View File
@@ -60,4 +60,7 @@ export class LoRaValidation
@IsBoolean() @IsBoolean()
ignoreMqtt: boolean; ignoreMqtt: boolean;
@IsBoolean()
configOkToMqtt: boolean;
} }