From a946e196c62cb86919e2d07bef9a732b708d1ed4 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 11 Aug 2006 19:00:04 +0000 Subject: [PATCH] ebl hide legend with option git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3280 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/cgi/bgraph.pl | 18 ++++++++++++++---- gui/bweb/cgi/bweb.pl | 12 ++++++------ gui/bweb/lib/Bweb.pm | 8 ++++---- gui/bweb/tpl/begin.tpl | 2 +- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/gui/bweb/cgi/bgraph.pl b/gui/bweb/cgi/bgraph.pl index c691e26597..0e8f6328ae 100755 --- a/gui/bweb/cgi/bgraph.pl +++ b/gui/bweb/cgi/bgraph.pl @@ -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; } diff --git a/gui/bweb/cgi/bweb.pl b/gui/bweb/cgi/bweb.pl index b1cddc23e4..7971147bb5 100755 --- a/gui/bweb/cgi/bweb.pl +++ b/gui/bweb/cgi/bweb.pl @@ -69,7 +69,7 @@ if ($action eq 'begin') { # main display
-Nothing to display +Nothing to display
"; print ""; @@ -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}) ; diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index 02d6acc4f3..2bb7748e6f 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -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 "
$self->{precmd} $self->{mtxcmd} -f $self->{device} transfer $src $dst
\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) { diff --git a/gui/bweb/tpl/begin.tpl b/gui/bweb/tpl/begin.tpl index c3b09264fa..6fa27cd609 100644 --- a/gui/bweb/tpl/begin.tpl +++ b/gui/bweb/tpl/begin.tpl @@ -17,7 +17,7 @@ Running jobs | Old Jobs | Next jobs | - Restore | + Restore | Statistics ] [ Pools | Locations | -- 2.39.5