Merge pull request #2505 from aparcar/master
luci-app-attendedsysupgrade: fixup server url
This commit is contained in:
commit
9f520b48d8
1 changed files with 6 additions and 9 deletions
|
@ -5,7 +5,7 @@ function show(s) { $(s).style.display = 'block'; }
|
||||||
function hide(s) { $(s).style.display = 'none'; }
|
function hide(s) { $(s).style.display = 'none'; }
|
||||||
|
|
||||||
function set_server() {
|
function set_server() {
|
||||||
hide("#error_box");
|
hide("#status_box");
|
||||||
data.url = $("#server").value;
|
data.url = $("#server").value;
|
||||||
ubus_call("uci", "set", { "config": "attendedsysupgrade", "section": "server", values: { "url": data.url } })
|
ubus_call("uci", "set", { "config": "attendedsysupgrade", "section": "server", values: { "url": data.url } })
|
||||||
ubus_call("uci", "commit", { "config": "attendedsysupgrade" })
|
ubus_call("uci", "commit", { "config": "attendedsysupgrade" })
|
||||||
|
@ -142,7 +142,7 @@ function set_status(type, message, loading) {
|
||||||
function upgrade_check() {
|
function upgrade_check() {
|
||||||
// Asks server for new firmware
|
// Asks server for new firmware
|
||||||
// If data.upgrade_packages is set to true search for new package versions as well
|
// If data.upgrade_packages is set to true search for new package versions as well
|
||||||
hide("#error_box");
|
hide("#status_box");
|
||||||
hide("#server_div");
|
hide("#server_div");
|
||||||
set_status("info", "Searching for upgrades", true);
|
set_status("info", "Searching for upgrades", true);
|
||||||
var request_dict = {}
|
var request_dict = {}
|
||||||
|
@ -215,12 +215,10 @@ function upgrade_request_callback(request) {
|
||||||
data.sysupgrade_url = request_json.sysupgrade;
|
data.sysupgrade_url = request_json.sysupgrade;
|
||||||
|
|
||||||
var filename_split = data.sysupgrade_url.split("/")
|
var filename_split = data.sysupgrade_url.split("/")
|
||||||
data.filename = filename_split[filename_split.length - 1]
|
var filename = filename_split[filename_split.length - 1]
|
||||||
|
|
||||||
var info_output = 'Firmware created: <a href="' + data.sysupgrade_url + '"><b>' + data.filename + '</b></a>'
|
var info_output = 'Firmware created: <a href="' + data.url + data.sysupgrade_url + '"><b>' + filename + '</b></a>'
|
||||||
if(data.advanced_mode == 1) {
|
info_output += ' <a target="_blank" href="' + data.url + request_json.log + '">Build log</a>'
|
||||||
info_output += '<br /><a target="_blank" href="' + data.sysupgrade_url + '.log">Build log</a>'
|
|
||||||
}
|
|
||||||
set_status("info", info_output);
|
set_status("info", info_output);
|
||||||
|
|
||||||
show("#keep_container");
|
show("#keep_container");
|
||||||
|
@ -374,7 +372,6 @@ function server_request(request_dict, path, callback) {
|
||||||
|
|
||||||
} else if (request.status === 501) {
|
} else if (request.status === 501) {
|
||||||
set_status("danger", "No sysupgrade file produced, may not supported by model.")
|
set_status("danger", "No sysupgrade file produced, may not supported by model.")
|
||||||
|
|
||||||
} else if (request.status === 502) {
|
} else if (request.status === 502) {
|
||||||
// python part offline
|
// python part offline
|
||||||
set_status("danger", "Server down for maintenance")
|
set_status("danger", "Server down for maintenance")
|
||||||
|
|
Loading…
Reference in a new issue