From: Eric Bollengier Date: Thu, 31 May 2007 13:43:51 +0000 (+0000) Subject: ebl enable groups X-Git-Tag: Release-2.2.0~341 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=96d2eab6d5f954f96736a543bcca9635e4a0dd4e;p=bacula%2Fbacula ebl enable groups git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4953 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/INSTALL b/gui/bweb/INSTALL index d980bc5c3b..039f502ab9 100644 --- a/gui/bweb/INSTALL +++ b/gui/bweb/INSTALL @@ -16,6 +16,7 @@ Bweb works well with 1.39 release or later. 10) accessing to bweb 11) setting mysql read-only account 12) get more statistics +13) use groups with bweb ################ FILE COPY ##################################### # you must get bweb svn files @@ -100,11 +101,11 @@ Simply use lang/fr/tpl/*.tpl files instead of tpl/*.tpl That should show you if any of the pre-requisites are missing. On SuSE 10.2, I was able to load all the appropriate modules via rpms, - with the exception of Expect and Time::ParseDate, which I loaded manually - using perl. + with the exception of Expect and Time::ParseDate, which I loaded manually + using perl. - If you experience problems, always consult the Apache error_log - file. + If you experience problems, always consult the Apache error_log + file. ################ APACHE CONFIGURATION ########################## @@ -261,8 +262,8 @@ chown www-data /var/spool/bweb You have to remove "" from tpl/display_job_zoom.tpl. -You must use brestore.pl -b to initialize the database, and -you can use bfileview.pl mode=batch jobid=xxx where=/ to compute tree size. +You MUST use brestore.pl -b to initialize the database, and +you CAN use bfileview.pl mode=batch jobid=xxx where=/ to compute tree size. At this time, it's a good idea to schedule brestore.pl -b after your BackupCatalog job. @@ -317,6 +318,11 @@ And run this on crontab when you want : INSERT INTO job_old (SELECT * FROM Job WHERE JobId NOT IN (SELECT JobId FROM job_old) ); +################ USE GROUPS WITH BWEB ########################## + +It works with postgresql and mysql5 (4 not tested). +To enable group, load bweb/script/bweb_group.sql into your catalog + ################################################################ Enjoy ! diff --git a/gui/bweb/ReleaseNotes b/gui/bweb/ReleaseNotes index 43e264a518..c497d855d5 100644 --- a/gui/bweb/ReleaseNotes +++ b/gui/bweb/ReleaseNotes @@ -1,5 +1,8 @@ Release Notes for bweb 2.2 +2007/05/31 + - add group management (see INSTALL to enable it) + 2007/05/23 - put Bconsole error to stderr (error.log) diff --git a/gui/bweb/cgi/bgraph.pl b/gui/bweb/cgi/bgraph.pl index 01c2891050..efc0199ee0 100755 --- a/gui/bweb/cgi/bgraph.pl +++ b/gui/bweb/cgi/bgraph.pl @@ -65,7 +65,7 @@ my $legend = CGI::param('legend') || 'on' ; $legend = ($legend eq 'on')?1:0; my $arg = $bweb->get_form(qw/width height limit offset age where jobid - jfilesets level status jjobnames jclients/); + jfilesets level status jjobnames jclients jclient_groups/); my ($limitq, $label) = $bweb->get_limit(age => $arg->{age}, limit => $arg->{limit}, @@ -102,6 +102,14 @@ if ($arg->{jclients}) { $arg->{jclients} = 'all'; # skip warning } +my $groupf=''; # from clause +my $groupq=''; # whre clause +if ($arg->{jclient_groups}) { + $groupf = " JOIN client_group_member ON (Client.ClientId = client_group_member.clientid) + JOIN client_group USING (client_group_id)"; + $groupq = " AND client_group_name IN ($arg->{jclient_groups}) "; +} + my $gtype = CGI::param('gtype') || 'bars'; print CGI::header('image/png'); @@ -197,7 +205,7 @@ SELECT Client.Name AS clientname, $jobt.Name AS jobname, $jobt.JobBytes AS jobbytes -FROM $jobt, Client, FileSet +FROM $jobt, FileSet, Client $groupf WHERE $jobt.ClientId = Client.ClientId AND $jobt.FileSetId = FileSet.FileSetId AND $jobt.Type = 'B' @@ -206,6 +214,7 @@ WHERE $jobt.ClientId = Client.ClientId $filesetq $levelq $jobnameq + $groupq $limitq "; @@ -234,7 +243,7 @@ SELECT Client.Name AS clientname, $jobt.Name AS jobname, $jobt.JobFiles AS jobfiles -FROM $jobt, Client, FileSet +FROM $jobt, FileSet, Client $groupf WHERE $jobt.ClientId = Client.ClientId AND $jobt.FileSetId = FileSet.FileSetId AND $jobt.Type = 'B' @@ -243,6 +252,7 @@ WHERE $jobt.ClientId = Client.ClientId $filesetq $levelq $jobnameq + $groupq $limitq "; @@ -275,7 +285,7 @@ SELECT UNIX_TIMESTAMP(Job.StartTime) AS starttime, Job.Name AS jobname, base64_decode_lstat(8,LStat) AS lstat -FROM Job, Client, FileSet, Filename, Path, File +FROM Job, FileSet, Filename, Path, File, Client WHERE Job.ClientId = Client.ClientId AND Job.FileSetId = FileSet.FileSetId AND Job.Type = 'B' @@ -372,7 +382,7 @@ SELECT - $bweb->{sql}->{UNIX_TIMESTAMP}(StartTime)) + 0.01) AS rate -FROM $jobt, Client, FileSet +FROM $jobt, FileSet, Client $groupf WHERE $jobt.ClientId = Client.ClientId AND $jobt.FileSetId = FileSet.FileSetId AND $jobt.Type = 'B' @@ -381,6 +391,7 @@ WHERE $jobt.ClientId = Client.ClientId $filesetq $levelq $jobnameq + $groupq $limitq "; @@ -413,7 +424,7 @@ SELECT $bweb->{sql}->{SEC_TO_INT}( $bweb->{sql}->{UNIX_TIMESTAMP}(EndTime) - $bweb->{sql}->{UNIX_TIMESTAMP}(StartTime)) AS duration -FROM $jobt, Client, FileSet +FROM $jobt, FileSet, Client $groupf WHERE $jobt.ClientId = Client.ClientId AND $jobt.FileSetId = FileSet.FileSetId AND $jobt.Type = 'B' @@ -422,6 +433,7 @@ WHERE $jobt.ClientId = Client.ClientId $filesetq $levelq $jobnameq + $groupq $limitq "; @@ -472,7 +484,7 @@ $limitq SELECT " . ($per_t?"":"UNIX_TIMESTAMP") . "($stime) AS A, $t(JobBytes) AS nb -FROM $jobt, Client, FileSet +FROM $jobt, FileSet, Client $groupf WHERE $jobt.ClientId = Client.ClientId AND $jobt.FileSetId = FileSet.FileSetId AND $jobt.Type = 'B' @@ -481,6 +493,7 @@ WHERE $jobt.ClientId = Client.ClientId $filesetq $levelq $jobnameq + $groupq $limit "; diff --git a/gui/bweb/cgi/bweb.pl b/gui/bweb/cgi/bweb.pl index 4cc4b92367..443b82f347 100755 --- a/gui/bweb/cgi/bweb.pl +++ b/gui/bweb/cgi/bweb.pl @@ -296,8 +296,9 @@ if ($action eq 'begin') { # main display print "
\n"; my $fields = $bweb->get_form(qw/status level db_clients db_filesets limit age offset qclients qfilesets -# db_client_groups qclient_groups - jobtype qpools db_pools/); + jobtype qpools db_pools + db_client_groups qclient_groups/); # drop this to hide + $bweb->display($fields, "display_form_job.tpl"); print ""; @@ -314,6 +315,10 @@ if ($action eq 'begin') { # main display } } +} elsif ($action eq 'group_stats') { + + $bweb->display_group_stats(age => $arg->{age}); + } elsif ($action eq 'running') { $bweb->display_running_jobs(1); diff --git a/gui/bweb/lang/es/tpl/begin.tpl b/gui/bweb/lang/es/tpl/begin.tpl index 2c63817a60..7433be1a44 100644 --- a/gui/bweb/lang/es/tpl/begin.tpl +++ b/gui/bweb/lang/es/tpl/begin.tpl @@ -20,7 +20,12 @@ if (navigator.appName == 'Konqueror') {
- Not enough data   - Not enough data   - Not enough data   +
+ Not enough data   + Not enough data   + Not enough data