diff options
Diffstat (limited to 'applications/luci-app-attendedsysupgrade')
-rw-r--r-- | applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js b/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js index 60f586ded4..4b8cc2bd04 100644 --- a/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js +++ b/applications/luci-app-attendedsysupgrade/root/www/luci-static/resources/attendedsysupgrade.js @@ -33,7 +33,7 @@ function edit_server() { $("#server").className = ''; $("#server").onclick = null; - button_set = document.createElement("input"); + var button_set = document.createElement("input"); button_set.type = "button"; button_set.value = "Save"; button_set.name = "button_set"; @@ -111,7 +111,7 @@ function ubus_call(command, argument, params, variable) { request_data.id = ubus_counter; request_data.method = "call"; request_data.params = [ data.ubus_rpc_session, command, argument, params ] - request_json = JSON.stringify(request_data) + var request_json = JSON.stringify(request_data) ubus_counter++; var request = new XMLHttpRequest(); request.open("POST", ubus_url, true); @@ -128,7 +128,7 @@ function ubus_call(command, argument, params, variable) { } } } else { - error_box("<b>Ubus call faild:</b><br />Request: " + request_json + "<br />Response: " + JSON.stringify(response)) + error_box("<b>Ubus call failed:</b><br />Request: " + request_json + "<br />Response: " + JSON.stringify(response)) } ubus_closed++; } @@ -170,7 +170,7 @@ function upgrade_check() { function upgrade_check_callback(request_text) { var request_json = JSON.parse(request_text) - // create simple output to tell user whats going to be upgrade (release/packages) + // create simple output to tell user what's going to be upgrade (release/packages) var info_output = "" if(request_json.version != undefined) { info_output += "<h3>New firmware release available</h3>" @@ -179,7 +179,7 @@ function upgrade_check_callback(request_text) { } if(request_json.upgrades != undefined) { info_output += "<h3>Package upgrades available</h3>" - for (upgrade in request_json.upgrades) { + for (var upgrade in request_json.upgrades) { info_output += "<b>" + upgrade + "</b>: " + request_json.upgrades[upgrade][1] + " to " + request_json.upgrades[upgrade][0] + "<br />" } } @@ -201,7 +201,7 @@ function upgrade_request() { // Request the image // Needed values // version/release - // board_name or model (server tries to find the corrent profile) + // board_name or model (server tries to find the correct profile) // packages // The rest is added by server_request() $("#upgrade_button").disabled = true; @@ -231,7 +231,7 @@ function upgrade_request_callback(request) { var filename_split = data.sysupgrade_url.split("/") data.filename = filename_split[filename_split.length - 1] - info_output = 'Firmware created: <a href="' + data.sysupgrade_url + '"><b>' + data.filename + '</b></a>' + var info_output = 'Firmware created: <a href="' + data.sysupgrade_url + '"><b>' + data.filename + '</b></a>' if(data.advanced_mode == 1) { info_output += '<br /><a target="_blank" href="' + data.sysupgrade_url + '.log">Build log</a>' } @@ -320,6 +320,7 @@ function download_image() { } function server_request(request_dict, path, callback) { + var request_json; request_dict.distro = data.release.distribution; request_dict.target = data.release.target.split("\/")[0]; request_dict.subtarget = data.release.target.split("\/")[1]; @@ -332,7 +333,7 @@ function server_request(request_dict, path, callback) { show("#server_div"); } request.addEventListener('load', function(event) { - request_text = request.responseText; + var request_text = request.responseText; if (request.status === 200) { callback(request_text) @@ -378,7 +379,7 @@ function server_request(request_dict, path, callback) { } else if (request.status === 500) { request_json = JSON.parse(request_text) - error_box_content = "<b>Internal server error</b><br />" + var error_box_content = "<b>Internal server error</b><br />" error_box_content += request_json.error if(request_json.log != undefined) { data.log_url = request_json.log @@ -386,7 +387,7 @@ function server_request(request_dict, path, callback) { error_box(error_box_content) } else if (request.status === 501) { - error_box("No sysupgrade file produced, may not supported by modell.") + error_box("No sysupgrade file produced, may not supported by model.") } else if (request.status === 502) { // python part offline |