From a31477d19f3f996253b9e2100e737a19552b8e63 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 26 Oct 2007 18:01:20 +0000 Subject: [PATCH] ebl Add an option to view only expired media git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5815 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/cgi/bweb.pl | 2 +- gui/bweb/lang/es/tpl/display_form_media.tpl | 7 +++++++ gui/bweb/lang/fr/tpl/display_form_media.tpl | 7 +++++++ gui/bweb/lib/Bweb.pm | 12 ++++++++++-- gui/bweb/tpl/begin.tpl | 2 +- gui/bweb/tpl/display_form_media.tpl | 8 ++++++++ 6 files changed, 34 insertions(+), 4 deletions(-) diff --git a/gui/bweb/cgi/bweb.pl b/gui/bweb/cgi/bweb.pl index b6d1e97dfa..4dd5fbbd2e 100755 --- a/gui/bweb/cgi/bweb.pl +++ b/gui/bweb/cgi/bweb.pl @@ -112,7 +112,7 @@ if ($action eq 'begin') { # main display } elsif ($action eq 'media') { print "
+ + + + + + + + + +
\n"; - my $fields = $bweb->get_form(qw/db_locations db_pools + my $fields = $bweb->get_form(qw/db_locations db_pools expired qlocations qpools volstatus qre_media limit qmediatypes db_mediatypes/); $bweb->display($fields, "display_form_media.tpl"); diff --git a/gui/bweb/lang/es/tpl/display_form_media.tpl b/gui/bweb/lang/es/tpl/display_form_media.tpl index 3839f5122d..46e7f4f57c 100644 --- a/gui/bweb/lang/es/tpl/display_form_media.tpl +++ b/gui/bweb/lang/es/tpl/display_form_media.tpl @@ -58,6 +58,13 @@ value= class='formulaire' size='8'>
+

Expired media

+ checked + class='formulaire'> +
diff --git a/gui/bweb/lang/fr/tpl/display_form_media.tpl b/gui/bweb/lang/fr/tpl/display_form_media.tpl index 58619705a0..d5ab73c83a 100644 --- a/gui/bweb/lang/fr/tpl/display_form_media.tpl +++ b/gui/bweb/lang/fr/tpl/display_form_media.tpl @@ -58,6 +58,13 @@ value= class='formulaire' size='8'>
+

Médias expirés

+ checked + class='formulaire'> +
diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index d8c275ec44..9568798733 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -1428,6 +1428,7 @@ sub get_form type => 1, poolrecycle => 1, replace => 1, + expired => 1, ); my %opt_p = ( # option with path fileset=> 1, @@ -2167,7 +2168,7 @@ sub display_media 'volstatus', 'locations'); - my $arg = $self->get_form('jmedias', 'qre_media'); + my $arg = $self->get_form('jmedias', 'qre_media', 'expired'); if ($arg->{jmedias}) { $where = "AND Media.VolumeName IN ($arg->{jmedias}) $where"; @@ -2175,6 +2176,13 @@ sub display_media if ($arg->{qre_media}) { $where = "AND Media.VolumeName $self->{sql}->{MATCH} $arg->{qre_media} $where"; } + if ($arg->{expired}) { + $where = " + AND VolStatus = 'Full' + AND ( $self->{sql}->{UNIX_TIMESTAMP}(Media.LastWritten) + + $self->{sql}->{TO_SEC}(Media.VolRetention) + ) < NOW() " . $where ; + } my $query=" SELECT Media.VolumeName AS volumename, @@ -2209,7 +2217,7 @@ $limit $self->display({ ID => $cur_id++, Pool => $elt{pool}, Location => $elt{location}, - Medias => [ values %$all ] + Medias => [ values %$all ], }, "display_media.tpl"); } diff --git a/gui/bweb/tpl/begin.tpl b/gui/bweb/tpl/begin.tpl index 346325433e..e876123d8f 100644 --- a/gui/bweb/tpl/begin.tpl +++ b/gui/bweb/tpl/begin.tpl @@ -26,7 +26,7 @@ if (navigator.appName == 'Konqueror') {
  • Groups
  • -
  • Jobs +
  • Jobs
    • Defined Jobs
    • Jobs by group diff --git a/gui/bweb/tpl/display_form_media.tpl b/gui/bweb/tpl/display_form_media.tpl index e4ce0c951b..6944073b4d 100644 --- a/gui/bweb/tpl/display_form_media.tpl +++ b/gui/bweb/tpl/display_form_media.tpl @@ -58,6 +58,14 @@ value= class='formulaire' size='8'>
  • +

    Expired media

    + checked + class='formulaire'> +
    -- 2.39.5