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>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
<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="manifest" href="site.webmanifest" />
|
||||||
<link rel="mask-icon" href="Logo_Black.svg" color="#67ea94" />
|
<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
|
// onLogEvent
|
||||||
// onMeshHeartbeat
|
// onMeshHeartbeat
|
||||||
|
|
||||||
connection.onDeviceMetadataPacket.subscribe((metadataPacket) => {
|
connection.events.onDeviceMetadataPacket.subscribe((metadataPacket) => {
|
||||||
device.addDeviceMetadataMessage(metadataPacket);
|
device.addDeviceMetadataMessage(metadataPacket);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onRoutingPacket.subscribe((routingPacket) => {
|
connection.events.onRoutingPacket.subscribe((routingPacket) => {
|
||||||
switch (routingPacket.data.variant.oneofKind) {
|
switch (routingPacket.data.variant.oneofKind) {
|
||||||
case "errorReason":
|
case "errorReason":
|
||||||
if (
|
if (
|
||||||
@@ -46,11 +46,11 @@ export const subscribeAll = (
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onTelemetryPacket.subscribe((telemetryPacket) => {
|
connection.events.onTelemetryPacket.subscribe((telemetryPacket) => {
|
||||||
device.setMetrics(telemetryPacket);
|
device.setMetrics(telemetryPacket);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onDeviceStatus.subscribe((status) => {
|
connection.events.onDeviceStatus.subscribe((status) => {
|
||||||
device.setStatus(status);
|
device.setStatus(status);
|
||||||
|
|
||||||
if (status === Types.DeviceStatusEnum.DEVICE_CONFIGURED) {
|
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;
|
const { data, ...rest } = waypoint;
|
||||||
device.addWaypoint(data);
|
device.addWaypoint(data);
|
||||||
device.addWaypointMessage({
|
device.addWaypointMessage({
|
||||||
@@ -70,48 +70,48 @@ export const subscribeAll = (
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onMyNodeInfo.subscribe((nodeInfo) => {
|
connection.events.onMyNodeInfo.subscribe((nodeInfo) => {
|
||||||
device.setHardware(nodeInfo);
|
device.setHardware(nodeInfo);
|
||||||
myNodeNum = nodeInfo.myNodeNum;
|
myNodeNum = nodeInfo.myNodeNum;
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onUserPacket.subscribe((user) => {
|
connection.events.onUserPacket.subscribe((user) => {
|
||||||
device.addUser(user);
|
device.addUser(user);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onPositionPacket.subscribe((position) => {
|
connection.events.onPositionPacket.subscribe((position) => {
|
||||||
device.addPosition(position);
|
device.addPosition(position);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onNodeInfoPacket.subscribe((nodeInfo) => {
|
connection.events.onNodeInfoPacket.subscribe((nodeInfo) => {
|
||||||
toast(`New Node Discovered: ${nodeInfo.data.user?.shortName ?? "UNK"}`, {
|
toast(`New Node Discovered: ${nodeInfo.data.user?.shortName ?? "UNK"}`, {
|
||||||
icon: "🔎"
|
icon: "🔎"
|
||||||
});
|
});
|
||||||
device.addNodeInfo(nodeInfo);
|
device.addNodeInfo(nodeInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onChannelPacket.subscribe((channel) => {
|
connection.events.onChannelPacket.subscribe((channel) => {
|
||||||
device.addChannel({
|
device.addChannel({
|
||||||
config: channel.data,
|
config: channel.data,
|
||||||
lastInterraction: new Date(),
|
lastInterraction: new Date(),
|
||||||
messages: []
|
messages: []
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
connection.onConfigPacket.subscribe((config) => {
|
connection.events.onConfigPacket.subscribe((config) => {
|
||||||
device.setConfig(config.data);
|
device.setConfig(config.data);
|
||||||
});
|
});
|
||||||
connection.onModuleConfigPacket.subscribe((moduleConfig) => {
|
connection.events.onModuleConfigPacket.subscribe((moduleConfig) => {
|
||||||
device.setModuleConfig(moduleConfig.data);
|
device.setModuleConfig(moduleConfig.data);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onMessagePacket.subscribe((messagePacket) => {
|
connection.events.onMessagePacket.subscribe((messagePacket) => {
|
||||||
device.addMessage({
|
device.addMessage({
|
||||||
...messagePacket,
|
...messagePacket,
|
||||||
ack: messagePacket.packet.from !== myNodeNum
|
ack: messagePacket.packet.from !== myNodeNum
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onPendingSettingsChange.subscribe((state) => {
|
connection.events.onPendingSettingsChange.subscribe((state) => {
|
||||||
device.setPendingSettingsChanges(state);
|
device.setPendingSettingsChanges(state);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ export const InfoPage = (): JSX.Element => {
|
|||||||
|
|
||||||
const [serialLogs, setSerialLogs] = useState<string>("");
|
const [serialLogs, setSerialLogs] = useState<string>("");
|
||||||
|
|
||||||
connection?.onDeviceDebugLog.subscribe((packet) => {
|
connection?.events.onDeviceDebugLog.subscribe((packet) => {
|
||||||
setSerialLogs(serialLogs + new TextDecoder().decode(packet));
|
setSerialLogs(serialLogs + new TextDecoder().decode(packet));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ export const LogsPage = (): JSX.Element => {
|
|||||||
const [logs, setLogs] = useState<Types.LogEvent[]>([]);
|
const [logs, setLogs] = useState<Types.LogEvent[]>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
connection?.onLogEvent.subscribe((log) => {
|
connection?.events.onLogEvent.subscribe((log) => {
|
||||||
setLogs([...logs, log]);
|
setLogs([...logs, log]);
|
||||||
});
|
});
|
||||||
}, [connection, setLogs, logs]);
|
}, [connection, setLogs, logs]);
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ module.exports = {
|
|||||||
button: "var(--button)",
|
button: "var(--button)",
|
||||||
textPrimary: "var(--textPrimary)",
|
textPrimary: "var(--textPrimary)",
|
||||||
textSecondary: "var(--textSecondary)",
|
textSecondary: "var(--textSecondary)",
|
||||||
link: "var(--link)",
|
link: "var(--link)"
|
||||||
},
|
},
|
||||||
brightness: {
|
brightness: {
|
||||||
hover: "var(--brighnessHover)",
|
hover: "var(--brighnessHover)",
|
||||||
|
|||||||
Reference in New Issue
Block a user