From 68a48dc53f67e283de8ca380086d5f424edaad50 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Fri, 8 Jul 2011 19:57:36 +0200 Subject: [PATCH] bacula-web: Improved code for last 24 hours job status --- gui/bacula-web/index.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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(); -- 2.39.5