Skip to content

Commit

Permalink
fixing OTA url handling (was missing host portion)
Browse files Browse the repository at this point in the history
  • Loading branch information
pljakobs committed Jan 1, 2025
1 parent 45b878d commit 9b1215d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/components/FirmwareUpdateCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
{
Expand Down
2 changes: 1 addition & 1 deletion src/stores/storeConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit 9b1215d

Please sign in to comment.