tweaks
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1123 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
e669a3d08f
commit
1bf67cf177
@ -1,7 +1,7 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 0.9.13-5
|
||||
Version: 0.9.13-6
|
||||
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)
|
||||
|
@ -7,6 +7,8 @@ function refresh_files()
|
||||
.button('option', 'disabled', false);
|
||||
$('#delete_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
$('#view_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -38,6 +40,15 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#view_button').click(function() {
|
||||
var backup = $('input.restore:checked').val();
|
||||
$('#results').load('/cgi-bin/backup/view.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
});
|
||||
$('#restore_button').click(function() {
|
||||
var backup = $('input.restore:checked').val();
|
||||
if (confirm('!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE CONFIRM !!!!!!!!!!!!!!!!!!!!!!!!!\n\nAre you sure you wish to erase all scheduled recordings and favourite channels and then restore them from\n' + backup + '?'))
|
||||
|
60
var/mongoose/cgi-bin/backup/view.jim
Executable file
60
var/mongoose/cgi-bin/backup/view.jim
Executable file
@ -0,0 +1,60 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
require rsv.class findhsvc
|
||||
|
||||
set dir /mod/var/backup
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(restore_file) "backup-2011-Jul-09-20:37"
|
||||
|
||||
if {![dict exists $_cgi restore_file]} {
|
||||
puts "No filename supplied."
|
||||
exit
|
||||
}
|
||||
|
||||
set file [file tail [dict get $_cgi restore_file]]
|
||||
set ffile "/$dir/$file.rbk"
|
||||
|
||||
if {![file exists $ffile]} {
|
||||
puts "Backup file <i>$file</i> does not exist."
|
||||
exit
|
||||
}
|
||||
|
||||
if {[catch { set fd [open $ffile r] } msg]} {
|
||||
puts "Error opening <i>$file</i> - $msg"
|
||||
exit
|
||||
}
|
||||
|
||||
puts "Listing scheduled events from <i>$file</i>..."
|
||||
|
||||
set fields [lsort [[rsv] vars]]
|
||||
|
||||
set data [split [read $fd] "\n"]
|
||||
|
||||
foreach line $data {
|
||||
set vals [split $line "\t"]
|
||||
if {[lindex $vals 0] ne "event"} { continue }
|
||||
set vars {}
|
||||
set i 0
|
||||
foreach f $fields {
|
||||
if {$f eq "aulEventToRecordInfo"} { continue }
|
||||
incr i
|
||||
lappend vars $f [lindex $vals $i]
|
||||
}
|
||||
|
||||
set rsv [rsv new $vars]
|
||||
|
||||
puts " [$rsv name] ([$rsv channel_name])"
|
||||
}
|
||||
|
||||
close $fd
|
||||
rsv cleanup
|
||||
|
@ -42,10 +42,6 @@
|
||||
<div id=pkgtabs>
|
||||
<ul>
|
||||
<li>
|
||||
<a class=tablink href=pkg.jim?type=upgr>
|
||||
<span>Upgrades</span>
|
||||
</a>
|
||||
</li><li>
|
||||
<a class=tablink href=pkg.jim?type=inst>
|
||||
<span>Installed</span>
|
||||
</a>
|
||||
@ -53,6 +49,10 @@
|
||||
<a class=tablink href=pkg.jim?type=avail>
|
||||
<span>Available</span>
|
||||
</a>
|
||||
</li><li>
|
||||
<a class=tablink href=pkg.jim?type=upgr>
|
||||
<span>Upgrades</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -3,15 +3,16 @@ var opkg = '/cgi-bin/opkg.jim?cmd=';
|
||||
$(document).ready(function() {
|
||||
|
||||
var busy = false;
|
||||
var reload = false;
|
||||
|
||||
$('#opkgupdate')
|
||||
.button()
|
||||
.click(function() { execopkg('update'); })
|
||||
.click(function() { reload = true; execopkg('update'); })
|
||||
.fadeIn('slow');
|
||||
|
||||
$('#opkgupgradeall')
|
||||
.button()
|
||||
.click(function() { execopkg('upgrade'); })
|
||||
.click(function() { reload = true; execopkg('upgrade'); })
|
||||
.fadeIn('slow');
|
||||
|
||||
$('#pkgtabs').tabs({
|
||||
@ -44,14 +45,20 @@ $(document).ready(function() {
|
||||
buttons: { "Close":
|
||||
function() {$(this).dialog('close');}},
|
||||
close: function(e,u) {
|
||||
//$('#refreshing').show('slow');
|
||||
//$('#pkgtabs').hide('fast');
|
||||
//window.location.reload(true);
|
||||
var pkg = $('#dialogue').attr('pkg');
|
||||
$('tr[pkg="' + pkg + '"]')
|
||||
.disable()
|
||||
.find('button').removeClass('va');
|
||||
$('button.va').enable();
|
||||
if (reload)
|
||||
{
|
||||
$('#refreshing').show('slow');
|
||||
$('#pkgtabs').hide('fast');
|
||||
window.location.reload(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
var pkg = $('#dialogue').attr('pkg');
|
||||
$('tr[pkg="' + pkg + '"]')
|
||||
.disable()
|
||||
.find('button').removeClass('va');
|
||||
$('button.va').enable();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -48,6 +48,7 @@ puts {
|
||||
<br>
|
||||
<button id=restore_button disabled>Restore Backup</button>
|
||||
<button id=delete_button disabled>Delete Backup</button>
|
||||
<button id=view_button disabled>View Backup</button>
|
||||
<br>
|
||||
<div id=restore_working class=va style="display: none;">
|
||||
<img class=va src=/img/loading.gif>
|
||||
|
Loading…
x
Reference in New Issue
Block a user