Prevent spam fetching littlefs contents

This commit is contained in:
Sacha Weatherstone
2022-10-22 20:19:01 +10:00
parent 8b0c404b1f
commit 79e8ba70a6
4 changed files with 285 additions and 423 deletions
+8 -8
View File
@@ -23,7 +23,7 @@
"@emeraldpay/hashicon-react": "^0.5.2",
"@headlessui/react": "^1.7.3",
"@heroicons/react": "^2.0.12",
"@hookform/resolvers": "^2.9.9",
"@hookform/resolvers": "^2.9.10",
"@meshtastic/eslint-config": "^1.0.8",
"@meshtastic/meshtasticjs": "^0.6.109",
"@tailwindcss/line-clamp": "^0.4.2",
@@ -42,7 +42,7 @@
"react": "^18.2.0",
"react-chartjs-2": "^4.3.1",
"react-dom": "^18.2.0",
"react-hook-form": "^7.37.0",
"react-hook-form": "^7.38.0",
"react-hot-toast": "^2.4.0",
"react-icons": "^4.6.0",
"react-json-pretty": "^2.2.0",
@@ -54,26 +54,26 @@
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.3",
"@types/chrome": "^0.0.197",
"@types/chrome": "^0.0.199",
"@types/geodesy": "^2.2.3",
"@types/node": "^18.11.0",
"@types/node": "^18.11.3",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@types/w3c-web-serial": "^1.0.3",
"@types/web-bluetooth": "^0.0.15",
"@types/web-bluetooth": "^0.0.16",
"@vitejs/plugin-react": "^2.1.0",
"autoprefixer": "^10.4.12",
"gzipper": "^7.1.0",
"postcss": "^8.4.18",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"rollup-plugin-visualizer": "^5.8.2",
"tailwindcss": "^3.1.8",
"rollup-plugin-visualizer": "^5.8.3",
"tailwindcss": "^3.2.1",
"tar": "^6.1.11",
"tslib": "^2.4.0",
"typescript": "^4.8.4",
"unimported": "^1.22.0",
"vite": "^3.1.8",
"vite-plugin-environment": "^1.1.2"
"vite-plugin-environment": "^1.1.3"
}
}
+267 -402
View File
File diff suppressed because it is too large Load Diff
@@ -10,11 +10,6 @@ import { randId } from "@core/utils/randId.js";
import { PlusCircleIcon } from "@heroicons/react/24/outline";
import { ISerialConnection } from "@meshtastic/meshtasticjs";
interface USBID {
id: number;
name: string;
}
export const Serial = (): JSX.Element => {
const [serialPorts, setSerialPorts] = useState<SerialPort[]>([]);
const { addDevice } = useDeviceStore();
@@ -39,11 +34,13 @@ export const Serial = (): JSX.Element => {
const device = addDevice(id);
setSelectedDevice(id);
const connection = new ISerialConnection(id);
await connection.connect({
port,
baudRate: undefined,
concurrentLogOutput: true,
});
await connection
.connect({
port,
baudRate: undefined,
concurrentLogOutput: true,
})
.catch((e: Error) => console.log(`Unable to Connect: ${e.message}`));
device.addConnection(connection);
subscribeAll(device, connection);
};
@@ -59,8 +56,8 @@ export const Serial = (): JSX.Element => {
void onConnect(port);
}}
>
{`# ${index} - ${port.getInfo().usbVendorId} - ${
port.getInfo().usbProductId
{`# ${index} - ${port.getInfo().usbVendorId ?? "UNK"} - ${
port.getInfo().usbProductId ?? "UNK"
}`}
</Button>
))}
+1 -1
View File
@@ -28,7 +28,7 @@ export const FileBrowser = (): JSX.Element => {
setData((await res.json()) as Files);
}
);
});
}, []);
return (
<div>