]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Add last used volumes to main dashboard
authorDavide Franco <bacula-dev@dflc.ch>
Mon, 31 Jan 2011 15:06:19 +0000 (16:06 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 3 Mar 2011 09:39:30 +0000 (10:39 +0100)
 - Add a list of 15 last used volumes to main dashboard with the following information
   - Volume name
   - Volume status
   - Job Id

gui/bacula-web/index.php
gui/bacula-web/templates/index.tpl

index adcff3de2d16dc80825fae7a19480d5380608883..2ff9bbf832f5675432043e4cb1058bf0eec489cc 100644 (file)
@@ -162,6 +162,24 @@ $graph->SetGraphSize( 400, 230 );
 $graph->Render();
 $smarty->assign('graph_stored_bytes', $graph->Get_Image_file() );
 
+// Last 15 used volumes
+$vol_list = array();
+
+$query  = "SELECT DISTINCT Media.Volumename, Media.VolStatus, Job.JobId FROM Job ";
+$query .= "LEFT JOIN JobMedia ON Job.JobId = JobMedia.JobId ";
+$query .= "LEFT JOIN Media ON JobMedia.MediaId = Media.MediaId ";
+$query .= "ORDER BY Job.JobId DESC ";
+$query .= "LIMIT 15 ";
+
+$result = $dbSql->db_link->query( $query );
+
+if ( PEAR::isError( $result ) )
+       die( "Unable to get last used volumes from catalog \n " . $result->getMessage() );
+else {
+       while ( $vol = $result->fetchRow( DB_FETCHMODE_ASSOC ) ) 
+               array_push( $vol_list, $vol );
+}
+$smarty->assign( 'volume_list', $vol_list );   
 
 //if ($_GET['Full_popup'] == "yes" || $_GET['pop_graph1'] == "yes" || $_GET['pop_graph2'] == "yes")
 //        $smarty->display('full_popup.tpl');
index ae0e06cdd851e22cb803ebe5210f9035de4d1252..5bc4b8bc6351cd2e1f31c6f1fce30ef9835c38c0 100644 (file)
          <img src="{$graph_jobs}" alt="" />
   </div> <!-- end div box -->
   
+  <div class="box">
+       <p class="title">Last used volumes</p>
+         <table>
+               <tr>
+                 <td class="info">Volume</td>
+                 <td class="info">Status</td>
+                 <td class="info">Job Id</td>
+               </tr>
+               {foreach from=$volume_list item=vol}
+               <tr>
+                 <td>{$vol.Volumename}</td>
+                 <td>{$vol.VolStatus}</td>
+                 <td>{$vol.JobId}</td>
+               </tr>
+               {/foreach}
+         </table>
+  </div> <!-- end div box -->
+  
 
   {include file="$last_report"}