]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl fix documenation to activate bfileview
authorEric Bollengier <eric@eb.homelinux.org>
Sat, 30 Dec 2006 10:54:47 +0000 (10:54 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Sat, 30 Dec 2006 10:54:47 +0000 (10:54 +0000)
ebl  add a confirm box when jobfiles > 5000
ebl  cleanup fv_file_attribs.pl
ebl  add apache configuration example

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3862 91ce42f0-d328-0410-95d8-f526ca767f89

gui/bweb/INSTALL
gui/bweb/cgi/bfileview.pl
gui/bweb/lang/fr/tpl/display_job_zoom.tpl
gui/bweb/lang/fr/tpl/fv_file_attribs.tpl
gui/bweb/script/bweb.conf
gui/bweb/tpl/display_job_zoom.tpl
gui/bweb/tpl/fv_file_attribs.tpl

index c18681102628efdb0d206091ca129d8a568442b1..fd11b7bac423501e4298a39b57ce4a373aff49dd 100644 (file)
@@ -189,10 +189,13 @@ mkdir /var/spool/bweb
 chmod 700 /var/spool/bweb
 chown www-data /var/spool/bweb
 
+You have to remove "<!-- Remove this to activate bfileview" and "-->" from
+tpl/display_job_zoom.tpl.
+
 You must use brestore.pl -b to initialise the database, and
 you can use bfileview.pl mode=batch jobid=xxx where=/ to compute tree size.
 
-At this time, it's a good idea to schedule brestore.pl -g after your 
+At this time, it's a good idea to schedule brestore.pl -b after your 
 BackupCatalog job.
 
 Job {
index ff4086e9a1ff89fec40301711c0bfeb00de65e50..87ca7029ca9a6b376927002c94a39ff1fb6c55fa 100755 (executable)
@@ -43,6 +43,7 @@
 #
 
 use strict;
+use POSIX qw/strftime/;
 use Bweb;
 use CCircle ;
 use Digest::MD5 qw(md5_hex);
@@ -65,9 +66,7 @@ my $md5_rep = md5_hex("$where:$jobid") ;
 my $base_url = '/bweb/fv' ;
 my $base_fich = $conf->{fv_write_path};
 
-die "Can't get where" unless ($where and $jobid);
-
-if ($batch eq 'batch') {
+if ($where and $jobid and $batch eq 'batch') {
     my $root = fv_get_root_pathid($where);
     if ($root) {
        fv_compute_size($jobid, $root);
@@ -80,6 +79,16 @@ print CGI::header('text/html');
 $bweb->display_begin();
 $bweb->display_job_zoom($jobid);
 
+unless ($where and $jobid) {
+    $bweb->error("Can't get where or jobid");
+    exit 0;
+}
+
+unless (-w $base_fich) {
+    $bweb->error("$base_fich is not writable");
+    exit 0;
+}
+
 if (-f "$base_fich/$md5_rep.png" and -f "$base_fich/$md5_rep.tpl")
 {
     $bweb->display({}, "$base_fich/$md5_rep.tpl");
@@ -237,8 +246,13 @@ sub fv_get_file_attribute
     my $path     = $bweb->dbh_quote(dirname($full_name) . "/");
 
     my $attr = $bweb->dbh_selectrow_hashref("
- SELECT 1 AS found,
-        base64_decode_lstat(8, lstat) AS size
+ SELECT 1    AS found,
+        MD5  AS md5,
+        base64_decode_lstat(8,  LStat) AS size,
+        base64_decode_lstat(11, LStat) AS atime,
+        base64_decode_lstat(12, LStat) AS mtime,
+        base64_decode_lstat(13, LStat) AS ctime
+
    FROM File INNER JOIN Filename USING (FilenameId)
              INNER JOIN Path     USING (PathId)
   WHERE Name  = $filename
@@ -248,6 +262,9 @@ sub fv_get_file_attribute
 
     $attr->{filename} = $full_name;
     $attr->{size} = Bweb::human_size($attr->{size});
+    foreach my $d (qw/atime ctime mtime/) {
+       $attr->{$d} = strftime('%F %H:%M', localtime($attr->{$d}));
+    }
     return $attr;
 }
 
@@ -270,7 +287,7 @@ sub fv_get_files_size
     my ($jobid, $rep) = @_;
 
     my $ret = $bweb->dbh_selectrow_hashref("
- SELECT sum(base64_decode_lstat(8,lstat)) AS size
+ SELECT sum(base64_decode_lstat(8,LStat)) AS size
    FROM File
   WHERE PathId  = $rep
     AND JobId = $jobid
@@ -286,7 +303,7 @@ sub fv_get_big_files
     my $ret = $bweb->dbh_selectall_arrayref("
    SELECT Name, size
    FROM (
-         SELECT FilenameId,base64_decode_lstat(8,lstat) AS size
+         SELECT FilenameId,base64_decode_lstat(8,LStat) AS size
            FROM File
           WHERE PathId  = $rep
             AND JobId = $jobid
index 9a52d63ab91d720f1b47189567773bf7374b94d2..1a21dd59ca601f51ef395d3ae46b6b5a50194021 100644 (file)
@@ -57,7 +57,9 @@
   <input type='hidden' name='jobid' value='<TMPL_VAR jobid>'>
   <input type='hidden' name='where' value='/'>
   <label>
-  <input type="image" name='action' value='bfileview' title="Voir la répartition des fichiers"
+  <input type="image" name='action' value='bfileview' 
+   title="Voir la répartition des fichiers"
+   onclick='if (<TMPL_VAR JobFiles> > 5000) { return confirm("Ce traitement peut prendre beaucoup de temps, voulez vous continuer ?")} else { return 1; }'
    src='/bweb/colorscm.png'> Voir la répartition des fichiers
   </label>
  </form>
index bb4dd24b2e9e3f88a9da5d2ffe21556dc643acae..f40954ad76f79a99fc2dfd9485a13b16ce484d8b 100644 (file)
@@ -1,2 +1,12 @@
-Filename : <TMPL_VAR filename><br/>
-Size     : <TMPL_VAR size><br/>
+<div class='titlediv'>
+  <h1 class='newstitle'> Informations sur <TMPL_VAR filename> </h1>
+</div>
+<div class='bodydiv'>
+   <table>
+    <tr><td>taille : </td> <td> <TMPL_VAR size>  </td></tr>
+    <tr><td>ctime :  </td> <td> <TMPL_VAR atime> </td></tr>
+    <tr><td>mtime :  </td> <td> <TMPL_VAR mtime> </td></tr>
+    <tr><td>atime :  </td> <td> <TMPL_VAR atime> </td></tr>
+    <tr><td>md5 :    </td> <td> <TMPL_VAR md5>   </td></tr>
+   </table>
+</div>
index 7cfa294fcd14ce3191f5c0c48e9e6ab4abf6ae40..8d6e28421432a615aedbe2a6c36ff8101ecdaf01 100644 (file)
@@ -7,6 +7,14 @@
         Require valid-user
 </Directory>
 
+Alias /bweb/fv /var/spool/bweb
+<Directory "/var/spool/bweb">
+    Options None
+    AllowOverride AuthConfig
+    Order allow,deny
+    Allow from all
+</Directory>
+
 Alias /bweb /usr/share/bweb/html
 <Directory "/usr/share/bweb/html">
     Options None
@@ -14,3 +22,4 @@ Alias /bweb /usr/share/bweb/html
     Order allow,deny
     Allow from all
 </Directory>
+
index b0534e1083863e0c9269c71bd12ce17397768761..8203ef13ca91b23485117600de74fa5762a9800a 100644 (file)
   </label>
  </form>
  </td>
-<!-- Remove this to enable fileview
+<!-- Remove this to activate bfileview
  <td>
  <form action='bfileview.pl?'>
   <input type='hidden' name='jobid' value='<TMPL_VAR jobid>'>
   <input type='hidden' name='where' value='/'>
   <label>
   <input type="image" name='action' value='bfileview' title='view file usage'
-   src='/bweb/colorscm.png'> View file usage
+   src='/bweb/colorscm.png' onclick='if (<TMPL_VAR JobFiles> > 5000) { return confirm("It could take long time, do you want to continue ?")} else { return 1; }'> View file usage
   </label>
  </form>
  </td>
index bb4dd24b2e9e3f88a9da5d2ffe21556dc643acae..0032c5b520dfaccbb32d317b5632b2ecf8146870 100644 (file)
@@ -1,2 +1,12 @@
-Filename : <TMPL_VAR filename><br/>
-Size     : <TMPL_VAR size><br/>
+<div class='titlediv'>
+  <h1 class='newstitle'> Informations about <TMPL_VAR filename> </h1>
+</div>
+<div class='bodydiv'>
+   <table>
+    <tr><td>size : </td> <td> <TMPL_VAR size>  </td></tr>
+    <tr><td>ctime :</td> <td> <TMPL_VAR atime> </td></tr>
+    <tr><td>mtime :</td> <td> <TMPL_VAR mtime> </td></tr>
+    <tr><td>atime :</td> <td> <TMPL_VAR atime> </td></tr>
+    <tr><td>md5 :  </td> <td> <TMPL_VAR md5>   </td></tr>
+   </table>
+</div>