checkpoint webif

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@687 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2012-01-22 19:47:47 +00:00
parent 2e0d49537d
commit 8d36fe22dd
10 changed files with 83 additions and 16 deletions

View File

@ -1,9 +1,9 @@
Package: webif
Priority: optional
Section: web
Version: 0.8.13-1
Version: 0.9.0
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: mongoose(>=3.0-7),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.5),jim-oo,jim-pack,service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.8),hmt(>=1.1.4),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2
Depends: mongoose(>=3.0-7),jim(>=0.73),jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.8),hmt(>=1.1.4),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2
Suggests: ffmpeg,webif-iphone
Description: An evolving web interface for the Humax.

View File

@ -30,6 +30,7 @@ if {$order eq "-"} {
[settings new] sortorder $order
}
set model [system model]
set dustbin [system dustbin 1]
proc directory {file bfile} {
@ -144,6 +145,7 @@ proc entry {file} {{i 0}} {
set odencd 1
set def unknown
set bx 0
set dlna 0
if {$type eq "ts"} {
# HD / SD
if {[$ts get definition] eq "HD"} {
@ -181,6 +183,14 @@ proc entry {file} {{i 0}} {
height=21>"
}
# Indexed
if {$::model eq "HDR" && [llength [$ts dlnaloc]]} {
puts "<img class=va src=/img/dlna.png
title=\"Indexed by DLNA Server\"
alt=\"Indexed by DLNA Server\" height=21>"
set dlna 1
}
set bx [$ts get bookmarks]
}
@ -190,7 +200,7 @@ proc entry {file} {{i 0}} {
<a href=#>
<img class=\"opt va\" border=0 width=45 type=$type did=$i
locked=$locked encd=$encd def=$def new=$new bx=$bx
odencd=$odencd
odencd=$odencd dlna=$dlna
src=/images/181_1_00_Help5_OPT_Plus.png>
</a>
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>

View File

@ -13,7 +13,7 @@ puts {
<li><a href=#download>Download</a></li>
}
if {[system model] eq "HDR"} {
if {$model eq "HDR"} {
puts { <li class="separator"><a href=#decrypt>Decrypt</a></li> }
}
if {[system pkginst ffmpeg]} {

View File

@ -232,17 +232,15 @@ function preparemenu(el, menu)
$(menu).enableContextMenuItems('#delete');
}
if (el.attr('odencd') == 1)
{
if (el.attr('odencd') == 1 && el.attr('dlna') == 1)
$(menu).enableContextMenuItems('#decrypt');
$(menu).disableContextMenuItems('#audio');
}
else
{
$(menu).disableContextMenuItems('#decrypt');
if (el.attr('odencd') == 1)
$(menu).disableContextMenuItems('#audio');
else
$(menu).enableContextMenuItems('#audio');
}
}
else
{

View File

@ -102,9 +102,11 @@ switch $action {
regsub -all {([\\["$])} $root {\\\1} root
foreach f [glob -nocomplain "${root}.*"] {
if {$mode eq "cut"} {
catch {file rename $f "$dir/[file tail $f]"}
catch {file rename $f \
"$dir/[file tail $f]"}
} else {
catch {file copy $f "$dir/[file tail $f]"}
catch {file copy $f \
"$dir/[file tail $f]"}
}
}
}

View File

@ -85,9 +85,8 @@ if {$type eq "ts"} {
<th>Size</th>
<td>$sz</td>
"
set dlna [$ts dlnaloc]
lassign $dlna url
if {[llength $dlna]} {
lassign [$ts dlnaloc] url
if {$url ne ""} {
puts "</tr><tr><th>DLNA&nbsp;URL</th>
<td><a href=\"$url\">$url</a></td>"
}

View File

@ -0,0 +1,32 @@
#!/mod/bin/jimsh
package require cgi
source /mod/var/mongoose/lib/setup
require ts.class pretty_size
puts "Content-Type: text/html\r\n"
cgi_input
#cgi_dump
header
set rfile [cgi_get file]
set ts [ts fetch $rfile]
if {[catch {$ts get file}]} {
puts "Invalid TS file, '$rfile'"
exit
}
puts {
<script type="text/javascript" src="play.js"></script>
<fieldset class=cleft style="margin: 0 1em 1em 1em">
<legend>VLC Player</legend>
<div>
}
puts "Now playing: $rfile, [$ts duration] minutes."
puts {
</div>
</fieldset>
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

21
var/mongoose/lib/filecopy Normal file
View File

@ -0,0 +1,21 @@
proc {file copy} {{force {}} source target} {
try {
if {$force ni {{} -force}} {
error "bad option \"$force\": should be -force"
}
if {![file exists $source]} {
error "source file does not exist."
}
if {$force eq "" && [file exists $target]} {
error "error copying \"$source\" to \"$target\": file already exists"
}
exec /mod/bin/busybox/cp $source $target
} on error {msg opts} {
incr opts(-level)
return {*}$opts $msg
}
}

View File

@ -16,5 +16,10 @@ if {![exists -proc require]} {
proc footer {} {
uplevel source /mod/var/mongoose/html/lib/footer.jim
}
# Replace the built-in jim {file copy} command with one that is
# largefile safe.
require filecopy
}