]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Few code improvments in main dashboard
authorDavide Franco <bacula-dev@dflc.ch>
Fri, 8 Jul 2011 18:29:41 +0000 (20:29 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:21 +0000 (14:49 +0200)
gui/bacula-web/index.php

index f73858fd0ebf76b4a62499a162a87d704617d773..dbc66738cb14bc92b380419aa2cd96d550f635c3 100644 (file)
@@ -31,14 +31,9 @@ $dbSql->tpl->assign('database_size', $dbSql->GetDbSize());
 $stored_bytes = CUtils::Get_Human_Size( $dbSql->getStoredBytes( FIRST_DAY, NOW ) );
 $dbSql->tpl->assign('stored_bytes', $stored_bytes);
 
-// Total stored bytes since last 24 hours
-$bytes_last = CUtils::Get_Human_Size( $dbSql->getStoredBytes( LAST_DAY, NOW ) );
-$dbSql->tpl->assign('bytes_last', $bytes_last );
-
-// Total stored files since last 24 hours
-$files_last = $dbSql->GetStoredFiles( LAST_DAY );
-$dbSql->tpl->assign('files_last', $files_last );
-
+// Total bytes and files for last 24 hours
+$dbSql->tpl->assign('bytes_last', CUtils::Get_Human_Size( $dbSql->getStoredBytes( LAST_DAY, NOW ) ) );
+$dbSql->tpl->assign('files_last', $dbSql->GetStoredFiles( LAST_DAY ) );
 
 // Number of clients
 $nb_clients = $dbSql->Get_Nb_Clients();
@@ -48,21 +43,21 @@ $dbSql->tpl->assign('clientes_totales',$nb_clients["nb_client"] );
 $dbSql->tpl->assign( 'jobs_list', $dbSql->Get_BackupJob_Names() );
 
 // Last 24 hours status (completed, failed and waiting jobs)
-$dbSql->tpl->assign( 'completed_jobs', $dbSql->countJobs( NOW-DAY, NOW, 'completed' ) );
-$dbSql->tpl->assign( 'failed_jobs', $dbSql->countJobs( NOW-DAY, NOW, 'failed' ) );
-$dbSql->tpl->assign( 'waiting_jobs', $dbSql->countJobs( NOW-DAY, NOW, 'waiting' ) );
+$dbSql->tpl->assign( 'completed_jobs', $dbSql->countJobs( LAST_DAY, NOW, 'completed' ) );
+$dbSql->tpl->assign( 'failed_jobs', $dbSql->countJobs( LAST_DAY, NOW, 'failed' ) );
+$dbSql->tpl->assign( 'waiting_jobs', $dbSql->countJobs( LAST_DAY, NOW, 'waiting' ) );
 
 // Last 24 hours jobs Level
-$dbSql->tpl->assign( 'incr_jobs', $dbSql->countJobs( NOW-DAY, NOW, 'ALL', J_INCR) );
-$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) );
+$dbSql->tpl->assign( 'incr_jobs', $dbSql->countJobs( LAST_DAY, NOW, 'ALL', J_INCR) );
+$dbSql->tpl->assign( 'diff_jobs', $dbSql->countJobs( LAST_DAY, NOW, 'ALL', J_DIFF) );
+$dbSql->tpl->assign( 'full_jobs', $dbSql->countJobs( LAST_DAY, NOW, 'ALL', J_FULL) );
 
 // Last 24 hours Job status graph
 $jobs_status_data = array();
 $jobs_status     = array( 'completed', 'failed', 'canceled', 'waiting' );
 
 foreach( $jobs_status as $status )
-       $jobs_status_data[] = array( $status, $dbSql->countJobs(NOW-DAY, NOW, $status) );
+       $jobs_status_data[] = array( $status, $dbSql->countJobs(LAST_DAY, NOW, $status) );
 
 $graph = new CGraph( "graph.png" );
 $graph->SetData( $jobs_status_data, 'pie', 'text-data-single' );