From: Eric Bollengier Date: Tue, 31 Oct 2006 21:19:16 +0000 (+0000) Subject: ebl fix remove Purged and Recycle volume size from total pool size X-Git-Tag: Release-2.0.0~336 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6da9fd96f244d0b7d1d679d81e9fac0cfd1cb649;p=bacula%2Fbacula ebl fix remove Purged and Recycle volume size from total pool size git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3581 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/ReleaseNotes b/gui/bweb/ReleaseNotes index 68a4f63c5f..b84bcd74b9 100644 --- a/gui/bweb/ReleaseNotes +++ b/gui/bweb/ReleaseNotes @@ -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 diff --git a/gui/bweb/lang/fr/tpl/begin.tpl b/gui/bweb/lang/fr/tpl/begin.tpl index 46be961691..3d6408fff5 100644 --- a/gui/bweb/lang/fr/tpl/begin.tpl +++ b/gui/bweb/lang/fr/tpl/begin.tpl @@ -27,7 +27,7 @@ if (navigator.appName == 'Konqueror') {
  • Historique
  • Jobs en cours
  • Prochains Jobs
  • -
  • Restaure
  • +
  • Restauration
  • Medias diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index c9f4ee821a..75242cd7f9 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -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;