add schedule cleanup button

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1699 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2013-10-07 20:17:22 +00:00
parent f7ab52698d
commit abc7d0655e
4 changed files with 46 additions and 1 deletions

View File

@ -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)

View File

@ -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

View File

@ -108,6 +108,7 @@ proc eventrow {event {table TBL_RESERVATION} {pending 0}} {
--- -- --- ---- --:--<br>
<span class=footnote>(Last: $ds)</span>"
puts "</td><td>--:--:--</td>"
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 {
<button onclick="window.location='/backup.shtml';">
Backup/Restore Scheduled Recordings/Events
</button>
}
if {$ended} {
puts { <button id=schedule_cleanup>Cleanup old recordings</button> }
}
puts {
<button onclick="window.location='/cgi-bin/db.jim?db=rsv.db&tab=TBL_RESERVATION';">
Raw database view
</button>

View File

@ -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);
});
});
});