]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl add media limit offset option
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 24 May 2007 20:01:28 +0000 (20:01 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 24 May 2007 20:01:28 +0000 (20:01 +0000)
ebl  add Bconsole error to STDERR

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4899 91ce42f0-d328-0410-95d8-f526ca767f89

gui/bweb/cgi/bweb.pl
gui/bweb/lib/Bconsole.pm
gui/bweb/lib/Bweb.pm

index 7ab92e1de04d02f860d3dcef2323840e78a836f9..5e9f0f71c075c118927d71493a69becc1a4e7305 100755 (executable)
@@ -118,7 +118,8 @@ if ($action eq 'begin') {           # main display
     $bweb->display($fields, "display_form_media.tpl");
 
     print "</td><td valign='top'>";
-    $bweb->display_media();
+    $bweb->display_media(offset => $arg->{offset},
+                        limit => $arg->{limit});
     print "</td></tr></table></div>";
 
 } elsif ($action eq 'medias') {
index 5fc5618a499c88f467447f9b55d7e60d84d546b0..a264ada3fd29232b8be25de8a1373f9a4e266ec8 100644 (file)
@@ -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
index 507ef03e07b1c09cb147cb6abd7d4376bb990641..08837522cd350822d02d494049ced29ddbec6df8 100644 (file)
@@ -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') ;