From 4b25a1fd6dd6021b1f843bd89f93144cd7a81229 Mon Sep 17 00:00:00 2001 From: Juan Luis Francis Date: Thu, 1 Sep 2005 16:31:51 +0000 Subject: [PATCH] - Fixed mysql database size result. Reported by Roland Arendes git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2373 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bacula-web/ChangeLog | 6 ++++-- gui/bacula-web/TODO | 2 +- gui/bacula-web/classes.inc | 4 ++-- gui/bacula-web/index.php | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gui/bacula-web/ChangeLog b/gui/bacula-web/ChangeLog index c9ed5a23a7..19f847298e 100644 --- a/gui/bacula-web/ChangeLog +++ b/gui/bacula-web/ChangeLog @@ -3,10 +3,12 @@ - Updated French translation - Initial support for PostgreSQL (thanks to Dan Langille) - Upgrade Phplot to 5.0rc2 version. - - Add templates_c to cvs repository. + - Added templates_c to cvs repository. + - Added German translation + - Fix mysql database size (reported by Roland Arendes) 25-10-2004 Bacula web 1.1 - - Add array_fill function (as Mikael suggested) + - Add array_fill function (as Mikael suggested) - Fix url encode of links. (reported by Phil Stracchino) - Upgrade Smarty to 2.6.6 version. - Add French translation diff --git a/gui/bacula-web/TODO b/gui/bacula-web/TODO index c01d138d39..a6ef5aa3cc 100644 --- a/gui/bacula-web/TODO +++ b/gui/bacula-web/TODO @@ -1,3 +1,4 @@ +- Multi catalog - Improve check errors routines. - Improve security. (stats.php mainly) - Optimize database querys (Very poor now) (TO_DAYS,etc.). @@ -11,7 +12,6 @@ LOW PRIORITY ------------ -- Multi catalog - WebConsole!!! - Add support to PDF creation. - Build documentation of classes. diff --git a/gui/bacula-web/classes.inc b/gui/bacula-web/classes.inc index 9b4211b644..ad3a72a6f7 100644 --- a/gui/bacula-web/classes.inc +++ b/gui/bacula-web/classes.inc @@ -124,8 +124,8 @@ class Bweb extends DB { $dbsize = $this->link->query("show table status") or die ("classes.inc: Error query: 3"); if ( $dbsize->numRows() ) { - while ( $res = $dbsize->fetchRow() ) - $database_size += $res[5]; + while ( $res = $dbsize->fetchRow(DB_FETCHMODE_ASSOC) ) + $database_size += $res["Data_length"]; } else return 0; diff --git a/gui/bacula-web/index.php b/gui/bacula-web/index.php index 78c527309a..cc13c78b4b 100644 --- a/gui/bacula-web/index.php +++ b/gui/bacula-web/index.php @@ -47,7 +47,7 @@ if ( $dbSql->driver == "pgsql") $bytes_stored =& $dbSql->link->getOne("select SUM(VolBytes) from Media") or die ("Error query: 4"); -$smarty->assign('database_size', $dbSql->GetDbSize()*1000000); +$smarty->assign('database_size', $dbSql->GetDbSize()); $smarty->assign('bytes_stored',$bytes_stored); $tmp = $client->fetchRow(); -- 2.39.5