* Added directory history display to BackupPC_Admin, allowing the
user to quickly see which files changed between backups.
+* Browsing and directory history now sort the files in a
+ case-insensitive manner.
+
* Swapped the Server and Hosts sections on the Nav bar. Moved the
host search text box to the top of the hosts section. This was
done to move the variable-length part of the Nav bar (when all
my $nameCnt = 0;
(my $fDisp = "${EscHTML($f)}") =~ s/ / /g;
$fileStr .= "<tr><td align=left>$fDisp</td>";
- my($colSpan, $url, $inode, $type);
+ my($colSpan, $url, $inode, $type, $tdColor);
for ( $i = 0 ; $i < @Backups ; $i++ ) {
my($path);
if ( $colSpan > 0 ) {
$colSpan++;
next;
}
- $fileStr .= "<td align=center colspan=$colSpan>$url</td>";
+ #
+ # Also handle the case of a sequence of missing files
+ #
+ if ( !defined($hist->{$f}[$i]) && $inode == -3 ) {
+ $colSpan++;
+ next;
+ }
+ $fileStr .= "<td align=center colspan=$colSpan$tdColor>"
+ . "$url</td>";
$colSpan = 0;
+ $tdColor = "";
}
if ( !defined($hist->{$f}[$i]) ) {
- $fileStr .= "<td></td>";
+ $colSpan = 1;
+ $url = " ";
+ $inode = -3; # special value for missing
+ $tdColor = ' bgcolor="#ffffaa"';
next;
}
if ( $dir eq "" ) {
$path =~ s/([^\w.\/-])/uc sprintf("%%%02X", ord($1))/eg;
my $num = $hist->{$f}[$i]{backupNum};
if ( $hist->{$f}[$i]{type} == BPC_FTYPE_DIR ) {
- $inode = -2;
+ $inode = -2; # special value for dir
$type = $hist->{$f}[$i]{type};
$url = <<EOF;
-<a href="$MyURL?action=dirHistory&host=${EscURI($host)}&num=$num&share=$shareURI&dir=$path">dir</a>
+<a href="$MyURL?action=dirHistory&host=${EscURI($host)}&num=$num&share=$shareURI&dir=$path">$Lang->{DirHistory_dirLink}</a>
EOF
} else {
$inode = $hist->{$f}[$i]{inode};
$type = $hist->{$f}[$i]{type};
+ #
+ # special value for empty file
+ #
$inode = -1 if ( $hist->{$f}[$i]{size} == 0 );
if ( !defined($inode2name{$inode}) ) {
- $inode2name{$inode} = "v$nameCnt";
+ $inode2name{$inode}
+ = "$Lang->{DirHistory_fileLink}$nameCnt";
$nameCnt++;
}
$url = <<EOF;
$colSpan = 1;
}
if ( $colSpan > 0 ) {
- $fileStr .= "<td align=center colspan=$colSpan>$url</td>";
+ $fileStr .= "<td align=center colspan=$colSpan$tdColor>$url</td>";
$colSpan = 0;
}
$fileStr .= "</tr>\n";
use strict;
use BackupPC::CGI::Lib qw(:all);
+use Data::Dumper;
sub action
{
-#!/bin/perl -T
+#!/bin/perl
#
# by Manfred Herrmann (V1.1) (some typo errors + 3 new strings)
# CVS-> Revision ???
# ------------------------------
$Lang{DirHistory_backup_for__host} = "(ENGLISH) BackupPC: Directory backup history for \$host";
+#
+# These two strings are used to build the links for directories and
+# file versions. Files are appended with a version number.
+#
+$Lang{DirHistory_dirLink} = "(ENGLISH) dir";
+$Lang{DirHistory_fileLink} = "(ENGLISH) v";
+
$Lang{DirHistory_for__host} = <<EOF;
+\${h1("Directory backup history for \$host")}
(ENGLISH)
-\${h1("Backup history for \$host")}
-
+<p>
This display shows each unique version of files across all
the backups:
<ul>
<li> Click on a backup number to return to the backup browser,
-<li> Click on a directory link to navigate into that directory,
-<li> Click on a file version link to download that file.
+<li> Click on a directory link (\$Lang->{DirHistory_dirLink}) to navigate
+ into that directory,
+<li> Click on a file version link (\$Lang->{DirHistory_fileLink}0,
+ \$Lang->{DirHistory_fileLink}1, ...) to download that file,
+<li> Files with the same contents between different backups have the same
+ version number,
+<li> Files or directories not present in a particular backup have an
+ empty box.
+<li> Files shown with the same version might have different attributes.
+ Select the backup number to see the file attributes.
</ul>
\${h2("History of \${EscHTML(\$dirDisplay)}")}
<br>
-<table border>
-<tr><td>Backup number</td>\$backupNumStr</tr>
-<tr><td>Backup time</td>\$backupTimeStr</tr>
+<table border bgcolor="#ffffcc">
+<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup number</td>\$backupNumStr</tr>
+<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup time</td>\$backupTimeStr</tr>
\$fileStr
</table>
EOF
-#!/bin/perl -T
+#!/bin/perl
#my %lang;
# ------------------------------
$Lang{DirHistory_backup_for__host} = "BackupPC: Directory backup history for \$host";
-$Lang{DirHistory_for__host} = <<EOF;
-\${h1("Backup history for \$host")}
+#
+# These two strings are used to build the links for directories and
+# file versions. Files are appended with a version number.
+#
+$Lang{DirHistory_dirLink} = "dir";
+$Lang{DirHistory_fileLink} = "v";
+$Lang{DirHistory_for__host} = <<EOF;
+\${h1("Directory backup history for \$host")}
+<p>
This display shows each unique version of files across all
the backups:
<ul>
<li> Click on a backup number to return to the backup browser,
-<li> Click on a directory link to navigate into that directory,
-<li> Click on a file version link to download that file.
+<li> Click on a directory link (\$Lang->{DirHistory_dirLink}) to navigate
+ into that directory,
+<li> Click on a file version link (\$Lang->{DirHistory_fileLink}0,
+ \$Lang->{DirHistory_fileLink}1, ...) to download that file,
+<li> Files with the same contents between different backups have the same
+ version number,
+<li> Files or directories not present in a particular backup have an
+ empty box.
+<li> Files shown with the same version might have different attributes.
+ Select the backup number to see the file attributes.
</ul>
\${h2("History of \${EscHTML(\$dirDisplay)}")}
<br>
-<table border>
-<tr><td>Backup number</td>\$backupNumStr</tr>
-<tr><td>Backup time</td>\$backupTimeStr</tr>
+<table border bgcolor="#ffffcc">
+<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup number</td>\$backupNumStr</tr>
+<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup time</td>\$backupTimeStr</tr>
\$fileStr
</table>
EOF
-#!/bin/perl -T
+#!/bin/perl
#my %lang;
# ------------------------------
$Lang{DirHistory_backup_for__host} = "(ENGLISH) BackupPC: Directory backup history for \$host";
+#
+# These two strings are used to build the links for directories and
+# file versions. Files are appended with a version number.
+#
+$Lang{DirHistory_dirLink} = "(ENGLISH) dir";
+$Lang{DirHistory_fileLink} = "(ENGLISH) v";
+
$Lang{DirHistory_for__host} = <<EOF;
+\${h1("Directory backup history for \$host")}
(ENGLISH)
-\${h1("Backup history for \$host")}
-
+<p>
This display shows each unique version of files across all
the backups:
<ul>
<li> Click on a backup number to return to the backup browser,
-<li> Click on a directory link to navigate into that directory,
-<li> Click on a file version link to download that file.
+<li> Click on a directory link (\$Lang->{DirHistory_dirLink}) to navigate
+ into that directory,
+<li> Click on a file version link (\$Lang->{DirHistory_fileLink}0,
+ \$Lang->{DirHistory_fileLink}1, ...) to download that file,
+<li> Files with the same contents between different backups have the same
+ version number,
+<li> Files or directories not present in a particular backup have an
+ empty box.
+<li> Files shown with the same version might have different attributes.
+ Select the backup number to see the file attributes.
</ul>
\${h2("History of \${EscHTML(\$dirDisplay)}")}
<br>
-<table border>
-<tr><td>Backup number</td>\$backupNumStr</tr>
-<tr><td>Backup time</td>\$backupTimeStr</tr>
+<table border bgcolor="#ffffcc">
+<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup number</td>\$backupNumStr</tr>
+<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup time</td>\$backupTimeStr</tr>
\$fileStr
</table>
EOF
-#!/bin/perl -T
+#!/bin/perl
#my %lang;
#use strict;
# ------------------------------
$Lang{DirHistory_backup_for__host} = "BackupPC: Historique de sauvegarde des répertoires de \$host";
-$Lang{DirHistory_for__host} = <<EOF;
-\${h1("Historique de sauvegarde pour \$host")}
+#
+# These two strings are used to build the links for directories and
+# file versions. Files are appended with a version number.
+#
+$Lang{DirHistory_dirLink} = "(ENGLISH) dir";
+$Lang{DirHistory_fileLink} = "(ENGLISH) v";
+$Lang{DirHistory_for__host} = <<EOF;
+\${h1("Historique de sauvegarde des répertoires de \$host")}
+<p>
Voici les versions des fichiers pour toutes les sauvegardes:
<ul>
<li> Cliquez sur un numéro de sauvegarde pour revenir à la navigation de sauvegarde,
-<li> Cliquez sur un répertoire pour naviguer dans celui-ci,
-<li> Cliquez sur une version d'un fichier pour la télécharger.
+<li> Cliquez sur un répertoire (\$Lang->{DirHistory_dirLink}) pour naviguer
+ dans celui-ci,
+<li> Cliquez sur une version d'un fichier (\$Lang->{DirHistory_fileLink}0,
+ \$Lang->{DirHistory_fileLink}1, ...) pour la télécharger.
+<li> (ENGLISH) Files with the same contents between different backups have the same
+ version number,
+<li> (ENGLISH) Files or directories not present in a particular backup have an
+ empty box.
+<li> (ENGLISH) Files shown with the same version might have different attributes.
+ Select the backup number to see the file attributes.
</ul>
\${h2("Historique de \${EscHTML(\$dirDisplay)}")}
<br>
-<table border>
-<tr><td>No. de sauvegarde</td>\$backupNumStr</tr>
-<tr><td>Date</td>\$backupTimeStr</tr>
+<table border bgcolor="#ffffcc">
+<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>No. de sauvegarde</td>\$backupNumStr</tr>
+<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Date</td>\$backupTimeStr</tr>
\$fileStr
</table>
EOF
my $a = $attr->get;
foreach my $fileUM ( keys(%$a) ) {
next if ( $a->{$fileUM}{type} != BPC_FTYPE_DELETED );
- $files->{$fileUM}[$i] = undef;
+ $files->{$fileUM}[$i] = undef if ( defined($files->{$fileUM}) );
}
}
}