fix nodes page error, more cleanup is probably required for "undefined" hops away
This commit is contained in:
+14
-15
@@ -1,7 +1,7 @@
|
|||||||
import { LocationResponseDialog } from "../components/Dialog/LocationResponseDialog.tsx";
|
import { LocationResponseDialog } from "@components/Dialog/LocationResponseDialog.tsx";
|
||||||
import { NodeOptionsDialog } from "../components/Dialog/NodeOptionsDialog.tsx";
|
import { NodeOptionsDialog } from "@components/Dialog/NodeOptionsDialog.tsx";
|
||||||
import { TracerouteResponseDialog } from "../components/Dialog/TracerouteResponseDialog.tsx";
|
import { TracerouteResponseDialog } from "@components/Dialog/TracerouteResponseDialog.tsx";
|
||||||
import Footer from "../components/UI/Footer.tsx";
|
import Footer from "@components/UI/Footer.tsx";
|
||||||
import { Sidebar } from "@components/Sidebar.tsx";
|
import { Sidebar } from "@components/Sidebar.tsx";
|
||||||
import { Avatar } from "@components/UI/Avatar.tsx";
|
import { Avatar } from "@components/UI/Avatar.tsx";
|
||||||
import { Mono } from "@components/generic/Mono.tsx";
|
import { Mono } from "@components/generic/Mono.tsx";
|
||||||
@@ -107,8 +107,7 @@ const NodesPage = () => {
|
|||||||
>
|
>
|
||||||
{node.user?.shortName ??
|
{node.user?.shortName ??
|
||||||
(node.user?.macaddr
|
(node.user?.macaddr
|
||||||
? `${
|
? `${base16
|
||||||
base16
|
|
||||||
.stringify(node.user?.macaddr.subarray(4, 6) ?? [])
|
.stringify(node.user?.macaddr.subarray(4, 6) ?? [])
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
}`
|
}`
|
||||||
@@ -122,8 +121,7 @@ const NodesPage = () => {
|
|||||||
>
|
>
|
||||||
{node.user?.longName ??
|
{node.user?.longName ??
|
||||||
(node.user?.macaddr
|
(node.user?.macaddr
|
||||||
? `Meshtastic ${
|
? `Meshtastic ${base16
|
||||||
base16
|
|
||||||
.stringify(node.user?.macaddr.subarray(4, 6) ?? [])
|
.stringify(node.user?.macaddr.subarray(4, 6) ?? [])
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
}`
|
}`
|
||||||
@@ -150,16 +148,17 @@ const NodesPage = () => {
|
|||||||
{(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
|
{node.user?.publicKey && node.user?.publicKey.length > 0 ? (
|
||||||
? <LockIcon className="text-green-600" />
|
<LockIcon className="text-green-600 mx-auto" />
|
||||||
: <LockOpenIcon className="text-yellow-300 mx-auto" />}
|
) : (
|
||||||
|
<LockOpenIcon className="text-yellow-300 mx-auto" />
|
||||||
|
)}
|
||||||
</Mono>,
|
</Mono>,
|
||||||
<Mono key="hops">
|
<Mono key="hops">
|
||||||
{node.lastHeard !== 0
|
{node?.lastHeard !== 0
|
||||||
? node.viaMqtt === false && node.hopsAway === 0
|
? node?.viaMqtt === false && node?.hopsAway === 0
|
||||||
? "Direct"
|
? "Direct"
|
||||||
: `${node.hopsAway.toString()} ${
|
: `${node?.hopsAway?.toString()} ${node?.hopsAway > 1 ? "hops" : "hop"
|
||||||
node.hopsAway > 1 ? "hops" : "hop"
|
|
||||||
} away`
|
} away`
|
||||||
: "-"}
|
: "-"}
|
||||||
{node.viaMqtt === true ? ", via MQTT" : ""}
|
{node.viaMqtt === true ? ", via MQTT" : ""}
|
||||||
|
|||||||
Reference in New Issue
Block a user