git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1123 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2012-09-21 20:56:53 +00:00
parent e669a3d08f
commit 1bf67cf177
6 changed files with 94 additions and 15 deletions

View File

@ -1,7 +1,7 @@
Package: webif Package: webif
Priority: optional Priority: optional
Section: web Section: web
Version: 0.9.13-5 Version: 0.9.13-6
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk 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) 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)

View File

@ -7,6 +7,8 @@ function refresh_files()
.button('option', 'disabled', false); .button('option', 'disabled', false);
$('#delete_button').removeAttr('disabled') $('#delete_button').removeAttr('disabled')
.button('option', 'disabled', false); .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() { $('#restore_button').click(function() {
var backup = $('input.restore:checked').val(); 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 + '?')) 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 + '?'))

View 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

View File

@ -42,10 +42,6 @@
<div id=pkgtabs> <div id=pkgtabs>
<ul> <ul>
<li> <li>
<a class=tablink href=pkg.jim?type=upgr>
<span>Upgrades</span>
</a>
</li><li>
<a class=tablink href=pkg.jim?type=inst> <a class=tablink href=pkg.jim?type=inst>
<span>Installed</span> <span>Installed</span>
</a> </a>
@ -53,6 +49,10 @@
<a class=tablink href=pkg.jim?type=avail> <a class=tablink href=pkg.jim?type=avail>
<span>Available</span> <span>Available</span>
</a> </a>
</li><li>
<a class=tablink href=pkg.jim?type=upgr>
<span>Upgrades</span>
</a>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -3,15 +3,16 @@ var opkg = '/cgi-bin/opkg.jim?cmd=';
$(document).ready(function() { $(document).ready(function() {
var busy = false; var busy = false;
var reload = false;
$('#opkgupdate') $('#opkgupdate')
.button() .button()
.click(function() { execopkg('update'); }) .click(function() { reload = true; execopkg('update'); })
.fadeIn('slow'); .fadeIn('slow');
$('#opkgupgradeall') $('#opkgupgradeall')
.button() .button()
.click(function() { execopkg('upgrade'); }) .click(function() { reload = true; execopkg('upgrade'); })
.fadeIn('slow'); .fadeIn('slow');
$('#pkgtabs').tabs({ $('#pkgtabs').tabs({
@ -44,14 +45,20 @@ $(document).ready(function() {
buttons: { "Close": buttons: { "Close":
function() {$(this).dialog('close');}}, function() {$(this).dialog('close');}},
close: function(e,u) { close: function(e,u) {
//$('#refreshing').show('slow'); if (reload)
//$('#pkgtabs').hide('fast'); {
//window.location.reload(true); $('#refreshing').show('slow');
var pkg = $('#dialogue').attr('pkg'); $('#pkgtabs').hide('fast');
$('tr[pkg="' + pkg + '"]') window.location.reload(true);
.disable() }
.find('button').removeClass('va'); else
$('button.va').enable(); {
var pkg = $('#dialogue').attr('pkg');
$('tr[pkg="' + pkg + '"]')
.disable()
.find('button').removeClass('va');
$('button.va').enable();
}
} }
}); });

View File

@ -48,6 +48,7 @@ puts {
<br> <br>
<button id=restore_button disabled>Restore Backup</button> <button id=restore_button disabled>Restore Backup</button>
<button id=delete_button disabled>Delete Backup</button> <button id=delete_button disabled>Delete Backup</button>
<button id=view_button disabled>View Backup</button>
<br> <br>
<div id=restore_working class=va style="display: none;"> <div id=restore_working class=va style="display: none;">
<img class=va src=/img/loading.gif>&nbsp; <img class=va src=/img/loading.gif>&nbsp;