forked from hummypkg/webif
work on restore
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@245 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
4861459aec
commit
15040206ab
@ -39,11 +39,11 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
$('#restore_button').click(function() {
|
||||
$('#restore_working').slideDown();
|
||||
var backup = $('input.restore').val();
|
||||
if (confirm('Are you sure you wish to erase all scheduled ' +
|
||||
'recordings and restore ' + backup + '?'))
|
||||
{
|
||||
$('#restore_working').slideDown();
|
||||
$('#results').load('/cgi-bin/backup/restore.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
|
@ -33,6 +33,24 @@ if {[catch { set fd [open $ffile r] } msg]} {
|
||||
exit
|
||||
}
|
||||
|
||||
proc findhsvc {channel} {
|
||||
global rsvdb
|
||||
|
||||
set hsvc [$rsvdb query "
|
||||
select hSvc
|
||||
from channel.TBL_SVC
|
||||
where szSvcName = '$channel'
|
||||
or szSvcame = '\025$channel'
|
||||
limit 1
|
||||
"]
|
||||
|
||||
if {[llength $hsvc] == 1} {
|
||||
return [lindex [lindex $hsvc 0] 1]
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
puts "Restoring scheduled events..."
|
||||
|
||||
set fields [lsort [[rsv] vars]]
|
||||
@ -59,18 +77,11 @@ foreach line [split [read $fd] "\n"] {
|
||||
# First, the service number
|
||||
set ohsvc [$rsv get hsvc]
|
||||
if {$ohsvc > 0} {
|
||||
set hsvc [$rsvdb query "
|
||||
select hSvc
|
||||
from channel.TBL_SVC
|
||||
where szSvcName = '[$rsv get szSvcName]'
|
||||
limit 1
|
||||
"]
|
||||
if {[llength $hsvc] != 1} {
|
||||
set hsvc [findhsvc [$rsv get szSvcName]]
|
||||
if {$hsvc == 0} {
|
||||
puts " Cannot find channel, restore failed."
|
||||
set bad 1
|
||||
} else {
|
||||
set hsvc [lindex [lindex $hsvc 0] 1]
|
||||
if {$hsvc != $ohsvc} {
|
||||
} elseif {$hsvc != $ohsvc} {
|
||||
puts -nonewline " Service number has "
|
||||
puts "changed $ohsvc -> $hsvc, fixing."
|
||||
$rsv set_hsvc $hsvc
|
||||
@ -79,7 +90,6 @@ foreach line [split [read $fd] "\n"] {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close $fd
|
||||
rsv cleanup
|
||||
|
@ -19,7 +19,7 @@ if {[os.gethostname] eq "hosting"} {
|
||||
set file [format "%02d" [expr {$perc * 25 / 100 + 1}]]
|
||||
|
||||
puts "<div style=\"float: right; background:url('/images/345_1_27_ST_USB_BG.png')\">"
|
||||
puts "<img src=/images/345_2_14_ST_HDD_$file.png>"
|
||||
puts "<img src=/images/345_1_27_ST_USB_$file.png>"
|
||||
puts "</div>"
|
||||
puts "<span style=\"float: right\">"
|
||||
puts "<br>"
|
||||
|
Loading…
Reference in New Issue
Block a user