From: Eric Bollengier Date: Mon, 26 Nov 2007 11:01:39 +0000 (+0000) Subject: ebl Fix overview to works with mysql X-Git-Tag: Release-3.0.0~2200 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=25d847d0ebb8872e0ba0d2355a7744d76c624ce1;p=bacula%2Fbacula ebl Fix overview to works with mysql git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5989 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/cgi/bweb.pl b/gui/bweb/cgi/bweb.pl index c869e7737c..bb45fa700a 100755 --- a/gui/bweb/cgi/bweb.pl +++ b/gui/bweb/cgi/bweb.pl @@ -459,8 +459,9 @@ if ($action eq 'begin') { # main display print "
\n"; my $fields = $bweb->get_form(qw/level filter age jobtype since type db_client_groups qclient_groups/); # drop this to hide - $fields->{action}='overview'; + $fields->{hide_status}=1; $fields->{view_time_slice}=1; + $fields->{action}='overview'; $bweb->display($fields, "display_form_job.tpl"); print ""; @@ -472,8 +473,9 @@ if ($action eq 'begin') { # main display print "
\n"; my $fields = $bweb->get_form(qw/level filter age jobtype since type db_client_groups qclient_groups/); # drop this to hide - $fields->{action}='overview_zoom'; + $fields->{hide_status}=1; $fields->{view_time_slice}=1; + $fields->{action}='overview_zoom'; $bweb->display($fields, "display_form_job.tpl"); print ""; $bweb->display_overview_zoom(); diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index 2c7b2713f2..1a9f591e4f 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -1069,14 +1069,14 @@ our %sql_func = ( TO_SEC => '', SEC_TO_TIME => 'SEC_TO_TIME', MATCH => " REGEXP ", - STARTTIME_DAY => " DATE_FORMAT(StartTime, '%Y-%m-%d') ", - STARTTIME_HOUR => " DATE_FORMAT(StartTime, '%Y-%m-%d %H') ", - STARTTIME_MONTH => " DATE_FORMAT(StartTime, '%Y-%m') ", - STARTTIME_WEEK => " DATE_FORMAT(StartTime, '%v') ", - STARTTIME_PHOUR=> " DATE_FORMAT(StartTime, '%H') ", - STARTTIME_PDAY => " DATE_FORMAT(StartTime, '%d') ", - STARTTIME_PMONTH => " DATE_FORMAT(StartTime, '%m') ", - STARTTIME_PWEEK => " DATE_FORMAT(StartTime, '%v') ", + STARTTIME_DAY => " DATE_FORMAT(Job.StartTime, '%Y-%m-%d') ", + STARTTIME_HOUR => " DATE_FORMAT(Job.StartTime, '%Y-%m-%d %H') ", + STARTTIME_MONTH => " DATE_FORMAT(Job.StartTime, '%Y-%m') ", + STARTTIME_WEEK => " DATE_FORMAT(Job.StartTime, '%Y-%v') ", + STARTTIME_PHOUR=> " DATE_FORMAT(Job.StartTime, '%H') ", + STARTTIME_PDAY => " DATE_FORMAT(Job.StartTime, '%d') ", + STARTTIME_PMONTH => " DATE_FORMAT(Job.StartTime, '%m') ", + STARTTIME_PWEEK => " DATE_FORMAT(Job.StartTime, '%v') ", # with mysql < 5, you have to play with the ugly SHOW command DB_SIZE => " SELECT 0 ", # works only with mysql 5 @@ -3326,7 +3326,7 @@ sub get_time_overview } my $jobt = $self->{info}->{stat_job_table} || 'Job'; my $stime1 = $self->{sql}->{"STARTTIME_P" . $type}; # get 1,2,3 - $stime1 =~ s/Job.StartTime/date/; + $stime1 =~ s/Job.StartTime/starttime/; my $stime2 = $self->{sql}->{"STARTTIME_" . $type}; # get 2007-01-03, 2007-01-23 my ($limit, $label) = $self->get_limit('since' => $arg->{since}, @@ -3358,6 +3358,7 @@ SELECT name, $stime1 AS num, JobStatus AS value, joberrors, nb_job FROM ( SELECT $stime2 AS date, + StartTime AS starttime, Client.Name AS name, MAX(severity) AS severity, COUNT(1) AS nb_job, @@ -3395,6 +3396,7 @@ SELECT name, $stime1 AS num, JobStatus AS value, joberrors, nb_job FROM ( SELECT $stime2 AS date, + StartTime AS starttime, client_group_name AS name, MAX(severity) AS severity, COUNT(1) AS nb_job, diff --git a/gui/bweb/script/bweb-mysql.sql b/gui/bweb/script/bweb-mysql.sql index 667c07c30d..a8f03c0112 100644 --- a/gui/bweb/script/bweb-mysql.sql +++ b/gui/bweb/script/bweb-mysql.sql @@ -3,10 +3,10 @@ -- -------------------------------------------------- ALTER TABLE Status ADD COLUMN severity int; -UPDATE status SET severity = 15; -UPDATE status SET severity = 100 where jobstatus = 'f'; -UPDATE status SET severity = 90 where jobstatus = 'A'; -UPDATE status SET severity = 10 where jobstatus = 'T'; +UPDATE Status SET severity = 15; +UPDATE Status SET severity = 100 where JobStatus = 'f'; +UPDATE Status SET severity = 90 where JobStatus = 'A'; +UPDATE Status SET severity = 10 where JobStatus = 'T'; -- New tables for bresto (same as brestore) diff --git a/gui/bweb/technotes-2.3 b/gui/bweb/technotes-2.3 index d11700dee8..7885ccb058 100644 --- a/gui/bweb/technotes-2.3 +++ b/gui/bweb/technotes-2.3 @@ -1,3 +1,6 @@ +26Nov07 +ebl fix overview to works with mysql + 25Nov07 ebl Use a automatic rediction when launching a new job ebl Add new overview view.