29 Commits
Author SHA1 Message Date
Hunter ThornsberryandGitHub 06d2c393ce Merge pull request #310 from Hunter275/remove-client-router
Remove router-client
2024-09-22 19:54:57 -04:00
Hunter Thornsberry cecdf9758b remove router-client 2024-09-22 18:25:35 -04:00
Hunter ThornsberryandGitHub 02cb4f2584 Merge pull request #303 from Hunter275/gps-precision 2024-09-18 13:45:17 -04:00
Hunter ThornsberryandGitHub 8cfcd7b1af Merge pull request #306 from KomelT/feature/better-unknown
Unknown nodes
2024-09-17 16:26:56 -04:00
Tilen KomelandGitHub c0cb059f52 Merge branch 'meshtastic:master' into feature/better-unknown 2024-09-17 21:10:29 +02:00
Tilen Komel a2a9b37238 Unknown to node hex on other missing places 2024-09-17 21:08:35 +02:00
Hunter ThornsberryandGitHub 57d0d27bbb Merge pull request #304 from KomelT/feature/better-unknown
Unknown nodes
2024-09-17 14:54:05 -04:00
Hunter Thornsberry 0e92dd9bea There is no longer a setting here 2024-09-17 13:53:36 -04:00
Tilen Komel c16ebf3917 Show hex on map instead of empty 2024-09-17 19:50:27 +02:00
Hunter Thornsberry 3d3a08a23f replace with select 2024-09-17 13:47:07 -04:00
Hunter ThornsberryandGitHub 4d1227a942 Merge pull request #269 from KomelT/fix/static-ip-display
Fix/static ip display
2024-09-17 13:27:12 -04:00
Hunter Thornsberry a8ee273b24 biome 2024-09-17 12:36:49 -04:00
Hunter Thornsberry 3ee7a57480 rewrite convertIpAddressToInt 2024-09-17 12:35:51 -04:00
Tilen Komel 2f2c777c56 Optimize 2024-09-17 07:32:12 +02:00
Tilen KomelandGitHub 2f36118e9d Merge branch 'meshtastic:master' into fix/static-ip-display 2024-09-17 07:16:54 +02:00
Hunter ThornsberryandGitHub a6d161581f Merge pull request #300 from Hunter275/primary-channel
Only allow channel index 0 to be PRIMARY
2024-09-15 19:55:24 -04:00
Hunter Thornsberry d05ea5a2cc Merge remote-tracking branch 'meshtastic-remote/master' into fix/static-ip-display 2024-09-15 19:39:13 -04:00
Hunter Thornsberry 471db94242 Merge branch 'master' into fix/static-ip-display 2024-09-15 19:38:03 -04:00
Hunter Thornsberry 2654e4fbc9 biome manual fixes 2024-09-15 19:24:16 -04:00
Hunter Thornsberry f2aa5bfbee biome 2024-09-15 19:23:44 -04:00
Hunter Thornsberry 3b018b0c70 Only allow channel index 0 to be PRIMARY 2024-09-15 19:23:07 -04:00
Hunter ThornsberryandGitHub 921db10d91 Merge pull request #297 from Hunter275/js-version-bump
js version bump
2024-09-12 17:20:09 -04:00
Hunter Thornsberry bf4f593e3a use new js and remove polyfills 2024-09-12 14:20:32 -04:00
Hunter Thornsberry 1e061a1e19 polyfill 2024-09-11 23:07:52 -04:00
Hunter Thornsberry 9b9f537e2c js version bump 2024-09-11 22:13:46 -04:00
Hunter ThornsberryandGitHub 985cce0b0d Merge pull request #294 from meshtastic/pki
PKI
2024-09-11 17:51:31 -04:00
Tilen Komel 8ed3ce8203 Error & Format fixing 2024-08-21 23:13:35 +02:00
Tilen Komel ebd5a3d3a6 Implemented IP utils 2024-08-21 21:53:07 +02:00
Tilen Komel 1cdf18747d Added ip utils 2024-08-21 21:53:07 +02:00
14 changed files with 757 additions and 33 deletions
+2 -1
View File
@@ -23,7 +23,7 @@
"dependencies": { "dependencies": {
"@bufbuild/protobuf": "^1.10.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-5",
"@noble/curves": "^1.5.0", "@noble/curves": "^1.5.0",
"@radix-ui/react-accordion": "^1.2.0", "@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-checkbox": "^1.1.0", "@radix-ui/react-checkbox": "^1.1.0",
@@ -60,6 +60,7 @@
"tailwind-merge": "^2.3.0", "tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"timeago-react": "^3.0.6", "timeago-react": "^3.0.6",
"vite-plugin-node-polyfills": "^0.22.0",
"zustand": "4.5.2" "zustand": "4.5.2"
}, },
"devDependencies": { "devDependencies": {
+673 -5
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -111,10 +111,14 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
type: "select", type: "select",
name: "role", name: "role",
label: "Role", label: "Role",
disabled: channel.index === 0,
description: description:
"Device telemetry is sent over PRIMARY. Only one PRIMARY allowed", "Device telemetry is sent over PRIMARY. Only one PRIMARY allowed",
properties: { properties: {
enumValue: Protobuf.Channel.Channel_Role, enumValue:
channel.index === 0
? { PRIMARY: 1 }
: { DISABLED: 0, SECONDARY: 2 },
}, },
}, },
{ {
@@ -32,7 +32,22 @@ export const Device = (): JSX.Element => {
label: "Role", label: "Role",
description: "What role the device performs on the mesh", description: "What role the device performs on the mesh",
properties: { properties: {
enumValue: Protobuf.Config.Config_DeviceConfig_Role, enumValue: {
Client: Protobuf.Config.Config_DeviceConfig_Role.CLIENT,
"Client Mute":
Protobuf.Config.Config_DeviceConfig_Role.CLIENT_MUTE,
Router: Protobuf.Config.Config_DeviceConfig_Role.ROUTER,
Repeater: Protobuf.Config.Config_DeviceConfig_Role.REPEATER,
Tracker: Protobuf.Config.Config_DeviceConfig_Role.TRACKER,
Sensor: Protobuf.Config.Config_DeviceConfig_Role.SENSOR,
TAK: Protobuf.Config.Config_DeviceConfig_Role.TAK,
"Client Hidden":
Protobuf.Config.Config_DeviceConfig_Role.CLIENT_HIDDEN,
"Lost and Found":
Protobuf.Config.Config_DeviceConfig_Role.LOST_AND_FOUND,
"TAK Tracker":
Protobuf.Config.Config_DeviceConfig_Role.SENSOR,
},
formatEnumName: true, formatEnumName: true,
}, },
}, },
@@ -1,6 +1,10 @@
import type { NetworkValidation } from "@app/validation/config/network.js"; import type { NetworkValidation } from "@app/validation/config/network.js";
import { DynamicForm } from "@components/Form/DynamicForm.js"; import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js"; import { useDevice } from "@core/stores/deviceStore.js";
import {
convertIntToIpAddress,
convertIpAddressToInt,
} from "@core/utils/ip.js";
import { Protobuf } from "@meshtastic/js"; import { Protobuf } from "@meshtastic/js";
export const Network = (): JSX.Element => { export const Network = (): JSX.Element => {
@@ -13,9 +17,12 @@ export const Network = (): JSX.Element => {
case: "network", case: "network",
value: { value: {
...data, ...data,
ipv4Config: new Protobuf.Config.Config_NetworkConfig_IpV4Config( ipv4Config: new Protobuf.Config.Config_NetworkConfig_IpV4Config({
data.ipv4Config, ip: convertIpAddressToInt(data.ipv4Config.ip) ?? 0,
), gateway: convertIpAddressToInt(data.ipv4Config.gateway) ?? 0,
subnet: convertIpAddressToInt(data.ipv4Config.subnet) ?? 0,
dns: convertIpAddressToInt(data.ipv4Config.dns) ?? 0,
}),
}, },
}, },
}), }),
@@ -25,7 +32,19 @@ export const Network = (): JSX.Element => {
return ( return (
<DynamicForm<NetworkValidation> <DynamicForm<NetworkValidation>
onSubmit={onSubmit} onSubmit={onSubmit}
defaultValues={config.network} defaultValues={{
...config.network,
ipv4Config: {
ip: convertIntToIpAddress(config.network?.ipv4Config?.ip ?? 0),
gateway: convertIntToIpAddress(
config.network?.ipv4Config?.gateway ?? 0,
),
subnet: convertIntToIpAddress(
config.network?.ipv4Config?.subnet ?? 0,
),
dns: convertIntToIpAddress(config.network?.ipv4Config?.dns ?? 0),
},
}}
fieldGroups={[ fieldGroups={[
{ {
label: "WiFi Config", label: "WiFi Config",
@@ -77,12 +77,6 @@ export const Position = (): JSX.Element => {
label: "Enable Pin", label: "Enable Pin",
description: "GPS module enable pin override", description: "GPS module enable pin override",
}, },
{
type: "number",
name: "channelPrecision",
label: "Channel Precision",
description: "GPS channel precision",
},
], ],
}, },
{ {
@@ -1,5 +1,6 @@
import { useDevice } from "@app/core/stores/deviceStore.js"; import { useDevice } from "@app/core/stores/deviceStore.js";
import type { Protobuf } from "@meshtastic/js"; import type { Protobuf } from "@meshtastic/js";
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
export interface TraceRouteProps { export interface TraceRouteProps {
from?: Protobuf.Mesh.NodeInfo; from?: Protobuf.Mesh.NodeInfo;
@@ -24,7 +25,10 @@ export const TraceRoute = ({
<div className="ml-5 flex"> <div className="ml-5 flex">
<span className="ml-4 border-l-2 border-l-backgroundPrimary pl-2 text-textPrimary"> <span className="ml-4 border-l-2 border-l-backgroundPrimary pl-2 text-textPrimary">
{to?.user?.longName}↔ {to?.user?.longName}↔
{route.map((hop) => `${nodes.get(hop)?.user?.longName ?? "Unknown"}↔`)} {route.map((hop) => {
const node = nodes.get(hop);
return `${node?.user?.longName ?? (node?.num ? numberToHexUnpadded(node.num) : "Unknown")}↔`;
})}
{from?.user?.longName} {from?.user?.longName}
</span> </span>
</div> </div>
+14
View File
@@ -0,0 +1,14 @@
export function convertIntToIpAddress(int: number): string {
return `${int & 0xff}.${(int >> 8) & 0xff}.${(int >> 16) & 0xff}.${(int >> 24) & 0xff}`;
}
export function convertIpAddressToInt(ip: string): number | null {
return (
ip
.split(".")
.reverse()
.reduce((ipnum, octet) => {
return (ipnum << 8) + Number.parseInt(octet);
}, 0) >>> 0
);
}
+3 -1
View File
@@ -7,6 +7,7 @@ import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
import { useAppStore } from "@core/stores/appStore.js"; import { useAppStore } from "@core/stores/appStore.js";
import { useDevice } from "@core/stores/deviceStore.js"; import { useDevice } from "@core/stores/deviceStore.js";
import { Hashicon } from "@emeraldpay/hashicon-react"; import { Hashicon } from "@emeraldpay/hashicon-react";
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
import { bbox, lineString } from "@turf/turf"; import { bbox, lineString } from "@turf/turf";
import { import {
BoxSelectIcon, BoxSelectIcon,
@@ -180,7 +181,8 @@ export const MapPage = (): JSX.Element => {
<div className="flex cursor-pointer gap-2 rounded-md border bg-backgroundPrimary p-1.5"> <div className="flex cursor-pointer gap-2 rounded-md border bg-backgroundPrimary p-1.5">
<Hashicon value={node.num.toString()} size={22} /> <Hashicon value={node.num.toString()} size={22} />
<Subtle className={cn(zoom < 12 && "hidden")}> <Subtle className={cn(zoom < 12 && "hidden")}>
{node.user?.longName} {node.user?.longName ||
`!${numberToHexUnpadded(node.num)}`}
</Subtle> </Subtle>
</div> </div>
</Marker> </Marker>
+5 -2
View File
@@ -7,6 +7,7 @@ import { useToast } from "@core/hooks/useToast.js";
import { useDevice } from "@core/stores/deviceStore.js"; import { useDevice } from "@core/stores/deviceStore.js";
import { Hashicon } from "@emeraldpay/hashicon-react"; import { Hashicon } from "@emeraldpay/hashicon-react";
import { Protobuf, Types } from "@meshtastic/js"; import { Protobuf, Types } from "@meshtastic/js";
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
import { getChannelName } from "@pages/Channels.js"; import { getChannelName } from "@pages/Channels.js";
import { HashIcon, LockIcon, LockOpenIcon, WaypointsIcon } from "lucide-react"; import { HashIcon, LockIcon, LockOpenIcon, WaypointsIcon } from "lucide-react";
import { useState } from "react"; import { useState } from "react";
@@ -28,6 +29,8 @@ export const MessagesPage = (): JSX.Element => {
); );
const currentChannel = channels.get(activeChat); const currentChannel = channels.get(activeChat);
const { toast } = useToast(); const { toast } = useToast();
const node = nodes.get(activeChat);
const nodeHex = node?.num ? numberToHexUnpadded(node.num) : "Unknown";
return ( return (
<> <>
@@ -56,7 +59,7 @@ export const MessagesPage = (): JSX.Element => {
{filteredNodes.map((node) => ( {filteredNodes.map((node) => (
<SidebarButton <SidebarButton
key={node.num} key={node.num}
label={node.user?.longName ?? "Unknown"} label={node.user?.longName ?? `!${numberToHexUnpadded(node.num)}`}
active={activeChat === node.num} active={activeChat === node.num}
onClick={() => { onClick={() => {
setChatType("direct"); setChatType("direct");
@@ -73,7 +76,7 @@ export const MessagesPage = (): JSX.Element => {
chatType === "broadcast" && currentChannel chatType === "broadcast" && currentChannel
? getChannelName(currentChannel) ? getChannelName(currentChannel)
: chatType === "direct" && nodes.get(activeChat) : chatType === "direct" && nodes.get(activeChat)
? nodes.get(activeChat)?.user?.longName ?? "Unknown" ? nodes.get(activeChat)?.user?.longName ?? nodeHex
: "Loading..." : "Loading..."
}`} }`}
actions={ actions={
+2 -1
View File
@@ -8,6 +8,7 @@ import { TimeAgo } from "@components/generic/Table/tmp/TimeAgo.js";
import { useDevice } from "@core/stores/deviceStore.js"; import { useDevice } from "@core/stores/deviceStore.js";
import { Hashicon } from "@emeraldpay/hashicon-react"; import { Hashicon } from "@emeraldpay/hashicon-react";
import { Protobuf } from "@meshtastic/js"; import { Protobuf } from "@meshtastic/js";
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
import { LockIcon, LockOpenIcon, TrashIcon } from "lucide-react"; import { LockIcon, LockOpenIcon, TrashIcon } from "lucide-react";
import { Fragment } from "react"; import { Fragment } from "react";
import { base16 } from "rfc4648"; import { base16 } from "rfc4648";
@@ -50,7 +51,7 @@ export const NodesPage = (): JSX.Element => {
? `Meshtastic ${base16 ? `Meshtastic ${base16
.stringify(node.user?.macaddr.subarray(4, 6) ?? []) .stringify(node.user?.macaddr.subarray(4, 6) ?? [])
.toLowerCase()}` .toLowerCase()}`
: `UNK: ${node.num}`)} : `!${numberToHexUnpadded(node.num)}`)}
</h1>, </h1>,
<Mono key="model"> <Mono key="model">
+8 -5
View File
@@ -41,21 +41,24 @@ export class NetworkValidation
export class NetworkValidationIpV4Config export class NetworkValidationIpV4Config
implements implements
Omit<Protobuf.Config.Config_NetworkConfig_IpV4Config, keyof Message> Omit<
Protobuf.Config.Config_NetworkConfig_IpV4Config,
keyof Message | "ip" | "gateway" | "subnet" | "dns"
>
{ {
@IsIP() @IsIP()
@IsOptional() @IsOptional()
ip: number; ip: string;
@IsIP() @IsIP()
@IsOptional() @IsOptional()
gateway: number; gateway: string;
@IsIP() @IsIP()
@IsOptional() @IsOptional()
subnet: number; subnet: string;
@IsIP() @IsIP()
@IsOptional() @IsOptional()
dns: number; dns: string;
} }
-3
View File
@@ -43,7 +43,4 @@ export class PositionValidation
@IsEnum(Protobuf.Config.Config_PositionConfig_GpsMode) @IsEnum(Protobuf.Config.Config_PositionConfig_GpsMode)
gpsMode: Protobuf.Config.Config_PositionConfig_GpsMode; gpsMode: Protobuf.Config.Config_PositionConfig_GpsMode;
@IsArray()
channelPrecision: number[];
} }
+1 -2
View File
@@ -1,11 +1,10 @@
import { execSync } from "node:child_process"; import { execSync } from "node:child_process";
import { resolve } from "node:path"; import { resolve } from "node:path";
import react from "@vitejs/plugin-react";
import { visualizer } from "rollup-plugin-visualizer"; import { visualizer } from "rollup-plugin-visualizer";
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import EnvironmentPlugin from "vite-plugin-environment"; import EnvironmentPlugin from "vite-plugin-environment";
import react from "@vitejs/plugin-react";
let hash = ""; let hash = "";
try { try {