Quick cleanup
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
extends: "@meshtastic/eslint-config",
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ["./tsconfig.json"]
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import react from "eslint-plugin-react";
|
||||
|
||||
export default [
|
||||
"eslint:all",
|
||||
{
|
||||
files: ["src/**/*.{ts,tsx}"],
|
||||
rules: {
|
||||
semi: "error",
|
||||
"prefer-const": "error"
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -3,6 +3,8 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
|
||||
|
||||
<link rel="manifest" href="site.webmanifest" />
|
||||
<link rel="mask-icon" href="Logo_Black.svg" color="#67ea94" />
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
+14
-14
@@ -12,11 +12,11 @@ export const subscribeAll = (
|
||||
// onLogEvent
|
||||
// onMeshHeartbeat
|
||||
|
||||
connection.onDeviceMetadataPacket.subscribe((metadataPacket) => {
|
||||
connection.events.onDeviceMetadataPacket.subscribe((metadataPacket) => {
|
||||
device.addDeviceMetadataMessage(metadataPacket);
|
||||
});
|
||||
|
||||
connection.onRoutingPacket.subscribe((routingPacket) => {
|
||||
connection.events.onRoutingPacket.subscribe((routingPacket) => {
|
||||
switch (routingPacket.data.variant.oneofKind) {
|
||||
case "errorReason":
|
||||
if (
|
||||
@@ -46,11 +46,11 @@ export const subscribeAll = (
|
||||
}
|
||||
});
|
||||
|
||||
connection.onTelemetryPacket.subscribe((telemetryPacket) => {
|
||||
connection.events.onTelemetryPacket.subscribe((telemetryPacket) => {
|
||||
device.setMetrics(telemetryPacket);
|
||||
});
|
||||
|
||||
connection.onDeviceStatus.subscribe((status) => {
|
||||
connection.events.onDeviceStatus.subscribe((status) => {
|
||||
device.setStatus(status);
|
||||
|
||||
if (status === Types.DeviceStatusEnum.DEVICE_CONFIGURED) {
|
||||
@@ -60,7 +60,7 @@ export const subscribeAll = (
|
||||
}
|
||||
});
|
||||
|
||||
connection.onWaypointPacket.subscribe((waypoint) => {
|
||||
connection.events.onWaypointPacket.subscribe((waypoint) => {
|
||||
const { data, ...rest } = waypoint;
|
||||
device.addWaypoint(data);
|
||||
device.addWaypointMessage({
|
||||
@@ -70,48 +70,48 @@ export const subscribeAll = (
|
||||
});
|
||||
});
|
||||
|
||||
connection.onMyNodeInfo.subscribe((nodeInfo) => {
|
||||
connection.events.onMyNodeInfo.subscribe((nodeInfo) => {
|
||||
device.setHardware(nodeInfo);
|
||||
myNodeNum = nodeInfo.myNodeNum;
|
||||
});
|
||||
|
||||
connection.onUserPacket.subscribe((user) => {
|
||||
connection.events.onUserPacket.subscribe((user) => {
|
||||
device.addUser(user);
|
||||
});
|
||||
|
||||
connection.onPositionPacket.subscribe((position) => {
|
||||
connection.events.onPositionPacket.subscribe((position) => {
|
||||
device.addPosition(position);
|
||||
});
|
||||
|
||||
connection.onNodeInfoPacket.subscribe((nodeInfo) => {
|
||||
connection.events.onNodeInfoPacket.subscribe((nodeInfo) => {
|
||||
toast(`New Node Discovered: ${nodeInfo.data.user?.shortName ?? "UNK"}`, {
|
||||
icon: "🔎"
|
||||
});
|
||||
device.addNodeInfo(nodeInfo);
|
||||
});
|
||||
|
||||
connection.onChannelPacket.subscribe((channel) => {
|
||||
connection.events.onChannelPacket.subscribe((channel) => {
|
||||
device.addChannel({
|
||||
config: channel.data,
|
||||
lastInterraction: new Date(),
|
||||
messages: []
|
||||
});
|
||||
});
|
||||
connection.onConfigPacket.subscribe((config) => {
|
||||
connection.events.onConfigPacket.subscribe((config) => {
|
||||
device.setConfig(config.data);
|
||||
});
|
||||
connection.onModuleConfigPacket.subscribe((moduleConfig) => {
|
||||
connection.events.onModuleConfigPacket.subscribe((moduleConfig) => {
|
||||
device.setModuleConfig(moduleConfig.data);
|
||||
});
|
||||
|
||||
connection.onMessagePacket.subscribe((messagePacket) => {
|
||||
connection.events.onMessagePacket.subscribe((messagePacket) => {
|
||||
device.addMessage({
|
||||
...messagePacket,
|
||||
ack: messagePacket.packet.from !== myNodeNum
|
||||
});
|
||||
});
|
||||
|
||||
connection.onPendingSettingsChange.subscribe((state) => {
|
||||
connection.events.onPendingSettingsChange.subscribe((state) => {
|
||||
device.setPendingSettingsChanges(state);
|
||||
});
|
||||
};
|
||||
|
||||
+1
-1
@@ -84,4 +84,4 @@
|
||||
|
||||
[data-accent="pink"][data-theme="dark"] {
|
||||
--accent: #e454c4;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ export const InfoPage = (): JSX.Element => {
|
||||
|
||||
const [serialLogs, setSerialLogs] = useState<string>("");
|
||||
|
||||
connection?.onDeviceDebugLog.subscribe((packet) => {
|
||||
connection?.events.onDeviceDebugLog.subscribe((packet) => {
|
||||
setSerialLogs(serialLogs + new TextDecoder().decode(packet));
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ export const LogsPage = (): JSX.Element => {
|
||||
const [logs, setLogs] = useState<Types.LogEvent[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
connection?.onLogEvent.subscribe((log) => {
|
||||
connection?.events.onLogEvent.subscribe((log) => {
|
||||
setLogs([...logs, log]);
|
||||
});
|
||||
}, [connection, setLogs, logs]);
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ module.exports = {
|
||||
button: "var(--button)",
|
||||
textPrimary: "var(--textPrimary)",
|
||||
textSecondary: "var(--textSecondary)",
|
||||
link: "var(--link)",
|
||||
link: "var(--link)"
|
||||
},
|
||||
brightness: {
|
||||
hover: "var(--brighnessHover)",
|
||||
|
||||
Reference in New Issue
Block a user