]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Added Total stored bytes to the BackupJob Report's page
authorDavide Franco <bacula-dev@dflc.ch>
Fri, 11 Feb 2011 16:24:00 +0000 (17:24 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:38 +0000 (14:43 +0200)
gui/bacula-web/backupjob-report.php
gui/bacula-web/templates/backupjob-report.tpl

index 26a1b2308d81a90badca2f0b82e8e74fcd4a6d17..59e3c9dc8746959c2b4e22d0e4b5890c4a36773a 100644 (file)
   else
        die( "Please specify a backup job name " );
        
-  $smarty->assign('backupjob_name', $backupjob_name );
-       
   // Last 7 days stored Bytes graph
-  $data  = array();
   $graph = new BGraph( "graph2.png" );
   $days  = array();
 
          array_push( $days, array( 'start' => date( "Y-m-d 00:00:00", $today ), 'end' => date( "Y-m-d 23:59:00", $today ) ) );
   }
 
-  $days_stored_bytes = array();
+  $days_stored_bytes   = array();
+  $backupjob_bytes             = 0;
 
   foreach( $days as $day ) {
     array_push( $days_stored_bytes, $dbSql->GetStoredBytesByJob( $backupjob_name, $day['start'], $day['end'] ) );
   }
-
+  // Calculate total bytes for this period
+  foreach( $days_stored_bytes as $day )
+       $backupjob_bytes += $day[1];
+       
   $graph->SetData( $days_stored_bytes, 'bars', 'text-data' );
   $graph->SetGraphSize( 400, 230 );
 
   $graph->Render();
   $smarty->assign('graph_stored_bytes', $graph->Get_Image_file() );    
   
+  $smarty->assign('backupjob_name', $backupjob_name );
+  $smarty->assign('backupjob_bytes', $backupjob_bytes );
   
   // Process and display the template 
   $smarty->display('backupjob-report.tpl'); 
index 0f0c0dfa4bd5bf9c5114a498c33f85604df4cfae..f422968cc04d22acd1603a5f3adf5b0c83fc6694 100644 (file)
@@ -37,7 +37,7 @@
                </tr>
                <tr>
                        <td>Transfered Bytes</td>
-                       <td>ppp{$backupjob_bytes}</td>
+                       <td>{$backupjob_bytes} GB</td>
                </tr>
                <tr>
                        <td>Transfered Files</td>