]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/bweb/cgi/bfileview.pl
ebl fix mediatype in display_pool
[bacula/bacula] / gui / bweb / cgi / bfileview.pl
index 87ca7029ca9a6b376927002c94a39ff1fb6c55fa..6c07e83aac5cf2094bffcace2b889b1a0d3800ed 100755 (executable)
 
 =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;
@@ -49,7 +44,7 @@ use CCircle ;
 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();
@@ -84,8 +79,9 @@ unless ($where and $jobid) {
     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;
 }
 
@@ -165,10 +161,11 @@ sub fv_display_rep
        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)
                                      ) ;
        
@@ -188,7 +185,7 @@ sub fv_display_rep
 
     if ($sum < $max) {
        $ccircle->add_part(($max - $sum) * 100 / $max, 
-                          "other files < 3",
+                          "other files < 3%",
                           "other\n" . Bweb::human_size($max - $sum));
     }
 
@@ -221,11 +218,7 @@ sub fv_list_dirs
 
     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 
@@ -333,11 +326,7 @@ sub fv_get_root_pathid
 {
     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};
 }
 
@@ -360,4 +349,8 @@ RETURN val;
 END;
 $$ language 'plpgsql';
 
-ALTER TABLE brestore_pathvisibility ADD Size int8;
+ALTER TABLE brestore_pathvisibility ADD Size  int8;
+
+
+
+ALTER TABLE brestore_pathvisibility ADD Files int4;