From abc7d0655e76ad42364d6413b4828b31cdd9d3d4 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Mon, 7 Oct 2013 20:17:22 +0000 Subject: [PATCH] add schedule cleanup button git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1699 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- var/mongoose/html/sched/cleanup.jim | 28 ++++++++++++++++++++++++++++ var/mongoose/html/sched/sched.jim | 10 ++++++++++ var/mongoose/html/sched/script.js | 7 +++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100755 var/mongoose/html/sched/cleanup.jim diff --git a/CONTROL/control b/CONTROL/control index 4cadc9b..bbfcacb 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.6-9 +Version: 1.0.6-10 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.4),mongoose(>=3.0-9),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6) diff --git a/var/mongoose/html/sched/cleanup.jim b/var/mongoose/html/sched/cleanup.jim new file mode 100755 index 0000000..6eb62f6 --- /dev/null +++ b/var/mongoose/html/sched/cleanup.jim @@ -0,0 +1,28 @@ +#!/mod/bin/jimsh + +source /mod/webif/lib/setup +require rsv.class + +header + +set events [rsv list] +set n [clock seconds] +foreach event $events { + + set s [$event get nsttime] + set d [$event get nduration] + set e $($s + $d) + + if {$n - $e > 7200 && [$event get ersvtype] <= 3} { + $event clear_ulslot + $event set_delete + $event insert + + system restartpending + + } + +} + +footer + diff --git a/var/mongoose/html/sched/sched.jim b/var/mongoose/html/sched/sched.jim index 67c1341..8edad89 100755 --- a/var/mongoose/html/sched/sched.jim +++ b/var/mongoose/html/sched/sched.jim @@ -108,6 +108,7 @@ proc eventrow {event {table TBL_RESERVATION} {pending 0}} { --- -- --- ---- --:--
(Last: $ds)" puts "--:--:--" + incr ::ended } else { set elist [$event aul] @@ -192,6 +193,7 @@ proc ekey {event} { set pmap {} set events [rsv list pending] +set ended 0 if {[llength $events] > 0} { eventheader pending "Pending Scheduled Events" foreach event $events { @@ -209,6 +211,7 @@ if {[llength $events] > 0} { } set events [rsv list] +set ended 0 eventheader "live" "Scheduled Events" foreach event $events { if {[ekey $event] in $pmap} { @@ -225,6 +228,13 @@ puts { +} + +if {$ended} { + puts { } +} + +puts { diff --git a/var/mongoose/html/sched/script.js b/var/mongoose/html/sched/script.js index 9db7024..940d015 100755 --- a/var/mongoose/html/sched/script.js +++ b/var/mongoose/html/sched/script.js @@ -205,5 +205,12 @@ $('table.schedule tbody tr').hover( $('a.smenu') .contextMenu({menu: 'optmenu', leftButton: true, beforeShow: preparemenu}, menuclick); +$('#schedule_cleanup').bind('click', function(e) { + if (confirm('Are you sure you want to remove all finished recordings?')) + $.get('cleanup.jim', + function() { window.location.reload(true); + }); +}); + });