git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3109 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2016-07-05 15:53:50 +00:00
parent 0de011e28d
commit d7fc82e292
17 changed files with 4267 additions and 82 deletions

View File

@ -1,10 +1,10 @@
Package: webif
Priority: optional
Section: web
Version: 1.3.0-6
Version: 1.3.1
Architecture: mipsel
Maintainer: af123@hpkg.tv
Depends: tcpfix,webif-channelicons(>=1.1.23),lighttpd(>=1.4.39-1),jim(>=0.76-2),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.3),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.9),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl
Depends: tcpfix,webif-channelicons(>=1.1.23),lighttpd(>=1.4.39-1),jim(>=0.76-2),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.3),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.0),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl
Suggests:
Description: An evolving web interface for the Humax.
Tags: http://hummy.tv/forum/threads/7116/

1
bin/reboot Symbolic link
View File

@ -0,0 +1 @@
../webif/lib/bin/reboot

View File

@ -1,6 +1,9 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require settings.class
set settings [settings]
header
@ -26,9 +29,19 @@ $(document).ready(function() {
source /mod/webif/include/menuicons.jim
puts {
</div>
if {[$settings notwitfeed] == 0} {
source /mod/webif/include/twitfeed.jim
}
puts {<div class=cleft>}
if {[$settings nohelplinks] == 0} {
source /mod/webif/include/helplinks.jim
}
puts {</div><div class=right>}
source /mod/webif/include/modversion.jim
puts {</div>}
puts {
<div class=footer>
<ul>
<li>
@ -39,11 +52,6 @@ Firmware</a> |
<a target=_blank href="http://wiki.hummy.tv/wiki/Webif_release_notes">Webif</a>
</li>
</ul>
}
source /mod/webif/include/modversion.jim
puts {
</div>
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -19,8 +19,9 @@ foreach slot [split $slots ","] {
$event clear_ulslot
$event set_delete
$event insert
$event insert pending 0 1
}
rsv commit
system restartpending

View File

@ -12,6 +12,10 @@ puts -nonewline "
setting_toggle "Show development and advanced packages?" "pkgdev" $pkgdev
if {[system pkginst nugget]} {
setting_toggle "Real-time scheduling? <span class=blood>(beta)</span>" "rtschedule" $rtschedule
}
puts -nonewline "
<tr>
<form class=auto id=logsize method=get action=$env(SCRIPT_NAME)>
@ -54,7 +58,7 @@ puts -nonewline "
"
if {[system modversion 1] >= 214} {
setting_toggle "Expert mode telnet server?" "xtelnet" \
setting_toggle "Disable telnet menu?" "xtelnet" \
[file exists /mod/boot/xtelnet] 0 1
}

View File

@ -41,6 +41,7 @@ set service_style [$settings service_style]
set notoolbar [$settings notoolbar]
set tvdb [$settings tvdb]
set tvdb_debug [$settings tvdb_debug]
set rtschedule [$settings rtschedule]
set nomobile [$settings nomobile]
set nohelplinks [$settings nohelplinks]
set notwitfeed [$settings notwitfeed]
@ -103,6 +104,7 @@ handle_int_update logkeep $logkeep "Logs to keep"
handle_int_update notoolbar $notoolbar "Disable toolbar"
handle_int_update tvdb $tvdb "Enable tvdb"
handle_int_update tvdb_debug $tvdb_debug "Enable tvdb debugging"
handle_int_update rtschedule $rtschedule "Enable real-time scheduling"
handle_int_update nomobile $nomobile "Disable mobile link"
handle_int_update nohelplinks $nohelplinks "Disable help links"
handle_int_update notwitfeed $notwitfeed "Disable twitter feed ticker"

28
webif/include/helplinks.jim Executable file
View File

@ -0,0 +1,28 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
proc helplink {title icon link} {
puts -nonewline "
<div class=left>
<center>
<a href=\"$link\" target=_blank>
<img src=$icon style=\"padding: 1em\" border=0 height=100>
</a>
<br>
<a href=\"$link target=_blank\">
<b>$title</b>
</a>
<br>
</center>
</div>
"
}
helplink "hummy.tv<br>Forums" "/img/forum.png" "http://hummy.tv/"
helplink "hummy.tv<br>Wiki" "/img/wiki.png" "http://wiki.hummy.tv/"
helplink "Things Every<br>Owner Should Know" "/img/started.png" \
"http://hummy.tv/forum/threads/1858/"
helplink "Twitter<br>Feed" "/img/silver-twitter-bird-button.png" \
"http://twitter.com/HummyPkg"

View File

@ -65,37 +65,5 @@ menuitem "Diagnostics" "/img/diagnostics.png" \
eval_plugins menu
if {[$settings notwitfeed] == 0} {
puts {
<script type="text/javascript" async=true
src='http://twitcker.com/ticker/HummyPkg.js?open=true&container=own-container&own-container=twitfeed&speed=10&count=6&background=cccccc'>
</script>
<div id=twitfeed
style="clear: both; padding-top: 3em; width: 100%">
</div>
}
}
if {[$settings nohelplinks] == 0} {
menuitem "-reset" "" ""
puts {</div><div style="clear: both; padding-top: 2em">}
menuitem "hummy.tv<br>Forums" "/img/forum.png" \
"http://hummy.tv/ target=_blank" 0 100 \
"style=\"padding: 1em\""
menuitem "hummy.tv<br>Wiki" "/img/wiki.png" \
"http://wiki.hummy.tv/ target=_blank" 0 100 \
"style=\"padding: 1em\""
menuitem "Things Every<br>Owner Should Know" "/img/started.png" \
"http://hummy.tv/forum/threads/1858/ target=_blank" 0 100 \
"style=\"padding: 1em\""
menuitem "Twitter<br>Feed" "/img/silver-twitter-bird-button.png" \
"http://twitter.com/HummyPkg target=_blank" 0 100 \
"style=\"padding: 1em\""
}
puts {</div>}

12
webif/include/twitfeed.jim Executable file
View File

@ -0,0 +1,12 @@
#!/mod/bin/jimsh
puts {
<script type="text/javascript" async=true
src='http://twitcker.com/ticker/HummyPkg.js?open=true&container=own-container&own-container=twitfeed&speed=10&count=6&background=cccccc'>
</script>
<div id=twitfeed
style="clear: both; padding: 2em; width: 100%">
</div>
}

View File

@ -10,6 +10,14 @@ if [ "$1" = "-f" -a "$0" != "/tmp/fastreboot" ]; then
exit 0
fi
model="`cat /etc/model`"
feedback()
{
[ -x /mod/bin/hwctl ] && /mod/bin/hwctl 13 0 >> /dev/null 2>&1
[ "$model" = HDR ] && display "$1" || display "\$$2"
}
readwakeup()
{
# Read the wakeup timer from the front panel
@ -43,7 +51,7 @@ setwakeup()
lbr=0
if [ -f /tmp/.lbr ]; then
lbr="`cat /tmp/.lbr`"
echo "LBR: $lbr"
#echo "LBR: $lbr"
else
# No last-boot-reason file, fall-back to reading timer directly.
echo "No .lbr, falling back to timer..."
@ -66,8 +74,9 @@ fi
# Normal reboot.
if [ "$1" != "-f" ]; then
feedback "Reboot..." "REBT"
/etc/init.d/S90settop shut
/mod/bin/sync
/bin/sync
/sbin/reboot
exit 0
fi
@ -75,11 +84,13 @@ fi
######################################################################
# Fast reboot, thanks to work by prpr
model="`cat /etc/model`"
feedback "Fast Reboot" "FRBT"
# Stop mod services
for f in /mod/etc/init.d/S??*; do
[ -f "$f" ] || continue
for f in `ls -1r /mod/etc/init.d/S??*`; do
[ -f "$f" -a -x "$f" ] || continue
# Don't stop the SSH server
echo $f | grep -q dropbear && continue
$f stop
done
@ -95,6 +106,7 @@ killall udhcpc
#lsof -t $part | xargs kill -9
# Unmount disks
/bin/sync
mount | grep '^/dev/sd' | awk '{print $1}' | xargs umount -l
# Stop device
@ -102,6 +114,8 @@ for f in /sys/block/sd?; do
echo 1 >> $f/device/delete
done
feedback "START SYSTEM" "boot"
# Restart xinit modules
/etc/init.d/S80xinit start
# Restart Humax app

View File

@ -300,7 +300,7 @@ rsv method cleanvars {} {
}]]
}
rsv method insert {{table pending} {force 0}} {
rsv method insert {{table pending} {force 0} {defer 0}} {
global rsvdb
# Duplicate check - all tables
@ -375,6 +375,8 @@ rsv method insert {{table pending} {force 0}} {
$rsvdb query "delete from ${table} where ulslot = $ulslot;"
$rsvdb query $query {*}$bvals
if {$table eq "pending" && !$defer} { rsv commit }
}
proc {rsv list} {{table tbl_reservation} {extra ""}} {
@ -531,15 +533,14 @@ proc {rsv cleanup} {} {
}
proc {rsv commit} {} {
$::rsvdb query {begin transaction}
foreach rec [rsv list pending] {
if {[$rec get action] == 0} {
$rec clear_ulslot
$rec insert TBL_RESERVATION 1
}
if {![system pkginst nugget]} return
if {![[settings] rtschedule]} return
if {[catch {
exec /mod/boot/rsvsync -realtime >> /tmp/rsvsync.log} msg]} {
puts "Scheduling: $msg"
} else {
system restartpending 0
}
$::rsvdb query {delete from pending}
$::rsvdb query {commit transaction}
}
proc {rsv construct} {event type} {

View File

@ -39,6 +39,7 @@ class settings {
audiomp3 0
logsize 1048576
logkeep 2
rtschedule 0
}
settings method hostname {{name ""}} {
@ -212,6 +213,10 @@ settings method chanchangenc {{val -1}} {
return [$self _nval_setting chanchangenc $val]
}
settings method rtschedule {{val -1}} {
return [$self _nval_setting rtschedule $val]
}
settings method sortorder {{val -1}} {
return [$self _nval_setting sortorder $val]
}