From 29d3ed290cb6548c8de8f9a8a4eb3169e7bf6f58 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 29 Apr 2021 22:53:09 +0200 Subject: [PATCH] luci-app-attendedsysupgrade: hide branch update Branch updates (e.g. 19.07 to 21.02) are risky and shouldn't be suggested by default. Hide those unless the advanced mode is enabled. Signed-off-by: Paul Spooren (cherry picked from commit 9184721fab65934fe016c132a8f11a2308742f92) --- .../resources/view/attendedsysupgrade/overview.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 cbb0b9a778..c5d21c2f3a 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 @@ -217,6 +217,7 @@ function request_sysupgrade(server_url, data) { function check_sysupgrade(server_url, current_version, target, board_name, packages) { displayStatus("notice spinning", E('p', _('Searching for an available sysupgrade'))); var current_branch = current_version.split(".").slice(0, 2).join("."); + var advanced_mode = uci.get_first('attendedsysupgrade', 'client', 'advanced_mode') || 0; var candidates = []; fetch(server_url + "/api/latest") .then(response => response.json()) @@ -232,10 +233,10 @@ function check_sysupgrade(server_url, current_version, target, board_name, packa break; } - // warn user that a new major release would be installed - //if (current_branch != branch) { - // branch["warn_branch_jump"] = true; - //} + // skip branch upgrades outside the advanced mode + if (current_branch != branch && advanced_mode == 0) { + continue; + } candidates.unshift(version); @@ -247,7 +248,6 @@ function check_sysupgrade(server_url, current_version, target, board_name, packa } if (candidates) { var m, s, o; - var advanced_mode = uci.get_first('attendedsysupgrade', 'client', 'advanced_mode') || 0; console.log(candidates); -- 2.30.2