From a5b82b41713c1f45b5a3ced80cb15e64a0158cd4 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 19 Feb 2025 21:26:45 +1300 Subject: [PATCH] if available, show firmware build date in settings --- package-lock.json | 8 ++++---- package.json | 2 +- src/components/pages/SettingsPage.vue | 12 ++++++++++++ src/js/Connection.js | 4 ++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9cb89a4..70d3794 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@liamcottle/meshcore.js": "^1.0.6", + "@liamcottle/meshcore.js": "^1.0.7", "@tailwindcss/forms": "^0.5.10", "@vitejs/plugin-vue": "^5.2.1", "autoprefixer": "^10.4.20", @@ -1122,9 +1122,9 @@ } }, "node_modules/@liamcottle/meshcore.js": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@liamcottle/meshcore.js/-/meshcore.js-1.0.6.tgz", - "integrity": "sha512-xdebsV1qWG+gXVVB2GBwoJi17dZgBcXmfWPzAGpmUMBEQAvbIs0DAc66zue+X3cHv7+29zKATa9JWMNOC/VEjg==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@liamcottle/meshcore.js/-/meshcore.js-1.0.7.tgz", + "integrity": "sha512-BevdkkJFeFsMfnki3upnxqRiJzAFg+DaPsu3C+wBuu/8Lra3vFeKySH5X2MEJSNT0iSNUnqVRlZVtiyDmUTzkw==" }, "node_modules/@mongodb-js/saslprep": { "version": "1.2.0", diff --git a/package.json b/package.json index 5bf6feb..cc738af 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "author": "Liam Cottle ", "license": "MIT", "dependencies": { - "@liamcottle/meshcore.js": "^1.0.6", + "@liamcottle/meshcore.js": "^1.0.7", "@tailwindcss/forms": "^0.5.10", "@vitejs/plugin-vue": "^5.2.1", "autoprefixer": "^10.4.20", diff --git a/src/components/pages/SettingsPage.vue b/src/components/pages/SettingsPage.vue index d58b228..1bf7a79 100644 --- a/src/components/pages/SettingsPage.vue +++ b/src/components/pages/SettingsPage.vue @@ -26,6 +26,9 @@
<{{ bytesToHex(GlobalState.selfInfo.publicKey.slice(0, 4)) }}...{{ bytesToHex(GlobalState.selfInfo.publicKey.slice(-4)) }}>
+
+ Firmware Build Date: {{ deviceInfo.firmware_build_date }} +
@@ -166,6 +169,7 @@ export default { txPower: null, latitude: null, longitude: null, + deviceInfo: null, }; }, mounted() { @@ -175,6 +179,7 @@ export default { async load() { await Connection.loadSelfInfo(); + await this.loadDeviceInfo(); this.name = GlobalState.selfInfo.name; @@ -193,6 +198,13 @@ export default { this.longitude = GlobalState.selfInfo.advLon / 1000000; }, + async loadDeviceInfo() { + try { + this.deviceInfo = await Connection.deviceQuery(); + } catch(e) { + console.log(e); + } + }, async save() { // show loading diff --git a/src/js/Connection.js b/src/js/Connection.js index 957f533..e402d0e 100644 --- a/src/js/Connection.js +++ b/src/js/Connection.js @@ -202,6 +202,10 @@ class Connection { } } + static async deviceQuery(appTargetVer = 1) { + return await GlobalState.connection.deviceQuery(appTargetVer); + } + static async setAdvertName(name) { await GlobalState.connection.setAdvertName(name); }