From: Davide Franco Date: Fri, 25 Feb 2011 15:52:36 +0000 (+0100) Subject: bacula-web: Added last jobs in Backup Job report page X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=89f6600740dffee8f604f84cb9ce3c7e74fbb2ca;p=bacula%2Fbacula bacula-web: Added last jobs in Backup Job report page - Added last 10 job per Job name in this page --- diff --git a/gui/bacula-web/backupjob-report.php b/gui/bacula-web/backupjob-report.php index 653a4a0bb2..e868014344 100644 --- a/gui/bacula-web/backupjob-report.php +++ b/gui/bacula-web/backupjob-report.php @@ -73,7 +73,30 @@ $graph->SetGraphSize( 400, 230 ); $graph->Render(); - $smarty->assign('graph_stored_files', $graph->Get_Image_file() ); + $smarty->assign('graph_stored_files', $graph->Get_Image_file() ); + + // Last 10 jobs + $query = "SELECT JobId, Level, JobFiles, JobBytes, JobStatus, EndTime, Name "; + $query .= "FROM Job "; + $query .= "WHERE Name = '$backupjob_name' "; + $query .= "ORDER BY EndTime DESC "; + $query .= "LIMIT 10 "; + + $jobs = array(); + $joblevel = array( 'I' => 'Incr', 'D' => 'Diff', 'F' => 'Full' ); + $result = $dbSql->db_link->query( $query ); + + if( ! PEAR::isError( $result ) ) + { + while( $job = $result->fetchRow( DB_FETCHMODE_ASSOC ) ) { + $job['Level'] = $joblevel[ $job['Level'] ]; + array_push( $jobs, $job); + } + + }else + die( "Unable to get last jobs from catalog " . $result->getMessage() ); + + $smarty->assign('jobs', $jobs ); $smarty->assign('backupjob_name', $backupjob_name ); $smarty->assign('backupjob_period', $backupjob_period ); diff --git a/gui/bacula-web/templates/backupjob-report.tpl b/gui/bacula-web/templates/backupjob-report.tpl index 972130a0fe..8ae1b0c616 100644 --- a/gui/bacula-web/templates/backupjob-report.tpl +++ b/gui/bacula-web/templates/backupjob-report.tpl @@ -50,6 +50,25 @@

Last jobs

+ + + + + + + + + + {foreach from=$jobs item=job} + + + + + + + + {/foreach} +
Job IdLevelFilesBytesEnd time
{$job.JobId}{$job.Level}{$job.JobFiles}{$job.JobBytes}{$job.EndTime}