From: Eric Fahlgren Date: Sat, 8 Feb 2025 14:10:05 +0000 (-0800) Subject: luci-app-attendedsysupgrade: supply proper version to package changes X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2e9ffc6628d91065326cc1e16ea15f9f8f4f00a0;p=project%2Fluci.git luci-app-attendedsysupgrade: supply proper version to package changes Fix bug in applyPackageChanges, it was using the installed version as the target, resulting in no changes being applied. Signed-off-by: Eric Fahlgren --- diff --git a/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js b/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js index 03244a8652..145d75faf0 100644 --- a/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js +++ b/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js @@ -78,9 +78,11 @@ return view.extend({ request_hash: '', sha256_unsigned: '', - applyPackageChanges: async function(packages, data, firmware) { - const overview_url = `${data.url}/api/v1/overview`; - const revision_url = `${data.url}/api/v1/revision/${firmware.version}/${firmware.target}`; + applyPackageChanges: async function(package_info) { + let { url, target, version, packages } = package_info; + + const overview_url = `${url}/api/v1/overview`; + const revision_url = `${url}/api/v1/revision/${version}/${target}`; let changes, target_revision; @@ -88,7 +90,7 @@ return view.extend({ request.get(overview_url).then( (response) => { let json = response.json(); - changes = json.branches[get_branch(firmware.version)].package_changes; + changes = json.branches[get_branch(version)].package_changes; }, (failed) => { ui.addNotification(null, E('p', _(`Get overview failed ${failed}`))); @@ -581,7 +583,12 @@ return view.extend({ class: 'btn cbi-button cbi-button-positive important', click: ui.createHandlerFn(this, function () { map.save().then(() => { - this.applyPackageChanges(mapdata.request.packages, data, firmware).then((packages) => { + this.applyPackageChanges({ + url, + target, + version: mapdata.request.version, + packages: mapdata.request.packages, + }).then((packages) => { const content = { ...firmware, packages: packages,