]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl fix remove Purged and Recycle volume size from total pool size
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 31 Oct 2006 21:19:16 +0000 (21:19 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 31 Oct 2006 21:19:16 +0000 (21:19 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3581 91ce42f0-d328-0410-95d8-f526ca767f89

gui/bweb/ReleaseNotes
gui/bweb/lang/fr/tpl/begin.tpl
gui/bweb/lib/Bweb.pm

index 68a4f63c5f906980ef53f3242e7e1f935c4448e6..b84bcd74b923b89e7a89805f471f6cdc3eb1a201 100644 (file)
@@ -1,4 +1,7 @@
-          Release Notes for bweb 1.39.23
+          Release Notes for bweb 1.39.26
+
+2006/10/31:
+ - remove Purged and Recycle volume size from total pool size
 
 2006/10/26:
  - Fix javascript sort bug
index 46be96169107a3c4f9da0561d39138a2936ce565..3d6408fff54d1b9338916b09ae2d2cc25cf797b4 100644 (file)
@@ -27,7 +27,7 @@ if (navigator.appName == 'Konqueror') {
      <li><a href="?action=job">Historique</a> </li>
      <li><a href="?action=running">Jobs en cours</a>
      <li><a href="?action=next_job">Prochains Jobs</a> </li>
-     <li><a href="?action=restore" title="Lancer brestore">Restaure</a> </li>
+     <li><a href="?action=restore" title="Lancer brestore">Restauration</a> </li>
    </ul>
  </li>
  <li style="padding: 0.25em 2em;">Medias
index c9f4ee821a6f560c31935c735f14252224eae87c..75242cd7f9f06e39f19ca92f0a30d499d3b5858d 100644 (file)
@@ -2459,8 +2459,21 @@ LEFT JOIN Pool ON (Pool.PoolId = subq.PoolId)
 
     my $all = $self->dbh_selectall_hashref($query, 'name') ;
 
+    $query = "
+SELECT Pool.Name AS name,
+       sum(VolBytes) AS size
+FROM   Media JOIN Pool ON (Media.PoolId = Pool.PoolId)
+WHERE  Media.VolStatus IN ('Recycled', 'Purged')
+GROUP BY Pool.Name;
+";
+    my $empty = $self->dbh_selectall_hashref($query, 'name');
+
     foreach my $p (values %$all) {
        if ($p->{volmax} > 0) { # mysql returns 0.0000
+           # we remove Recycled/Purged media from pool usage
+           if (defined $empty->{$p->{name}}) {
+               $p->{voltotal} -= $empty->{$p->{name}}->{size};
+           }
            $p->{poolusage} = sprintf('%.2f', $p->{voltotal} * 100/ $p->{volmax}) ;
        } else {
            $p->{poolusage} = 0;