From: <ri...@us...> - 2007-06-29 15:20:43
|
Revision: 5115 http://bacula.svn.sourceforge.net/bacula/?rev=5115&view=rev Author: ricozz Date: 2007-06-29 08:20:44 -0700 (Fri, 29 Jun 2007) Log Message: ----------- ebl fix pool view with more than one media type Modified Paths: -------------- trunk/gui/bweb/lang/es/tpl/display_pool.tpl trunk/gui/bweb/lang/fr/tpl/display_pool.tpl trunk/gui/bweb/lib/Bweb.pm trunk/gui/bweb/tpl/display_pool.tpl Modified: trunk/gui/bweb/lang/es/tpl/display_pool.tpl =================================================================== --- trunk/gui/bweb/lang/es/tpl/display_pool.tpl 2007-06-29 12:12:26 UTC (rev 5114) +++ trunk/gui/bweb/lang/es/tpl/display_pool.tpl 2007-06-29 15:20:44 UTC (rev 5115) @@ -17,7 +17,7 @@ <script type="text/javascript" language="JavaScript"> -var header = new Array("Nombre","Reciclado","Retenci\xF3n","Use Duration", +var header = new Array("Nombre","Media Type","Reciclado","Retenci\xF3n","Use Duration", "M\xE1x Jobs/Volumen","M\xE1x Archivos/Volumen", "M\xE1x Tama\xF1o/Volumen","Nb volumes", "Estado Volumen", "Uso", "Selecci\xF3n"); @@ -46,10 +46,16 @@ chkbox.value = '<TMPL_VAR Name>'; chkbox.name = 'pool'; +chkbox = document.createElement('INPUT'); +chkbox.type = 'radio'; +chkbox.value = '<TMPL_VAR mediatype>'; +chkbox.name = 'mediatype'; + img2 = percent_usage(<TMPL_VAR poolusage>); data.push( new Array( "<TMPL_VAR Name>", +"<TMPL_VAR mediatype>", "<TMPL_VAR Recycle>", human_sec(<TMPL_VAR VolRetention>), human_sec(<TMPL_VAR VolUseDuration>), Modified: trunk/gui/bweb/lang/fr/tpl/display_pool.tpl =================================================================== --- trunk/gui/bweb/lang/fr/tpl/display_pool.tpl 2007-06-29 12:12:26 UTC (rev 5114) +++ trunk/gui/bweb/lang/fr/tpl/display_pool.tpl 2007-06-29 15:20:44 UTC (rev 5115) @@ -17,9 +17,9 @@ <script type="text/javascript" language="JavaScript"> -var header = new Array("Nom","Recyclage","R\xE9tention","Dur\xE9e d'utilisation", - "Nb job maxi par m\xE9dia","Nb fichier maxi par m\xE9dia", - "Taille maxi d'un m\xE9dia","Nb volumes", "Statut", "Utilisation", "S\xE9lection"); +var header = new Array("Nom","Type","Recyclage","R\xE9tention","Dur\xE9e d'utilisation", +// "Nb job maxi par m\xE9dia","Nb fichier maxi par m\xE9dia","Taille maxi d'un m\xE9dia", + "Nb volumes", "Statut", "Utilisation", "S\xE9lection"); var data = new Array(); var chkbox; @@ -46,16 +46,22 @@ chkbox.value = '<TMPL_VAR Name>'; chkbox.name = 'pool'; +chkbox = document.createElement('INPUT'); +chkbox.type = 'radio'; +chkbox.value = '<TMPL_VAR mediatype>'; +chkbox.name = 'mediatype'; + img2 = percent_usage(<TMPL_VAR poolusage>); data.push( new Array( "<TMPL_VAR Name>", +"<TMPL_VAR mediatype>", "<TMPL_VAR Recycle>", human_sec(<TMPL_VAR VolRetention>), human_sec(<TMPL_VAR VolUseDuration>), -"<TMPL_VAR MaxVolJobs>", -"<TMPL_VAR MaxVolFiles>", -human_size(<TMPL_VAR MaxVolBytes>), +//"<TMPL_VAR MaxVolJobs>", +//"<TMPL_VAR MaxVolFiles>", +//human_size(<TMPL_VAR MaxVolBytes>), "<TMPL_VAR VolNum>", img, img2, Modified: trunk/gui/bweb/lib/Bweb.pm =================================================================== --- trunk/gui/bweb/lib/Bweb.pm 2007-06-29 12:12:26 UTC (rev 5114) +++ trunk/gui/bweb/lib/Bweb.pm 2007-06-29 15:20:44 UTC (rev 5115) @@ -1050,6 +1050,7 @@ STARTTIME_PDAY => " date_part('day', Job.StartTime) ", STARTTIME_PMONTH => " date_part('month', Job.StartTime) ", DB_SIZE => " SELECT pg_database_size(current_database()) ", + CAT_POOL_TYPE => " MediaType || '_' || Pool.Name ", }, mysql => { UNIX_TIMESTAMP => 'UNIX_TIMESTAMP', @@ -1068,6 +1069,7 @@ DB_SIZE => " SELECT 0 ", # works only with mysql 5 # DB_SIZE => " SELECT sum(DATA_LENGTH) FROM INFORMATION_SCHEMA.TABLES ", + CAT_POOL_TYPE => " CONCAT(MediaType,'_',Pool.Name) ", }, ); @@ -2798,7 +2800,9 @@ Pool.MaxVolJobs AS maxvoljobs, Pool.MaxVolFiles AS maxvolfiles, Pool.MaxVolBytes AS maxvolbytes, - subq.PoolId AS PoolId + subq.PoolId AS PoolId, + subq.MediaType AS mediatype, + $self->{sql}->{CAT_POOL_TYPE} AS uniq FROM ( SELECT COALESCE(media_avg_size.volavg,0) * count(Media.MediaId) AS volmax, @@ -2819,7 +2823,7 @@ $whereW "; - my $all = $self->dbh_selectall_hashref($query, 'name') ; + my $all = $self->dbh_selectall_hashref($query, 'uniq') ; $query = " SELECT Pool.Name AS name, @@ -2845,7 +2849,8 @@ $query = " SELECT VolStatus AS volstatus, count(MediaId) AS nb FROM Media - WHERE PoolId=$p->{poolid} + WHERE PoolId=$p->{poolid} + AND Media.MediaType = '$p->{mediatype}' $whereA GROUP BY VolStatus "; Modified: trunk/gui/bweb/tpl/display_pool.tpl =================================================================== --- trunk/gui/bweb/tpl/display_pool.tpl 2007-06-29 12:12:26 UTC (rev 5114) +++ trunk/gui/bweb/tpl/display_pool.tpl 2007-06-29 15:20:44 UTC (rev 5115) @@ -17,7 +17,7 @@ <script type="text/javascript" language="JavaScript"> -var header = new Array("Name","Recycle","Retention","Use Duration", +var header = new Array("Name","Media Type", "Recycle","Retention","Use Duration", "Max jobs per volume","Max files per volume", "Max volume size","Nb volumes", "Vol Status", "Usage", "Select"); @@ -46,10 +46,16 @@ chkbox.value = '<TMPL_VAR Name>'; chkbox.name = 'pool'; +chkbox = document.createElement('INPUT'); +chkbox.type = 'radio'; +chkbox.value = '<TMPL_VAR mediatype>'; +chkbox.name = 'mediatype'; + img2 = percent_usage(<TMPL_VAR poolusage>); data.push( new Array( "<TMPL_VAR Name>", +"<TMPL_VAR mediatype>", "<TMPL_VAR Recycle>", human_sec(<TMPL_VAR VolRetention>), human_sec(<TMPL_VAR VolUseDuration>), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |