--- trunk/lib/BackupPC/SearchLib.pm 2005/09/22 13:31:04 128 +++ trunk/lib/BackupPC/SearchLib.pm 2005/10/07 11:15:28 145 @@ -293,6 +293,35 @@ } +sub getGzipSize($$) +{ + my ($hostID, $backupNum) = @_; + my $ret; + my $sql; + my $dbh = get_dbh(); + + $sql = q{ + SELECT hosts.name as host, + shares.name as share, + backups.num as backupnum + FROM hosts, backups, shares + WHERE shares.id=backups.shareid AND + hosts.id =backups.hostid AND + hosts.id=? AND + backups.num=? + }; + my $sth = $dbh->prepare($sql); + $sth->execute($hostID, $backupNum); + + my $row = $sth->fetchrow_hashref(); + + my (undef,undef,undef,undef,undef,undef,undef,$ret,undef,undef,undef,undef,undef) = + stat( $Conf{InstallDir}.'/'.$Conf{GzipTempDir}.'/'. + getGzipName($row->{'host'}, $row->{share}, $row->{'backupnum'})); + + return $ret; +} + sub getBackupsNotBurned() { my $dbh = get_dbh(); @@ -302,15 +331,16 @@ backups.hostID AS hostID, hosts.name AS host, shares.name AS share, - backups.id AS backupnum, + backups.num AS backupnum, backups.type AS type, backups.date AS date, - backups.size AS size + backups.size AS size, + backups.id AS id FROM backups INNER JOIN shares ON backups.shareID=shares.ID INNER JOIN hosts ON backups.hostID = hosts.ID - LEFT OUTER JOIN archive_backup ON archive_backup.backup_id = backups.id AND archive_backup.backup_id IS NULL - WHERE backups.size > 0 + LEFT OUTER JOIN archive_backup ON archive_backup.backup_id = backups.id + WHERE backups.size > 0 AND archive_backup.backup_id IS NULL GROUP BY backups.hostID, hosts.name, @@ -343,90 +373,113 @@ sub displayBackupsGrid() { my $retHTML .= q{ -
+ }; $retHTML .= <<'EOF3'; - -
-Size: - +Size: kB
-
-
-
 
+
 
+
 
+
0%
-
+ Note: -
- -
- + + +
+ EOF3 $retHTML .= q{ @@ -644,18 +699,20 @@ } my $ftype = ""; + my $checkbox_key = $backup->{'hostid'}. '_' .$backup->{'backupnum'} . '_' . $backup->{'id'}; + $retHTML .= ' '; + # FIXME $backup->{'fs_size'} = int($backup->{'size'} * 1024); + if (($backup->{'fs_size'} || 0) > 0) { $retHTML .= ' - '; + '; } + $retHTML .= '' . '' . $backup->{'host'} . ':' . $backup->{'share'} . '' . @@ -665,7 +722,7 @@ '' . $backup->{'age'} . '' . '' . $backup->{'size'} . '' . '' . $backup->{'fs_size'} . - '' . + '' . "\n"; }