From: Eric Bollengier Date: Thu, 24 May 2007 20:01:28 +0000 (+0000) Subject: ebl add media limit offset option X-Git-Tag: Release-2.2.0~395 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=684629dd16901172384570c8b593ca9d9d567a18;p=bacula%2Fbacula ebl add media limit offset option ebl add Bconsole error to STDERR git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4899 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/cgi/bweb.pl b/gui/bweb/cgi/bweb.pl index 7ab92e1de0..5e9f0f71c0 100755 --- a/gui/bweb/cgi/bweb.pl +++ b/gui/bweb/cgi/bweb.pl @@ -118,7 +118,8 @@ if ($action eq 'begin') { # main display $bweb->display($fields, "display_form_media.tpl"); print ""; - $bweb->display_media(); + $bweb->display_media(offset => $arg->{offset}, + limit => $arg->{limit}); print ""; } elsif ($action eq 'medias') { diff --git a/gui/bweb/lib/Bconsole.pm b/gui/bweb/lib/Bconsole.pm index 5fc5618a49..a264ada3fd 100644 --- a/gui/bweb/lib/Bconsole.pm +++ b/gui/bweb/lib/Bconsole.pm @@ -105,8 +105,7 @@ sub expect_it { my ($self, @what) = @_; unless ($self->{bconsole}->expect($self->{timeout}, @what)) { - $self->{error} = $!; - return 0; + return $self->error($self->{bconsole}->error()); } return 1; } @@ -125,8 +124,10 @@ sub log_stdout sub error { my ($self, $error) = @_; - $self->{error} = $!; - print STDERR "E: bconsole (", $self->{pref}->{bconsole}, ") $!\n"; + $self->{error} = $error; + if ($error) { + print STDERR "E: bconsole (", $self->{pref}->{bconsole}, ") $! $error\n"; + } return 0; } @@ -163,7 +164,7 @@ sub connect } unless ($ret) { - return $self->error($ret); + return $self->error($self->{bconsole}->error()); } # TODO : we must verify that expect return the good value diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index 507ef03e07..08837522cd 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -2035,8 +2035,9 @@ WHERE Job.JobId = $jobid sub display_media { - my ($self) = @_ ; + my ($self, %arg) = @_ ; + my ($limit, $label) = $self->get_limit(%arg); my ($where, %elt) = $self->get_param('pools', 'mediatypes', 'volstatus', @@ -2076,6 +2077,7 @@ LEFT JOIN (SELECT avg(Media.VolBytes) AS size, WHERE Media.PoolId=Pool.PoolId $where +$limit "; my $all = $self->dbh_selectall_hashref($query, 'volumename') ;