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 <mail@aparcar.org>
This commit is contained in:
parent
d555639cbb
commit
9184721fab
1 changed files with 5 additions and 5 deletions
|
@ -217,6 +217,7 @@ function request_sysupgrade(server_url, data) {
|
||||||
function check_sysupgrade(server_url, current_version, target, board_name, packages) {
|
function check_sysupgrade(server_url, current_version, target, board_name, packages) {
|
||||||
displayStatus("notice spinning", E('p', _('Searching for an available sysupgrade')));
|
displayStatus("notice spinning", E('p', _('Searching for an available sysupgrade')));
|
||||||
var current_branch = current_version.split(".").slice(0, 2).join(".");
|
var current_branch = current_version.split(".").slice(0, 2).join(".");
|
||||||
|
var advanced_mode = uci.get_first('attendedsysupgrade', 'client', 'advanced_mode') || 0;
|
||||||
var candidates = [];
|
var candidates = [];
|
||||||
fetch(server_url + "/api/latest")
|
fetch(server_url + "/api/latest")
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
|
@ -232,10 +233,10 @@ function check_sysupgrade(server_url, current_version, target, board_name, packa
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// warn user that a new major release would be installed
|
// skip branch upgrades outside the advanced mode
|
||||||
//if (current_branch != branch) {
|
if (current_branch != branch && advanced_mode == 0) {
|
||||||
// branch["warn_branch_jump"] = true;
|
continue;
|
||||||
//}
|
}
|
||||||
|
|
||||||
candidates.unshift(version);
|
candidates.unshift(version);
|
||||||
|
|
||||||
|
@ -247,7 +248,6 @@ function check_sysupgrade(server_url, current_version, target, board_name, packa
|
||||||
}
|
}
|
||||||
if (candidates) {
|
if (candidates) {
|
||||||
var m, s, o;
|
var m, s, o;
|
||||||
var advanced_mode = uci.get_first('attendedsysupgrade', 'client', 'advanced_mode') || 0;
|
|
||||||
|
|
||||||
console.log(candidates);
|
console.log(candidates);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue