From 9dc7ec9994287ef98248ff819e235117f72b6268 Mon Sep 17 00:00:00 2001 From: medentem Date: Sat, 5 Oct 2024 13:14:24 -0500 Subject: [PATCH 1/6] added 'oneclick' updater --- app.vue | 249 ---------------------------------------- stores/deviceStore.ts | 19 ++- stores/firmwareStore.ts | 14 ++- utils/promiseUtils.ts | 3 + 4 files changed, 32 insertions(+), 253 deletions(-) delete mode 100644 app.vue create mode 100644 utils/promiseUtils.ts diff --git a/app.vue b/app.vue deleted file mode 100644 index c38db57..0000000 --- a/app.vue +++ /dev/null @@ -1,249 +0,0 @@ - - - - - diff --git a/stores/deviceStore.ts b/stores/deviceStore.ts index ed5b9f7..463c0e0 100644 --- a/stores/deviceStore.ts +++ b/stores/deviceStore.ts @@ -18,6 +18,7 @@ export const useDeviceStore = defineStore('device', { targets: new Array(), selectedTarget: {}, client: {}, + hasBaud1200: false, } }, getters: { @@ -43,6 +44,12 @@ export const useDeviceStore = defineStore('device', { return 'pressing and holding BOOTSEL button while plugging in USB cable.'; } }, + isEsp32(): boolean { + return this.selectedArchitecture.startsWith('esp32'); + }, + isUf2(): boolean { + return ['nrf52840', 'rp2040'].includes(this.selectedArchitecture); + }, }, actions: { async fetchList() { @@ -69,6 +76,7 @@ export const useDeviceStore = defineStore('device', { baudRate: 115200, concurrentLogOutput: true, }); + this.hasBaud1200 = false; return connection; }, async enterDfuMode() { @@ -83,6 +91,7 @@ export const useDeviceStore = defineStore('device', { async baud1200() { const port: SerialPort = await navigator.serial.requestPort(); await port.open({ baudRate: 1200 }); + this.hasBaud1200 = true; }, async autoSelectHardware() { const connection = await this.openDeviceConnection(); @@ -93,8 +102,12 @@ export const useDeviceStore = defineStore('device', { } return connection.disconnect(); }); - await new Promise(_ => setTimeout(_, 4000)); - await connection.disconnect(); - } + await new Promise(_ => setTimeout(_, 5000)); + try { + await connection.disconnect(); + } catch { + console.log("secondary disconnect ignored.") + } + }, }, }) \ No newline at end of file diff --git a/stores/firmwareStore.ts b/stores/firmwareStore.ts index ae7d3ae..84d51bc 100644 --- a/stores/firmwareStore.ts +++ b/stores/firmwareStore.ts @@ -43,6 +43,9 @@ export const useFirmwareStore = defineStore('firmware', { shouldCleanInstall: false, flashPercentDone: 0, isFlashing: false, + isRunningAutoFlash: false, + autoFlashMessage: '', + needsInteractiveContinue: false, flashingIndex: 0, isReaderLocked: false, isConnected: false, @@ -61,11 +64,20 @@ export const useFirmwareStore = defineStore('firmware', { isFactoryBin: (state) => state.selectedFile?.name.endsWith('.factory.bin'), }, actions: { + setAutoFlashMessage(val: string) { + this.autoFlashMessage = val; + }, + setIsRunningAutoFlash(val: boolean) { + this.isRunningAutoFlash = val; + }, + setNeedsInteractiveContinue(val: boolean) { + this.needsInteractiveContinue = val; + }, continueToFlash() { this.hasSeenReleaseNotes = true }, async fetchList() { - firmwareApi.get() + await firmwareApi.get() .then((response: FirmwareReleases) => { // Only grab the latest 4 releases this.stable = response.releases.stable.slice(0, 4); diff --git a/utils/promiseUtils.ts b/utils/promiseUtils.ts new file mode 100644 index 0000000..5d3b08e --- /dev/null +++ b/utils/promiseUtils.ts @@ -0,0 +1,3 @@ +export function sleeper(ms: number) { + return (x: any) => new Promise(resolve => setTimeout(() => resolve(x), ms)); +} \ No newline at end of file From 26e71b00691956a81c00e9f6fe06aa3cd6435582 Mon Sep 17 00:00:00 2001 From: medentem Date: Sat, 5 Oct 2024 13:14:43 -0500 Subject: [PATCH 2/6] added new pages for routing --- pages/index.vue | 250 ++++++++++++++++++++++++++++++ pages/oneclick.vue | 367 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 617 insertions(+) create mode 100644 pages/index.vue create mode 100644 pages/oneclick.vue diff --git a/pages/index.vue b/pages/index.vue new file mode 100644 index 0000000..bfd68d1 --- /dev/null +++ b/pages/index.vue @@ -0,0 +1,250 @@ + + + + + + \ No newline at end of file diff --git a/pages/oneclick.vue b/pages/oneclick.vue new file mode 100644 index 0000000..5af6ef5 --- /dev/null +++ b/pages/oneclick.vue @@ -0,0 +1,367 @@ + + + + + + \ No newline at end of file From ff9a8e702c15f501f66b86d026ead236d27048be Mon Sep 17 00:00:00 2001 From: medentem Date: Sat, 5 Oct 2024 13:17:22 -0500 Subject: [PATCH 3/6] merge from master --- app.vue | 273 ------------------------------------------------ pages/index.vue | 55 +++++++--- 2 files changed, 39 insertions(+), 289 deletions(-) delete mode 100644 app.vue diff --git a/app.vue b/app.vue deleted file mode 100644 index a53f28e..0000000 --- a/app.vue +++ /dev/null @@ -1,273 +0,0 @@ - - - - - diff --git a/pages/index.vue b/pages/index.vue index bfd68d1..1a291ab 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -9,15 +9,17 @@ -
+
- Meshtastic Logo

+ 🎃 + Meshtastic Logo Flasher + 🎃

@@ -78,7 +80,7 @@ -