From: Eric Bollengier Date: Sun, 22 Aug 2010 17:06:49 +0000 (+0200) Subject: bweb: Add display_files action to list files for a jobid X-Git-Tag: Release-5.2.1~1152 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7ef982d1c0873fb86d104c9d5cf14e56e6c0b330;p=bacula%2Fbacula bweb: Add display_files action to list files for a jobid --- diff --git a/gui/bweb/cgi/bweb.pl b/gui/bweb/cgi/bweb.pl index 8634bfa018..2510111516 100755 --- a/gui/bweb/cgi/bweb.pl +++ b/gui/bweb/cgi/bweb.pl @@ -6,7 +6,7 @@ use strict ; Bweb - A Bacula web interface Bacula® - The Network Backup Solution - Copyright (C) 2000-2006 Free Software Foundation Europe e.V. + Copyright (C) 2006-2010 Free Software Foundation Europe e.V. The main author of Bweb is Eric Bollengier. The main author of Bacula is Kern Sibbald, with contributions from @@ -31,10 +31,6 @@ use strict ; (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. -=head1 VERSION - - $Id$ - =cut use Data::Dumper; @@ -136,6 +132,9 @@ if ($action eq 'begin') { # main display } elsif ($action eq 'cmd_storage') { $bweb->cmd_storage(); +} elsif ($action eq 'list_files') { + $bweb->display_files(); + } elsif ($action eq 'media') { $bweb->can_do('r_view_media'); diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index 9a251e9752..6ddbfc39ee 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -6,7 +6,7 @@ use strict; Bweb - A Bacula web interface Bacula® - The Network Backup Solution - Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + Copyright (C) 2006-2010 Free Software Foundation Europe e.V. The main author of Bweb is Eric Bollengier. The main author of Bacula is Kern Sibbald, with contributions from @@ -31,10 +31,6 @@ use strict; (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. -=head1 VERSION - - $Id$ - =cut package Bweb::Gui; @@ -4242,6 +4238,33 @@ sub restore use Bconsole; +sub display_files +{ + my ($self) = @_ ; + $self->can_do('r_view_job'); + + my $arg = $self->get_form(qw/limit offset jobid/); + if (!$arg->{jobid}) { + return $self->error("Can't get jobid"); + } + + $self->display({ + title => "Content of JobId $arg->{jobid} ", + name => "list files jobid=$arg->{jobid}", + notail => 1, + id => $cur_id++, + }, "command.tpl"); + + my $b = new Bconsole(pref => $self->{info},timeout => 60); + $b->connect(); + $b->log_stdout(1); + $b->send_cmd("list files jobid=$arg->{jobid} limit=$arg->{limit}"); # TODO: add offset + + $self->display({ + nohead => 1, + }, "command.tpl"); +} + sub ach_get { my ($self, $name) = @_;