From: Eric Fahlgren Date: Thu, 23 Jan 2025 23:15:23 +0000 (-0800) Subject: luci-app-attendedsysupgrade: sort latest version array X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2c7b18b0f6fc04eb4005a7b8cc9d5051b27b7100;p=project%2Fluci.git luci-app-attendedsysupgrade: sort latest version array The Attended Sysupgrade app requires that the array of latest versions be in order from newest release to oldest. Ensure that this is true even when upstream presents them in arbitrary order. 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 b97416f2b7..32698b3d02 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 @@ -450,6 +450,9 @@ return view.extend({ } else { const latest = response.json().latest; + // ensure order: newest to oldest release + latest.sort().reverse(); + for (let remote_version of latest) { let remote_branch = get_branch(remote_version);