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:
hummypkg 2011-07-06 23:16:20 +00:00
parent 4861459aec
commit 15040206ab
3 changed files with 27 additions and 17 deletions

View File

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

View File

@ -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,24 +77,16 @@ 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
} elseif {$hsvc != $ohsvc} {
puts -nonewline " Service number has "
puts "changed $ohsvc -> $hsvc, fixing."
$rsv set_hsvc $hsvc
} else {
set hsvc [lindex [lindex $hsvc 0] 1]
if {$hsvc != $ohsvc} {
puts -nonewline " Service number has "
puts "changed $ohsvc -> $hsvc, fixing."
$rsv set_hsvc $hsvc
} else {
puts " No change in channel service."
}
puts " No change in channel service."
}
}
}

View File

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