From 872da63b7d4866ad07f17583bd26d4c9d1990710 Mon Sep 17 00:00:00 2001 From: Malte Grimm Date: Mon, 27 Mar 2023 22:09:13 +0100 Subject: [PATCH] Custom firmware upload --- package.json | 1 + pnpm-lock.yaml | 6 ++++++ src/components/Dashboard.tsx | 25 ++++++++++++++++++++----- src/core/flashing/Flasher.ts | 25 +++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 61a71cda..d1de8737 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "@types/web-bluetooth": "^0.0.16", "@typescript-eslint/eslint-plugin": "^5.53.0", "@typescript-eslint/parser": "^5.53.0", + "@types/wicg-file-system-access": "^2020.9.6", "@vitejs/plugin-react": "^3.1.0", "autoprefixer": "^10.4.13", "eslint": "^8.34.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7182d9e1..4817e861 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,6 +31,7 @@ specifiers: '@types/react-dom': ^18.0.11 '@types/w3c-web-serial': ^1.0.3 '@types/web-bluetooth': ^0.0.16 + '@types/wicg-file-system-access': ^2020.9.6 '@typescript-eslint/eslint-plugin': ^5.53.0 '@typescript-eslint/parser': ^5.53.0 '@vitejs/plugin-react': ^3.1.0 @@ -131,6 +132,7 @@ devDependencies: '@types/react-dom': 18.0.11 '@types/w3c-web-serial': 1.0.3 '@types/web-bluetooth': 0.0.16 + '@types/wicg-file-system-access': 2020.9.6 '@typescript-eslint/eslint-plugin': 5.53.0_ny4s7qc6yg74faf3d6xty2ofzy '@typescript-eslint/parser': 5.53.0_7kw3g6rralp5ps6mg3uyzz6azm '@vitejs/plugin-react': 3.1.0_vite@4.1.4 @@ -3806,6 +3808,10 @@ packages: resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} dev: true + /@types/wicg-file-system-access/2020.9.6: + resolution: {integrity: sha512-6hogE75Hl2Ov/jgp8ZhDaGmIF/q3J07GtXf8nCJCwKTHq7971po5+DId7grft09zG7plBwpF6ZU0yx9Du4/e1A==} + dev: true + /@typescript-eslint/eslint-plugin/5.53.0_ny4s7qc6yg74faf3d6xty2ofzy: resolution: {integrity: sha512-alFpFWNucPLdUOySmXCJpzr6HKC3bu7XooShWM+3w/EL6J2HIoB2PFxpLnq4JauWVk6DiVeNKzQlFEaE+X9sGw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index b6e3a9d1..49a52efd 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -23,6 +23,7 @@ import { nextBatch, OverallFlashingState, setup, + uploadCustomFirmware, } from '@app/core/flashing/Flasher'; import { ConfigPreset, @@ -450,23 +451,37 @@ const FirmwareSelection = () => { } else { const versions = firmwareList.map((f, index) => ( - +
{f.name} {f.inLocalDb ? :
}
)) selectItems.push(...versions); } selectItems.push( - - {"< Select custom firmware >"} + + {"< Load custom firmware >"} ); return (