diff --git a/CONTROL/control b/CONTROL/control index 4fb9896..7765426 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.18-2 +Version: 1.0.18-3 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.14),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.14),hmt(>=1.1.21),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),mongoose diff --git a/webif/cgi-bin/db.jim b/webif/cgi-bin/db.jim index 86a6ed4..52ed832 100755 --- a/webif/cgi-bin/db.jim +++ b/webif/cgi-bin/db.jim @@ -62,7 +62,7 @@ proc db_info {db_file} { if {$fdb == 0} { puts "Please choose database to view:
'); + $(t).prev('span.lsize').html('0 bytes'); + }); +}); + }); diff --git a/webif/html/log/act.jim b/webif/html/log/act.jim index 8b77664..cd994f6 100755 --- a/webif/html/log/act.jim +++ b/webif/html/log/act.jim @@ -7,8 +7,13 @@ source _lib.jim cgi_input +httpheader + set file [cgi_get file "-"] -if {$file ni $loglist} { exit } +if {$file ni $loglist} { + puts "$file is not a log file." + exit +} set action [cgi_get action -] diff --git a/webif/html/log/fetch.jim b/webif/html/log/fetch.jim index 0b0bf1c..fe0f0c9 100755 --- a/webif/html/log/fetch.jim +++ b/webif/html/log/fetch.jim @@ -10,6 +10,15 @@ cgi_input httpheader +proc quote {s} { + return [string map { + {&} {&} + {"} {"} + {<} {<} + {>} {>} + } $s] +} + set file [cgi_get file "-"] if {$file eq "-"} { set file "/var/log/humaxtv.log" } if {$file ni $loglist} { exit } @@ -25,7 +34,7 @@ set l 1 while {![$fp eof]} { $fp gets line if {[$fp eof]} break - puts "" + puts " $l [cgi_quote_html $line] " incr l } $fp close diff --git a/webif/html/log/index.jim b/webif/html/log/index.jim index 11bc4df..3d5f0fa 100755 --- a/webif/html/log/index.jim +++ b/webif/html/log/index.jim @@ -26,7 +26,8 @@ foreach file [lsort -command logsort $loglist] { if {$logf eq $file} { puts -nonewline " selected" } - puts ">[file rootname [file tail $file]]$pf" + puts ">[file rootname [file tail $file]] ([pretty_size \ + [file size $file]]) $pf" } diff --git a/webif/html/log/style.css b/webif/html/log/style.css index 26ebc31..7504bb0 100644 --- a/webif/html/log/style.css +++ b/webif/html/log/style.css @@ -17,6 +17,7 @@ div.pager td { padding: 3px !important; + white-space: pre-wrap; } #buttons diff --git a/webif/lib/setup b/webif/lib/setup index b075ca1..0a5f1f5 100644 --- a/webif/lib/setup +++ b/webif/lib/setup @@ -72,6 +72,10 @@ if {![exists -proc require]} { foreach css $::_mws_css { _css $css } } + proc _jqplugin_sort {a b} { + return $([string length $a] - [string length $b]) + } + proc jqplugin {args} {{done {}}} { foreach name $args { if {$name in $done} continue @@ -80,11 +84,13 @@ if {![exists -proc require]} { if {![file isdirectory $dir]} { error "Unknown JQ Plugin - '$name'" } - foreach file [glob -nocomplain "$dir/*.js"] { + foreach file [lsort -command _jqplugin_sort [\ + glob -nocomplain "$dir/*.js"]] { set file [join [lrange [split $file /] 4 end] /] _js "/$file" } - foreach file [glob -nocomplain "$dir/*.css"] { + foreach file [lsort -command _jqplugin_sort [\ + glob -nocomplain "$dir/*.css"]] { set file [join [lrange [split $file /] 4 end] /] _css "/$file" } $l [quote $line]