minor updates for new menu system

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1221 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2012-11-16 21:16:03 +00:00
parent e720740507
commit d4dc56b816
9 changed files with 104 additions and 16 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 0.10.0-3
Version: 0.10.0-4
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.0.3),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control(>=1.2),busybox(>=1.19.3-1),lsof,epg(>=1.0.9),hmt(>=1.1.6),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools

View File

@ -2,8 +2,7 @@
package require cgi
source /mod/webif/lib/setup
require settings.class
require plugin
require settings.class plugin system.class
puts "Content-Type: text/html"
puts ""
@ -22,6 +21,17 @@ if {[cgi_get act] eq "https"} {
exit
}
if {[cgi_get act] eq "xtelnet"} {
if {[cgi_get val off] eq "off"} {
file delete /mod/boot/xtelnet
puts "Telnet server expert mode will be disabled after next reboot."
} else {
exec /mod/bin/busybox/touch /mod/boot/xtelnet
puts "Telnet server expert mode will be enabled after next reboot."
}
exit
}
set settings [settings new]
set hostname [$settings hostname]
@ -144,6 +154,21 @@ puts ">
</tr>
"
if {[system modversion 1] >= 214} {
puts -nonewline "
<tr>
<th class=key>Expert mode telnet server?</th>
<td><input id=xtelnet_toggle name=xtelnet type=checkbox value=yes"
if {[file exists /mod/boot/xtelnet]} { puts -nonewline " checked" }
puts ">
<div id=xtelnet_output></div>
</td>
</tr>
"
}
puts -nonewline "
<tr>
<th class=key>Slide-down toolbar?</th>

View File

@ -76,6 +76,26 @@ $(document).ready(function () {
});
});
$('#xtelnet_toggle').change(function() {
var arg = 'off';
if ($(this).attr('checked'))
arg = 'on';
$(this).disable();
$('#xtelnet_output')
.empty()
.html('<img src=/img/loading.gif>Please Wait...')
.show('slow')
.load('/cgi-bin/settings.jim?act=xtelnet&val=' + arg,
function() {
$('#xtelnet_toggle').enable();
$('#xtelnet_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#toolbar_toggle').change(function() {
var arg = '1';
if ($(this).attr('checked'))

View File

@ -2,21 +2,26 @@
package require cgi
source /mod/webif/lib/setup
require system.class findhsvc epg.class
require system.class findhsvc epg.class rsv.class
set runmode cli
if {[string match {*jim} $argv0]} { set runmode cgi }
set schedtime 900
case $runmode {
cgi {
cgi_input
set type [cgi_get type "full"]
if {$runmode eq "cgi"} {
puts "Content-Type: text/html"
puts "Pragma: no-cache"
puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT"
puts ""
}
cli {
set type "full"
if {"-X" in $argv} { set schedtime 7200 }
}
}
if {[catch {set pid [exec pgrep humaxtv]}]} {
puts "Cannot find humaxtv process."
@ -146,6 +151,29 @@ if {[system instandby]} {
}
}
set events [rsv list tbl_reservation \
" where ersvtype = 3 and nsttime - [clock seconds] < $schedtime
and nsttime > [clock seconds] "]
foreach event $events {
if {$runmode eq "cgi"} {
set icon "175_1_11_Reservation_Record.png"
lappend output [concat \
"<span class=\"va stitem\">\n" \
" <img class=va src=/images/$icon width=20>\n" \
" <span>Will record <i>[$event name]</i>" \
" on [$event channel_name] at"\
" [clock format [$event get nsttime] -format {%H:%M}]" \
" </span>\n" \
"</span>\n" \
} else {
lappend output [concat \
"Will record '[$event name]' " \
"on [$event channel_name] at " \
"[clock format [$event get nsttime] -format {%H:%M}]" \
]
}
}
if {[llength $output]} {
if {$runmode eq "cgi"} {
puts [join $output "\n<br>\n"]

View File

@ -400,3 +400,8 @@ button.red
color: #ffffff;
}
div#restart_block
{
z-index: 31;
}

View File

@ -138,8 +138,12 @@ puts {
</tr>
}
if {[catch {set msg [exec /mod/bin/smartctl -l selftest $device]} xmsg]} {
set msg $xmsg
}
set i 0
foreach line [split [exec /mod/bin/smartctl -l selftest $device] "\n"] {
foreach line [split $msg "\n"] {
regsub -all -- {[[:space:]][[:space:]]+} $line "|" line
if {[incr i] < 7} continue
lassign [split $line "|"] id name status remaining when lba

View File

@ -8,11 +8,11 @@ proc menuitem {title icon link {width 217} {height 0} {extra ""}} {{num 0}} {
if {$title eq ""} return
if {$num > 4} {
puts {</div><div style="clear: both; padding-top: 1em">}
set num 0
set num 1
}
if {$extra ne ""} { append extra " " }
puts -nonewline "
<div class=left>
<div class=left num=$num>
<center>
<a href=$link>
<img src=$icon ${extra}border=0 width=$width"

View File

@ -419,7 +419,7 @@ proc {epg dbfetch} {mode args} {
lappend records [epg new $rec]
}
} msg]} {
puts "MSG: $msg"
puts "No cached EPG data, try again later."
}
return $records
}

View File

@ -290,8 +290,8 @@ rsv method insert {{table pending} {force 0}} {
$rsvdb query $query
}
proc {rsv list} {{table tbl_reservation}} {
set res [$::rsvdb query "
proc {rsv list} {{table tbl_reservation} {extra ""}} {
set qstring "
select $table.*,
channel.TBL_SVC.szSvcName, channel.TBL_SVC.usLcn,
case when ersvtype > 3 then 1 else 0 end as sort1,
@ -300,9 +300,15 @@ proc {rsv list} {{table tbl_reservation}} {
from $table
left join channel.TBL_SVC
on $table.hSvc = channel.TBL_SVC.hSvc
"
if {$extra ne ""} { append qstring $extra }
append qstring "
order by sort1, sort2 desc, nsttime
"]
"
#puts "QSTRING: ($qstring)"
set res [$::rsvdb query $qstring]
set records {}
foreach rec $res {
lappend records [rsv new $rec]