]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Optimized last completed and failed jobs
authorDavide Franco <bacula-dev@dflc.ch>
Mon, 20 Dec 2010 16:29:23 +0000 (17:29 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:33 +0000 (14:43 +0200)
 - Replaced by CountLastJobs instead of GetLastJobs and GetLastErrorJobs for last 24 hours completed and failed jobs.

gui/bacula-web/index.php

index 217d7acd38bc8b5791c593cf7457e7a24bcd62cd..c2616eb231f7885cb8df176ab567ed8970f3624c 100644 (file)
@@ -96,12 +96,16 @@ $smarty->assign( 'total_name_jobs', $dbSql->Get_BackupJob_Names() );
 $smarty->assign('pools', $dbSql->GetVolumeList() );
 
 // Last 24 hours completed jobs number (last_run_report.tpl)
-$completed_jobs = $dbSql->GetLastJobs();
-$smarty->assign( 'completed_jobs', $completed_jobs['completed_jobs'] );
+//$completed_jobs = $dbSql->GetLastJobs();
+//$smarty->assign( 'completed_jobs', $completed_jobs['completed_jobs'] );
+
+// Last 24 hours completed jobs number (last_run_report.tpl)
+$completed_jobs = $dbSql->CountLastJobs( LAST_DAY, 'completed' );
+$smarty->assign( 'completed_jobs', $completed_jobs['job_nb'] );
 
 // Last 24 hours failed jobs number (last_run_report.tpl)
-$failed_jobs = $dbSql->GetLastErrorJobs();
-$smarty->assign( 'failed_jobs', $failed_jobs['failed_jobs'] );
+$failed_jobs = $dbSql->CountLastJobs( LAST_DAY, 'failed' );
+$smarty->assign( 'failed_jobs', $failed_jobs['job_nb'] );
 
 // Last 24 hours elapsed time (last_run_report.tpl)
 $smarty->assign( 'elapsed_jobs', $dbSql->Get_ElapsedTime_Job() );