Skip to content

Commit

Permalink
update OTA card to allow both relative and full qualified rom urls
Browse files Browse the repository at this point in the history
  • Loading branch information
pljakobs committed Jan 3, 2025
1 parent a8ddc5f commit be72f83
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/FirmwareUpdateCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,14 @@ 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;
if (relativeUrl..substring(0, 4) !== "http") {
const baseUrl = otaUrl.value.substring(
0,
otaUrl.value.lastIndexOf("/") + 1,
);
const fullUrl = baseUrl + relativeUrl;
}
console.log("baseUrl:", baseUrl, "\nrelativeUrl: ", relativeUrl);
console.log("fullUrl: ", fullUrl);
Expand Down

0 comments on commit be72f83

Please sign in to comment.