Commit 76986c0a authored by Franco Fichtner's avatar Franco Fichtner

firmware: display latest changelog if found

parent ecd05eaf
......@@ -180,8 +180,14 @@ class FirmwareController extends ApiControllerBase
return preg_replace('/[^0-9a-zA-Z\.]/', '', $value);
});
$version = $filter->sanitize($version, 'version');
$response['text'] = trim($backend->configdRun(sprintf('firmware changelog text %s', $version)));
$response['html'] = trim($backend->configdRun(sprintf('firmware changelog html %s', $version)));
$text = trim($backend->configdRun(sprintf('firmware changelog text %s', $version)));
$html = trim($backend->configdRun(sprintf('firmware changelog html %s', $version)));
if (!empty($text)) {
$response['text'] = $text;
}
if (!empty($html)) {
$response['html'] = $html;
}
}
return $response;
......
......@@ -58,6 +58,8 @@ POSSIBILITY OF SUCH DAMAGE.
$.upgrade_needs_reboot = 0 ;
}
$.upgrade_show_log = '';
// unhide upgrade button
$("#upgrade").attr("style","");
......@@ -73,8 +75,17 @@ POSSIBILITY OF SUCH DAMAGE.
$('#updatelist').append('<tr><td>'+row['name']+'</td>' +
'<td>'+row['old']+'</td><td>'+row['new']+'</td><td>' +
row['reason'] + '</td></tr>');
if (row['name'] == data['product_name']) {
$.upgrade_show_log = data['product_version'].replace(/[_-].*/, '');
}
});
// display the current changelog if one was found
if ($.upgrade_show_log != '') {
changelog($.upgrade_show_log);
}
// update list so plugins sync as well (no logs)
packagesInfo(false);
} else {
......
......@@ -226,9 +226,10 @@ if [ "$pkg_running" == "" ]; then
fi
product_version=$(cat /usr/local/opnsense/version/opnsense)
product_name=$(cat /usr/local/opnsense/version/opnsense.name)
os_version=$(uname -sr)
last_check=$(date)
# Write our json structure to disk
echo "{\"connection\":\"$connection\",\"repository\":\"$repository\",\"product_version\":\"$product_version\",\"os_version\":\"$os_version\",\"last_check\":\"$last_check\",\"updates\":\"$updates\",\"download_size\":\"$download_size\",\"extra_space_required\":\"$required_space\",\"new_packages\":[$packages_new],\"reinstall_packages\":[$packages_reinstall],\"upgrade_packages\":[$packages_upgraded],\"upgrade_needs_reboot\":\"$upgrade_needs_reboot\"}"
echo "{\"connection\":\"$connection\",\"repository\":\"$repository\",\"product_version\":\"$product_version\",\"product_name\":\"$product_name\",\"os_version\":\"$os_version\",\"last_check\":\"$last_check\",\"updates\":\"$updates\",\"download_size\":\"$download_size\",\"extra_space_required\":\"$required_space\",\"new_packages\":[$packages_new],\"reinstall_packages\":[$packages_reinstall],\"upgrade_packages\":[$packages_upgraded],\"upgrade_needs_reboot\":\"$upgrade_needs_reboot\"}"
fi
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