]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl hide legend with option
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 11 Aug 2006 19:00:04 +0000 (19:00 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 11 Aug 2006 19:00:04 +0000 (19:00 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3280 91ce42f0-d328-0410-95d8-f526ca767f89

gui/bweb/cgi/bgraph.pl
gui/bweb/cgi/bweb.pl
gui/bweb/lib/Bweb.pm
gui/bweb/tpl/begin.tpl

index c691e2659706ea44acb31f14f9d1eb05aba6eb91..0e8f6328ae65de8e257dcfc73773889f64a85cd3 100755 (executable)
@@ -42,6 +42,8 @@ my $dbh = $bweb->{dbh};
 my $debug = $bweb->{debug};
 
 my $graph = CGI::param('graph') || 'begin';
+my $legend = CGI::param('legend') || 'on' ;
+$legend = ($legend eq 'on')?1:0;
 
 my $arg = $bweb->get_form(qw/width height limit offset age
                             jfilesets level status jjobnames jclients/);
@@ -180,7 +182,9 @@ $limitq
     my $all = $dbh->selectall_arrayref($query) ;
 
     my ($d, $ret) = make_tab($all);
-    $obj->set_legend(keys %$ret);
+    if ($legend) {
+       $obj->set_legend(keys %$ret);
+    }
     print $obj->plot([$d, values %$ret])->png;
 }
 
@@ -214,7 +218,9 @@ $limitq
     my $all = $dbh->selectall_arrayref($query) ;
 
     my ($d, $ret) = make_tab($all);
-    $obj->set_legend(keys %$ret);
+    if ($legend) {
+       $obj->set_legend(keys %$ret);
+    }
     print $obj->plot([$d, values %$ret])->png;
 }
 
@@ -254,7 +260,9 @@ $limitq
     my $all = $dbh->selectall_arrayref($query) ;
 
     my ($d, $ret) = make_tab($all);    
-    $obj->set_legend(keys %$ret);
+    if ($legend) {
+       $obj->set_legend(keys %$ret);
+    }
     print $obj->plot([$d, values %$ret])->png;
 }
 
@@ -292,7 +300,9 @@ $limitq
     my $all = $dbh->selectall_arrayref($query) ;
 
     my ($d, $ret) = make_tab($all);
-    $obj->set_legend(keys %$ret);
+    if ($legend) {
+       $obj->set_legend(keys %$ret);
+    }
     print $obj->plot([$d, values %$ret])->png;
 }
 
index b1cddc23e4092ed84aa89b123412d2255cb3435a..7971147bb5fc793e9594d060a2d7fccc3c4e8656 100755 (executable)
@@ -69,7 +69,7 @@ if ($action eq 'begin') {             # main display
 </div>
 <div class='bodydiv'>
 <a href='?action=job;age=172800;jobtype=B'>
-<img src='bgraph.pl?age=172800;width=450;height=250;graph=job_size;limit=100;action=graph' alt='Nothing to display'>
+<img src='bgraph.pl?age=172800;width=450;height=250;graph=job_size;limit=100;action=graph;legend=off' alt='Nothing to display'>
 </a>
 </div>";
     print "</td></table>";
@@ -109,7 +109,7 @@ if ($action eq 'begin') {           # main display
     $bweb->display_medias();
 
 } elsif ($action eq 'eject') {
-    my $a = Bweb::Autochanger::get('L80', $bweb);
+    my $a = Bweb::Autochanger::get('S1_L80', $bweb);
 
     $a->status();
     foreach my $slot (CGI::param('slot')) {
@@ -127,7 +127,7 @@ if ($action eq 'begin') {           # main display
     $bweb->eject_media();
 
 } elsif ($action eq 'clear_io') {
-    my $a = Bweb::Autochanger::get('L80', $bweb);
+    my $a = Bweb::Autochanger::get('S1_L80', $bweb);
     $a->status();
     $a->clear_io();
     $a->display_content();
@@ -135,19 +135,19 @@ if ($action eq 'begin') {         # main display
 } elsif ($action eq 'ach_view') {
     # TODO : get autochanger name and create it
     $bweb->connect_db();
-    my $a = Bweb::Autochanger::get('L80', $bweb);
+    my $a = Bweb::Autochanger::get('S1_L80', $bweb);
     $a->status();
     $a->display_content();
 
 } elsif ($action eq 'ach_load') {
     my $arg = $bweb->get_form('drive', 'slot');
-    my $a = Bweb::Autochanger::get('L80', $bweb);
+    my $a = Bweb::Autochanger::get('S1_L80', $bweb);
     $a->status();
     $a->load($arg->{drive}, $arg->{slot}) ;
 
 } elsif ($action eq 'ach_unload') {
     my $arg = $bweb->get_form('drive', 'slot');
-    my $a = Bweb::Autochanger::get('L80', $bweb);
+    my $a = Bweb::Autochanger::get('S1_L80', $bweb);
     $a->status();
     $a->unload($arg->{drive}, $arg->{slot}) ;
    
index 02d6acc4f34c048e896731dc1b3df8aa9ae4de80..2bb7748e6f0ca3b93df9aa03d4062ec07ab27ef7 100644 (file)
@@ -474,9 +474,9 @@ sub get
     my ($name, $bweb) = @_;
     my $a = new Bweb::Autochanger(debug => $bweb->{debug}, 
                                  bweb => $bweb,
-                                 name => 'L80',
+                                 name => 'S1_L80',
                                  precmd => 'sudo',
-                                 drive_name => ['SDLT-0', 'SDLT-1'],
+                                 drive_name => ['S1_L80_SDLT0', 'S1_L80_SDLT1'],
                                  );
     return $a;
 }
@@ -817,7 +817,7 @@ sub send_to_io
 sub transfer
 {
     my ($self, $src, $dst) = @_ ;
-    print "$self->{precmd} $self->{mtxcmd} -f $self->{device} transfer $src $dst\n";
+    print "<pre>$self->{precmd} $self->{mtxcmd} -f $self->{device} transfer $src $dst</pre>\n";
     my $out = `$self->{precmd} $self->{mtxcmd} -f $self->{device} transfer $src $dst 2>&1`;
     
     if ($? == 0) {
@@ -2462,7 +2462,7 @@ WHERE Media.VolumeName IN ($arg->{jmedias})
 
     my $all = $self->dbh_selectall_hashref($query, 'volumename');
 
-    my $a = Bweb::Autochanger::get('L80', $self);
+    my $a = Bweb::Autochanger::get('S1_L80', $self);
 
     $a->status();
     foreach my $vol (values %$all) {
index c3b09264fa7a8436b09c7168e12f6977c997dd31..6fa27cd609f7b4f31d25b0e5c6f1383438c764b1 100644 (file)
@@ -17,7 +17,7 @@
 <a href="?action=running"> Running jobs </a>|
 <a href="?action=job"> Old Jobs </a>|
 <a href="?action=next_job"> Next jobs </a|>|
-<a href="?action=restore"> Restore </a>|
+<a href="?action=restore" title="Launch brestore"> Restore </a>|
 <a href="?action=graph"> Statistics </a>] [
 <a href="?action=pool"> Pools </a>|
 <a href="?action=location"> Locations </a>|