From 107e78256198619942f46eb11016d7bcbf588eb9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 30 Nov 2016 18:15:22 +0100 Subject: [PATCH] firmware: let us do 9999 updates until this breaks Or: only display 12 changelogs, let user expand if desired Requested by: @jschellevis --- .../mvc/app/views/OPNsense/Core/firmware.volt | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt b/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt index 1115a9156..06dc490fa 100644 --- a/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt +++ b/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt @@ -58,7 +58,7 @@ POSSIBILITY OF SUCH DAMAGE. if (data['status_upgrade_action'] != 'pkg') { $.upgrade_needs_reboot = data['upgrade_needs_reboot']; } else { - $.upgrade_needs_reboot = 0 ; + $.upgrade_needs_reboot = 0; } $.upgrade_show_log = ''; @@ -313,6 +313,11 @@ POSSIBILITY OF SUCH DAMAGE. var local_count = 0; var remote_count = 0; + var changelog_count = 0; + var changelog_display = 12; + if ($.changelog_keep_full != undefined) { + changelog_display = 9999; + } $.each(data['package'], function(index, row) { if (row['provided'] == "1") { @@ -392,13 +397,16 @@ POSSIBILITY OF SUCH DAMAGE. installed_version = data['product_version'].replace(/[_-].*/, ''); $.each(data['changelog'], function(index, row) { + changelog_count += 1; + installed_text = ''; if (installed_version == row['version']) { installed_text = ' ({{ lang._('installed') }})'; } + $('#updatelist').append( - '' + row['version'] + installed_text + '' + - '' + row['date'] + '' + + ' changelog_display ? ' class="changelog-hidden" style="display: none;" ' : '' ) + + '>' + row['version'] + installed_text + '' + row['date'] + '' + '' @@ -410,6 +418,18 @@ POSSIBILITY OF SUCH DAMAGE. '{{ lang._('Check for updates to view changelog history.') }}' ); } + + if (changelog_count > changelog_display) { + $('#updatelist').append( + '{{ lang._('Click to view full changelog history.') }}' + ); + $("#changelog-act").click(function(event) { + event.preventDefault(); + $(".changelog-hidden").attr('style', ''); + $(".changelog-full").attr('style', 'display: none;'); + $.changelog_keep_full = 1; + }); + } } // link buttons to actions