-
- Details:
-
-
- Hardware:{" "}
- {Protobuf.Mesh.HardwareModel[device.user?.hwModel ?? 0]}
-
-
Node Number: {device.num}
-
Node HEX: !{numberToHexUnpadded(device.num)}
-
- Role: {Protobuf.Config.Config_DeviceConfig_Role[
+ return device ? (
+
- )
- : null;
+
+ {device.position ? (
+
+ ) : null}
+
+ {device.deviceMetrics ? (
+
+
+ Device Metrics:
+
+ {device.deviceMetrics.airUtilTx ? (
+
+ Air TX utilization:{" "}
+ {device.deviceMetrics.airUtilTx.toFixed(2)}%
+
+ ) : null}
+ {device.deviceMetrics.channelUtilization ? (
+
+ Channel utilization:{" "}
+ {device.deviceMetrics.channelUtilization.toFixed(2)}%
+
+ ) : null}
+ {device.deviceMetrics.batteryLevel ? (
+
+ Battery level:{" "}
+ {device.deviceMetrics.batteryLevel.toFixed(2)}%
+
+ ) : null}
+ {device.deviceMetrics.voltage ? (
+
Voltage: {device.deviceMetrics.voltage.toFixed(2)}V
+ ) : null}
+ {device.deviceMetrics.uptimeSeconds ? (
+
+ Uptime:{" "}
+
+
+ ) : null}
+
+ ) : null}
+
+ {device ? (
+
+
+
+
+
+ All Raw Metrics:
+
+
+
+
+ {JSON.stringify(device, null, 2)}
+
+
+
+
+
+ ) : null}
+
+
+
+
+ ) : null;
};
diff --git a/src/components/Dialog/NodeOptionsDialog.tsx b/src/components/Dialog/NodeOptionsDialog.tsx
index d95ea7ab..0161bb22 100644
--- a/src/components/Dialog/NodeOptionsDialog.tsx
+++ b/src/components/Dialog/NodeOptionsDialog.tsx
@@ -31,9 +31,11 @@ export const NodeOptionsDialog = ({
setChatType,
setActiveChat,
} = useAppStore();
- const longName = node?.user?.longName ??
+ const longName =
+ node?.user?.longName ??
(node ? `!${numberToHexUnpadded(node?.num)}` : "Unknown");
- const shortName = node?.user?.shortName ??
+ const shortName =
+ node?.user?.shortName ??
(node ? `${numberToHexUnpadded(node?.num).substring(0, 4)}` : "UNK");
function handleDirectMessage() {
@@ -51,7 +53,7 @@ export const NodeOptionsDialog = ({
connection?.requestPosition(node.num).then(() =>
toast({
title: "Position request sent.",
- })
+ }),
);
onOpenChange();
}
@@ -64,7 +66,7 @@ export const NodeOptionsDialog = ({
connection?.traceRoute(node.num).then(() =>
toast({
title: "Traceroute sent.",
- })
+ }),
);
onOpenChange();
}
diff --git a/src/components/Dialog/QRDialog.tsx b/src/components/Dialog/QRDialog.tsx
index 751b6f69..54e7aec8 100644
--- a/src/components/Dialog/QRDialog.tsx
+++ b/src/components/Dialog/QRDialog.tsx
@@ -77,8 +77,8 @@ export const QRDialog = ({
{channel.settings?.name.length
? channel.settings.name
: channel.role === Protobuf.Channel.Channel_Role.PRIMARY
- ? "Primary"
- : `Channel: ${channel.index}`}
+ ? "Primary"
+ : `Channel: ${channel.index}`}