From 202f8689a250f3841798cd2b9d5bf4c97193629c Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 28 Jan 2011 21:50:54 +0100 Subject: [PATCH] show all increments without archived copy This is mid-size change but it brings web interface in-sync with default operation of BackupPC_ASA_ArchiveStart --- lib/BackupPC/CGI/Archive.pm | 40 ++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/lib/BackupPC/CGI/Archive.pm b/lib/BackupPC/CGI/Archive.pm index f20bed3..cbf5f63 100644 --- a/lib/BackupPC/CGI/Archive.pm +++ b/lib/BackupPC/CGI/Archive.pm @@ -39,6 +39,7 @@ package BackupPC::CGI::Archive; use strict; use BackupPC::CGI::Lib qw(:all); use Data::Dumper; +use DBI; sub action { @@ -71,6 +72,29 @@ sub action } $fullSizeTot += $fullSize + $incrSizeTot; $fullSize = sprintf("%.2f", ($fullSize + $incrSizeTot) / 1000); + + $bpc->ConfigRead($archHost); + %Conf = $bpc->Conf(); + + my $dbh = DBI->connect($Conf{SearchDSN}, $Conf{SearchUser}, "", { RaiseError => 1, AutoCommit => 0 }); + my $backup_nums = $dbh->selectcol_arrayref(qq{ + select + backups.num as num + from backups + join hosts on hosts.id = hostid + where hosts.name = ? and inc_size < 0 and size > 0 and not inc_deleted + }, {}, $host); + + my $checkboxes; + foreach my $backupnumber ( sort @$backup_nums ) { + $checkboxes .= qq| + +$backupnumber + |; + $checkBoxCnt++; + } + +=for ASA extension removed this $str = <  ${HostLink($host)} @@ -78,6 +102,20 @@ sub action $fullSize EOF $checkBoxCnt++; +=cut + + $str = < + +${HostLink($host)} +$checkboxes + + +${UserLink($Hosts->{$host}{user})} + + $fullSize +EOF + if ( @Backups == 0 ) { $hostCntNone++; $strNone .= $str; @@ -131,7 +169,7 @@ EOF EOF $HostListStr .= < ${EscHTML($name)} +
  • ${EscHTML($name)} $i EOF } $hiddenStr .= <