Skip to content

Commit

Permalink
Fix protobufs, add configOkToMqtt, add PKI icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunter275 committed Sep 9, 2024
1 parent 78a3554 commit 2af93f1
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/components/PageComponents/Config/LoRa.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/components/PageComponents/Config/Security.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const Security = (): JSX.Element => {
fromByteArray(config.security?.publicKey ?? new Uint8Array(0)),
);
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 [adminKeyBitCount, setAdminKeyBitCount] = useState<number>(
Expand All @@ -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),
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const PageLayout = ({
className="transition-all hover:text-accent"
onClick={action.onClick}
>
<action.icon className={action.iconClasses}/>
<action.icon className={action.iconClasses} />
</button>
))}
</div>
Expand Down
12 changes: 9 additions & 3 deletions src/pages/Messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
});
},
},
Expand Down
6 changes: 5 additions & 1 deletion src/pages/Nodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export const NodesPage = (): JSX.Element => {
{(node.snr + 10) * 5}raw
</Mono>,
<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 key="hops">
{node.lastHeard !== 0
Expand Down
3 changes: 3 additions & 0 deletions src/validation/config/lora.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@ export class LoRaValidation

@IsBoolean()
ignoreMqtt: boolean;

@IsBoolean()
configOkToMqtt: boolean;
}

0 comments on commit 2af93f1

Please sign in to comment.