From dc8fc61ea0e80110d3fe28c52f02740c2d1d1124 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Mon, 31 Jan 2011 16:06:19 +0100 Subject: [PATCH] bacula-web: Add last used volumes to main dashboard - 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 | 18 ++++++++++++++++++ gui/bacula-web/templates/index.tpl | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/gui/bacula-web/index.php b/gui/bacula-web/index.php index adcff3de2d..2ff9bbf832 100644 --- a/gui/bacula-web/index.php +++ b/gui/bacula-web/index.php @@ -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'); diff --git a/gui/bacula-web/templates/index.tpl b/gui/bacula-web/templates/index.tpl index ae0e06cdd8..5bc4b8bc63 100644 --- a/gui/bacula-web/templates/index.tpl +++ b/gui/bacula-web/templates/index.tpl @@ -92,6 +92,24 @@ +
+

Last used volumes

+ + + + + + + {foreach from=$volume_list item=vol} + + + + + + {/foreach} +
VolumeStatusJob Id
{$vol.Volumename}{$vol.VolStatus}{$vol.JobId}
+
+ {include file="$last_report"} -- 2.39.2