From 9b1215d6063d91eb8272e82bf5605a5368264a8e Mon Sep 17 00:00:00 2001 From: Peter Jakobs Date: Wed, 1 Jan 2025 16:09:18 +0100 Subject: [PATCH] fixing OTA url handling (was missing host portion) --- src/components/FirmwareUpdateCard.vue | 16 ++++++++++++++++ src/stores/storeConstants.js | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/FirmwareUpdateCard.vue b/src/components/FirmwareUpdateCard.vue index 2c72b95..9c26ff7 100644 --- a/src/components/FirmwareUpdateCard.vue +++ b/src/components/FirmwareUpdateCard.vue @@ -199,6 +199,22 @@ export default { console.log("Selected firmware:", selectedFirmware); try { + const baseUrl = otaUrl.value.substring( + 0, + otaUrl.value.lastIndexOf("/") + 1, + ); + const relativeUrl = selectedFirmware.files.rom.url; + const fullUrl = baseUrl + relativeUrl; + + console.log("baseUrl:", baseUrl, "\nrelativeUrl: ", relativeUrl); + console.log("fullUrl: ", fullUrl); + + selectedFirmware.files.rom.url = fullUrl; + + console.log( + "firmwarre structure:", + JSON.stringify(selectedFirmware.files), + ); const postResponse = await fetch( `http://${controllers.currentController["ip_address"]}/update`, { diff --git a/src/stores/storeConstants.js b/src/stores/storeConstants.js index 14a7840..cf65b4a 100644 --- a/src/stores/storeConstants.js +++ b/src/stores/storeConstants.js @@ -2,7 +2,7 @@ export const localhost = { hostname: "localhost", ip_address: process.env.NODE_ENV === "development" - ? "led-so1.fritz.box" + ? "led-te3.fritz.box" : window.location.hostname, };