firmware: hint to installed version's changelog

This commit is contained in:
Franco Fichtner 2016-11-17 14:41:11 +01:00
parent 7127524124
commit b16dec50be
2 changed files with 10 additions and 1 deletions

View File

@ -473,6 +473,9 @@ class FirmwareController extends ApiControllerBase
$response['changelog'] = $changelogs;
/* allows us to match the version against the specific changelog */
$response['product_version'] = file_get_contents('/usr/local/opnsense/version/opnsense');
return $response;
}

View File

@ -299,9 +299,15 @@ POSSIBILITY OF SUCH DAMAGE.
$("#updatelist").html("<tr><th>{{ lang._('Version') }}</th>" +
"<th>{{ lang._('Date') }}</th><th></th></tr>");
installed_version = data['product_version'].replace(/[_-].*/, '');
$.each(data['changelog'], function(index, row) {
installed_text = '';
if (installed_version == row['version']) {
installed_text = ' ({{ lang._('installed') }})';
}
$('#updatelist').append(
'<tr><td>' + row['version'] + '</td>' +
'<tr><td>' + row['version'] + installed_text + '</td>' +
'<td>' + row['date'] + '</td>' +
'<td><button class="btn btn-default btn-xs act_changelog" data-version="' + row['version'] + '" ' +
'data-toggle="tooltip" title="View ' + row['version'] + '">' +