From: Davide Franco Date: Fri, 8 Jul 2011 17:57:36 +0000 (+0200) Subject: bacula-web: Improved code for last 24 hours job status X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=68a48dc53f67e283de8ca380086d5f424edaad50;p=bacula%2Fbacula bacula-web: Improved code for last 24 hours job status --- diff --git a/gui/bacula-web/index.php b/gui/bacula-web/index.php index 61fa605ee2..f73858fd0e 100644 --- a/gui/bacula-web/index.php +++ b/gui/bacula-web/index.php @@ -58,15 +58,14 @@ $dbSql->tpl->assign( 'diff_jobs', $dbSql->countJobs( NOW-DAY, NOW, 'ALL', J_DIFF $dbSql->tpl->assign( 'full_jobs', $dbSql->countJobs( NOW-DAY, NOW, 'ALL', J_FULL) ); // Last 24 hours Job status graph -$data = array(); -$status = array( 'completed', 'terminated_errors', 'failed', 'waiting', 'created', 'running', 'error' ); +$jobs_status_data = array(); +$jobs_status = array( 'completed', 'failed', 'canceled', 'waiting' ); -foreach( $status as $job_status ) { - array_push( $data, $dbSql->GetJobsStatistics( $job_status ) ); -} +foreach( $jobs_status as $status ) + $jobs_status_data[] = array( $status, $dbSql->countJobs(NOW-DAY, NOW, $status) ); $graph = new CGraph( "graph.png" ); -$graph->SetData( $data, 'pie', 'text-data-single' ); +$graph->SetData( $jobs_status_data, 'pie', 'text-data-single' ); $graph->SetGraphSize( 400, 230 ); $graph->Render();