=cut
-# TODO:
-# Si c'est un fichier selectionne, afficher ses attributs
-# ajouter le base_fic et base_url dans les options bweb
-#
-
use strict;
use POSIX qw/strftime/;
use Bweb;
use Digest::MD5 qw(md5_hex);
use File::Basename qw/basename dirname/;
-my $conf = new Bweb::Config(config_file => '/etc/bweb/config');
+my $conf = new Bweb::Config(config_file => $Bweb::config_file);
$conf->load();
my $bweb = new Bweb(info => $conf);
$bweb->connect_db();
exit 0;
}
-unless (-w $base_fich) {
- $bweb->error("$base_fich is not writable");
+unless ($base_fich and -w $base_fich) {
+ $bweb->error("fv_write_path ($base_fich) is not writable." .
+ " See Bweb configuration.");
exit 0;
}
my $size = fv_compute_size($jobid, $dir->[0]);
$sum += $size;
- my $chld = $ccircle->add_part($size * 100 / $max,
+ my $per = $size * 100 / $max;
+ my $chld = $ccircle->add_part($per,
basename($dir->[1]) . '/',
basename($dir->[1])
- . "\n"
+ . sprintf(' %.0f%% ', $per)
. Bweb::human_size($size)
) ;
if ($sum < $max) {
$ccircle->add_part(($max - $sum) * 100 / $max,
- "other files < 3",
+ "other files < 3%",
"other\n" . Bweb::human_size($max - $sum));
}
my $ret = $bweb->dbh_selectall_arrayref("
SELECT P.PathId,
- (
- SELECT Path FROM Path WHERE PathId = P.PathId
- UNION
- SELECT Path FROM brestore_missing_path WHERE PathId = P.PathId
- ) AS Path
+ ( SELECT Path FROM Path WHERE PathId = P.PathId) AS Path
FROM (
SELECT PathId
FROM brestore_pathvisibility
{
my ($path) = @_;
$path = $bweb->dbh_quote($path);
- my $ret = $bweb->dbh_selectrow_hashref("
-SELECT PathId FROM Path WHERE Path = $path
- UNION
-SELECT PathId FROM brestore_missing_path WHERE PATH = $path
-");
+ my $ret = $bweb->dbh_selectrow_hashref("SELECT PathId FROM Path WHERE Path = $path");
return $ret->{pathid};
}
END;
$$ language 'plpgsql';
-ALTER TABLE brestore_pathvisibility ADD Size int8;
+ALTER TABLE brestore_pathvisibility ADD Size int8;
+
+
+
+ALTER TABLE brestore_pathvisibility ADD Files int4;