From 99131002ae79b9c39bb3b2136ba31bc2536a12d5 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 31 Oct 2007 17:01:18 +0000 Subject: [PATCH] ebl Add a "Display only Errors/Warning" button to job zoom git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5822 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/lang/fr/tpl/display_job_zoom.tpl | 7 +++++++ gui/bweb/lib/Bweb.pm | 9 ++++++++- gui/bweb/tpl/display_job_zoom.tpl | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gui/bweb/lang/fr/tpl/display_job_zoom.tpl b/gui/bweb/lang/fr/tpl/display_job_zoom.tpl index 9259ecdb6a..a464fa1f5b 100644 --- a/gui/bweb/lang/fr/tpl/display_job_zoom.tpl +++ b/gui/bweb/lang/fr/tpl/display_job_zoom.tpl @@ -79,6 +79,13 @@ + + + + Voir les erreurs Voir les erreurs + + diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index d63b9504c8..65da7f8061 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -3340,6 +3340,12 @@ sub get_job_log my $t = CGI::param('time') || $self->{info}->{display_log_time} || ''; + # display only Error and Warning messages + my $filter = ''; + if (CGI::param('error')) { + $filter = " AND LogText $self->{sql}->{MATCH} 'Error|Warning' "; + } + my $query = " SELECT Job.Name as name, Client.Name as clientname FROM Job INNER JOIN Client ON (Job.ClientId = Client.ClientId) @@ -3355,10 +3361,11 @@ SELECT Job.Name as name, Client.Name as clientname $query = " SELECT Time AS time, LogText AS log FROM Log - WHERE Log.JobId = $arg->{jobid} + WHERE ( Log.JobId = $arg->{jobid} OR (Log.JobId = 0 AND Time >= (SELECT StartTime FROM Job WHERE JobId=$arg->{jobid}) AND Time <= (SELECT COALESCE(EndTime,NOW()) FROM Job WHERE JobId=$arg->{jobid}) ) + ) $filter ORDER BY LogId LIMIT $arg->{limit} OFFSET $arg->{offset} diff --git a/gui/bweb/tpl/display_job_zoom.tpl b/gui/bweb/tpl/display_job_zoom.tpl index a9b30f386a..78f1505892 100644 --- a/gui/bweb/tpl/display_job_zoom.tpl +++ b/gui/bweb/tpl/display_job_zoom.tpl @@ -77,6 +77,13 @@ + + + + view errors View only errors + + -- 2.39.5