From f69446d2fa5fc519c223faeb9506842e191e46ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alf=20H=C3=B8gemark?= Date: Sat, 8 Feb 2014 08:12:53 +0100 Subject: [PATCH 1/1] firewalllog.dat: Add First and Last links, for fast navigation in log lines Add two links for navigating in log pages, one for going to the first page and one for goint to the last page. Introduce variable which points to the first log line to display on the last possible page. The commit contains hardcoded text for Last and First, and I am also uncertain how spaces between links should be handled. So this should be improved based on feedback. --- html/cgi-bin/logs.cgi/firewalllog.dat | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/html/cgi-bin/logs.cgi/firewalllog.dat b/html/cgi-bin/logs.cgi/firewalllog.dat index 73e62eab0..2711eba3b 100644 --- a/html/cgi-bin/logs.cgi/firewalllog.dat +++ b/html/cgi-bin/logs.cgi/firewalllog.dat @@ -285,7 +285,8 @@ END &Header::openbox('100%', 'left', $Lang::tr{'log'}); print "

$Lang::tr{'firewall hits'} $date: $lines

"; -$start = $lines - ${Header::viewsize} if ($start >= $lines - ${Header::viewsize}); +my $lastPageIndex = $lines - ${Header::viewsize}; +$start = $lastPageIndex if ($start >= $lastPageIndex); $start = 0 if ($start < 0); my $prev; @@ -297,7 +298,7 @@ my $prev; } my $next; - if ($start == $lines - ${Header::viewsize}) { + if ($start == $lastPageIndex) { $next = -1; } else { $next = $start + ${Header::viewsize}; @@ -402,16 +403,18 @@ END print ""; if ($prev != -1) { + print "First "; print "$Lang::tr{'older'}"; } else { - print "$Lang::tr{'older'}"; } + print "First $Lang::tr{'older'}"; } print "\n"; print ""; if ($next >= 0) { - print "$Lang::tr{'newer'}"; } + print "$Lang::tr{'newer'} "; + print "Last"; } else { - print "$Lang::tr{'newer'}"; } + print "$Lang::tr{'newer'} Last"; } print "\n"; print <