Commit 469fae47 authored by Ad Schellevis's avatar Ad Schellevis

(firmware) UI template updates

parent bcd89930
...@@ -32,11 +32,15 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -32,11 +32,15 @@ POSSIBILITY OF SUCH DAMAGE.
* retrieve update status from backend * retrieve update status from backend
*/ */
function updateStatus() { function updateStatus() {
// update UI
$('#maintabs li:eq(0) a').tab('show'); $('#maintabs li:eq(0) a').tab('show');
$("#checkupdate_progress").addClass("fa fa-spinner fa-pulse"); $("#checkupdate_progress").addClass("fa fa-spinner fa-pulse");
$('#updatestatus').attr('class', 'text-info'); $('#updatestatus').attr('class', 'text-info');
$('#updatestatus').html("{{ lang._('Updating.... (may take up to 30 seconds)') }}"); $('#updatestatus').html("{{ lang._('Updating.... (may take up to 30 seconds)') }}");
// request status
ajaxGet('/api/core/firmware/status',{},function(data,status){ ajaxGet('/api/core/firmware/status',{},function(data,status){
// update UI
if (data['status'] == 'unknown') { if (data['status'] == 'unknown') {
$('#updatestatus').attr('class', 'text-warning'); $('#updatestatus').attr('class', 'text-warning');
} else if (data['status'] == 'error') { } else if (data['status'] == 'error') {
...@@ -53,19 +57,19 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -53,19 +57,19 @@ POSSIBILITY OF SUCH DAMAGE.
$("#upgrade").attr("style",""); $("#upgrade").attr("style","");
// show upgrade list // show upgrade list
$("#updatelist").html("<tr><th>{{ lang._('Package Name') }}</th>" + $("#updatelist").html("<tr><th>{{ lang._('Package Name') }}</th>" +
"<th>{{ lang._('Current Version') }}</th><th>{{ lang._('New Version') }}</th><th></th></tr>"); "<th>{{ lang._('Current Version') }}</th><th>{{ lang._('New Version') }}</th></tr>");
$.each(['upgrade_packages','new_packages','reinstall_packages'], function(type_idx,type_name){ $.each(['upgrade_packages','new_packages','reinstall_packages'], function(type_idx,type_name){
$.each(data[type_name],function(index,row){ $.each(data[type_name],function(index,row){
var txt_info = "" ;
if (type_name == "new_packages") { if (type_name == "new_packages") {
txt_info = "<strong>{{ lang._('NEW') }}</strong>"; $('#updatelist').append('<tr><td>'+row['name']+'</td>' +
"<td><strong>{{ lang._('NEW') }}</strong></td><td>"+row['version']+"</td></tr>");
} else if (type_name == "reinstall_packages") { } else if (type_name == "reinstall_packages") {
txt_info = "<strong>{{ lang._('REINSTALL') }}</strong>";
}
$('#updatelist').append('<tr><td>'+row['name']+'</td>' + $('#updatelist').append('<tr><td>'+row['name']+'</td>' +
'<td>'+row['current_version']+'</td><td>'+row['new_version']+'</td><td>'+txt_info+'</td></tr>'); "<td>"+row['version']+"</td><td><strong>{{ lang._('REINSTALL') }}</strong></td></tr>");
} else {
$('#updatelist').append('<tr><td>'+row['name']+'</td>' +
'<td>'+row['current_version']+'</td><td>'+row['new_version']+'</td></tr>');
}
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment