Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 82515 Details for
Bug 126754
bacula-web (new ebuild)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
/usr/local/portage/www-apps/bacula-web/files/bacula-web-1.38.5-cvs_updates.patch
bacula-web-1.38.5-cvs_updates.patch (text/plain), 11.42 KB, created by
John M. Drescher
on 2006-03-18 20:27:52 UTC
(
hide
)
Description:
/usr/local/portage/www-apps/bacula-web/files/bacula-web-1.38.5-cvs_updates.patch
Filename:
MIME Type:
Creator:
John M. Drescher
Created:
2006-03-18 20:27:52 UTC
Size:
11.42 KB
patch
obsolete
>--- ../bacula-web/index.php 2006-03-12 20:57:14.000000000 -0500 >+++ ../bacula-web/index.php 2006-01-26 12:12:24.000000000 -0500 >@@ -60,13 +60,16 @@ > $smarty->assign('clientes_totales',$tmp[0]); > > $tmp = $last24bytes->fetchRow(); >-if ( empty($tmp[0]) ) { // No data for last 24, search last 48 >+/*if ( empty($tmp[0]) ) { // No data for last 24, search last 48 > if ( $dbSql->driver == "mysql" ) > $last24bytes = $dbSql->link->query("select sum(JobBytes) from Job where Endtime <= NOW() and UNIX_TIMESTAMP(EndTime) > UNIX_TIMESTAMP(NOW())-172800" ); > if ( $dbSql->driver == "pgsql") >- $last24bytes = $dbSql->link->query("select sum(JobBytes) from Job where Endtime <= NOW() and EndTime > NOW()-172800" ); >+ $last24bytes = $dbSql->link->query("select sum(JobBytes) from Job where Endtime <= NOW() and EndTime > NOW()-172800 * interval '1 second'" ) >+ or die ("Error query: 4.1"); > $smarty->assign('when',"yesterday"); >-} >+ $tmp = $last24bytes->fetchRow(); >+}*/ >+ > $smarty->assign('bytes_totales',$tmp[0]); > $smarty->assign('total_jobs', $tmp[1]); > >@@ -136,7 +140,7 @@ > LEFT JOIN Pool ON Job.PoolId=Pool.PoolId where EndTime <= NOW() and UNIX_TIMESTAMP(EndTime) >UNIX_TIMESTAMP(NOW())-86400 > order by elapsed "; // Full report array > if ( $dbSql->driver == "pgsql") >- $query = "select Job.EndTime - Job.StartTime ) >+ $query = "select (Job.EndTime - Job.StartTime ) > as elapsed,Job.Name,Job.StartTime,Job.EndTime,Job.Level,Pool.Name,Job.JobStatus from Job > LEFT JOIN Pool ON Job.PoolId=Pool.PoolId where EndTime <= NOW() and EndTime > NOW() - 86400 * interval '1 second' > order by elapsed "; >--- ../bacula-web/classes.inc 2006-03-12 21:26:08.000000000 -0500 >+++ ../bacula-web/classes.inc 2006-03-10 09:48:45.000000000 -0500 >@@ -35,6 +35,7 @@ > var $EndDate; > var $driver; > var $dbs; >+ var $dbs_name; > > > >@@ -70,7 +71,7 @@ > $this->dsn['username'] = $conf->get(CONFIG_FILE,$sec,"login"); > $this->dsn['password'] = $conf->get(CONFIG_FILE,$sec,"pass"); > $this->dsn['database'] = $conf->get(CONFIG_FILE,$sec,"db_name"); >- $this->dsn['phptype'] = $conf->get(CONFIG_FILE,$sec,"db_type"); // mysql, (sqlite, pgsql) -->> Yet not checked >+ $this->dsn['phptype'] = $conf->get(CONFIG_FILE,$sec,"db_type"); // mysql, pgsql > if ( $conf->get(CONFIG_FILE,$sec,"db_port") ) > $this->dsn[port] = $conf->get(CONFIG_FILE,$sec,"db_port"); > >@@ -80,6 +81,7 @@ > die($this->link->getMessage()); > $this->driver = $this->dsn[phptype]; > register_shutdown_function(array(&$this,'close')); >+ $this->dbs_name = $this->dsn['database']; > } > > function close() { >@@ -155,8 +155,10 @@ > return 0; > } > else if ( $this->driver == "pgsql") { >- $dbsize = $this->link->query("select database_size('bacula')") >+ $dbsize = $this->link->query("select pg_database_size('$this->dbs_name')") > or die ("classes.inc: Error query: 4"); >+ if (PEAR::isError($dbsize)) >+ die($dbsize->getMessage()); > if ( $dbsize->numRows() ) { > while ( $res = $dbsize->fetchRow() ) > $database_size += $res[0]; >@@ -221,7 +225,7 @@ > $graph->SetXDataLabelAngle(90); > else > $graph->SetXDataLabelAngle(0); >-// $graph->SetNumXTicks(10); >+ $graph->SetNumXTicks(1); > // $graph->SetXDataLabelPos('none'); > // $graph->SetXTickLabelPos('plotdown'); > >@@ -373,7 +377,7 @@ > $result->free(); > break; > case BACULA_TYPE_BYTES_ENDTIME_ALLJOBS: // Special: Generic graph from all clientes. >- $i = -1; // Counter of number of jobs of one cliente. SP: Contador del nmero de jobs totales de un cliente. >+ $i = -1; // Counter of number of jobs of one client. SP: Contador del nmero de jobs totales de un cliente. > $i2 = 0; // Counter of number of keys of array. SP: Contador del nmero de valores del array. > > if ($DB_bacula->driver == "mysql") { >@@ -383,12 +387,14 @@ > or die ("classes.inc: Error at query: 8"); > } > else if ($DB_bacula->driver == "pgsql") { >- $res = $DB_bacula->link->query("select Name from Job where EndTime > now() - interval '$this->elapsed seconds' group by Name order by Name desc") >+ $res = $DB_bacula->link->query("select Name from Job where EndTime > now() - 1*interval'$this->elapsed s' group by Name order by Name desc") > or die ("classes.inc: Error at query: 8"); >- $resdata = $DB_bacula->link->query("select date(EndTime) from Job where EndTime > NOW() - interval '$this->elapsed seconds' group by EndTime order by EndTime") >+ $resdata = $DB_bacula->link->query("select to_char(EndTime,'YY-MM-DD') from Job where EndTime > NOW() - 1*interval'$this->elapsed s' group by EndTime order by EndTime") > or die ("classes.inc: Error at query: 9"); > } > >+ if (PEAR::isError($resdata)) >+ die("classes.inc: Error at query: 9.1<br>".$resdata->getMessage()); > while ( $tmpdata = $res->fetchRow() ) > array_push($this->clientes,$tmpdata[0]); > >@@ -405,13 +411,15 @@ > $count++; > array_push($spr,$tmpdata[0]); > if ($DB_bacula->driver == "mysql") >- $result = $DB_bacula->link->query("select date_format(EndTime,\"%Y-%m-%d\"),SUM(JobBytes),Name,count(Name) as Nname from Job WHERE EndTime like '$tmpdata[0]%' group by Name order by Name desc") >+ $result = $DB_bacula->link->query("select date_format(EndTime,\"%Y-%m-%d\"),SUM(JobBytes) as sum,Name as name,count(Name) as Nname from Job WHERE EndTime like '$tmpdata[0]%' group by Name order by Name desc") > or die ("classes.inc: Error at query: 10"); >- else if ($DB_bacula->driver == "pgsql") >- $result = $DB_bacula->link->query("select date(EndTime),SUM(JobBytes),Name,count(Name) as Nname from Job WHERE EndTime like '$tmpdata[0]%' group by EndTime,Name order by Name desc") >+ else if ($DB_bacula->driver == "pgsql") { >+ $query = "select to_char(EndTime,'YY-MM-DD'),SUM(JobBytes) as sum,Name,count(Name) as Nname from Job WHERE EndTime like '%$tmpdata[0]%' group by EndTime,Name order by Name desc"; >+ $result = $DB_bacula->link->query($query) > or die ("classes.inc: Error at query: 11"); >+ } > while ( $row = $result->fetchRow(DB_FETCHMODE_ASSOC) ) { >- $spr2 = array_merge($spr2,array($row["Name"]=>$row["SUM(JobBytes)"])); >+ $spr2 = array_merge($spr2,array($row["name"]=>$row["sum"])); > $i = $result->numRows(); > } > >@@ -421,7 +429,7 @@ > // echo "</pre>"; > > reset ($this->clientes); >- do { >+ do { > if ( $spr2[current($this->clientes)] != NULL) > array_push($spr,$spr2[current($this->clientes)]); > else >@@ -437,7 +445,7 @@ > $spr = array(); > $spr2 = array(); > } >- >+ > for ( $i = 0; $i < count($whole_result); $i++ ) { // To equal the arrays so that the graph is not unsquared. SP:Igualamos las matrices para que la gr�ica no se descuadre > $tmp = count($whole_result[$i]); > if ( $i2 < $tmp ) // Estupidez?. Check this code later... >@@ -463,7 +471,7 @@ > > > >- //Conversi� de la fecha a Mysql-format para Smarty. THE SAME FUNCTION AT 2 CLASSES. THIS WAY IS BUGGY. TO SOLVE LATER. >+ //Convert date from mysql to smarty. THE SAME FUNCTION AT 2 CLASSES. THIS WAY IS BUGGY. TO SOLVE LATER. > function PrepareDate($StartDateMonth,$StartDateDay,$StartDateYear,$EndDateMonth,$EndDateDay,$EndDateYear){ > > $this->StartDate = $StartDateYear."-".$StartDateMonth."-".$StartDateDay." 00:00:00"; >--- ../bacula-web/templates/volumes.tpl 2006-03-14 03:19:31.000000000 -0500 >+++ ../bacula-web/templates/volumes.tpl 2006-01-26 12:12:24.000000000 -0500 >@@ -23,7 +23,7 @@ > <td background="images/bg5.png" class=tbl_pool_inter_2>{t}Volume Bytes{/t}</td> > <td background="images/bg5.png" class=tbl_pool_inter_2>{t}Media Type{/t}</td> > <td background="images/bg5.png" class=tbl_pool_inter_2>{t}When expire?{/t}</td> >- <td background="images/bg5.png" class=tbl_pool_inter_2>{t}Last Written{/t} >+ <td background="images/bg5.png" class=tbl_pool_inter_2>{t}Last Written{/t}</td> > <td background="images/bg5.png" class=tbl_pool_inter_3>{t}Volume Status{/t}</td> > </tr> > {/if}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 126754
:
82514
| 82515 |
82516
|
82517
|
82730
|
82731
|
82864
|
82865