Show database-size in database-overview, fixes #834

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
Florian Aders (EleRas)
2011-09-08 14:46:01 +02:00
parent 86ac4708f0
commit e636e6eb39
4 changed files with 11 additions and 1 deletions

View File

@@ -62,17 +62,24 @@ elseif($page == 'mysqls')
$count = 0;
$mysqls = '';
// Begin root-session
$db_root = new db($sql_root[0]['host'], $sql_root[0]['user'], $sql_root[0]['password'], '');
unset($db_root->password);
while($row = $db->fetch_array($result))
{
if($paging->checkDisplay($i))
{
$row = htmlentities_array($row);
$mbdata = $db_root->query_first("SELECT SUM( data_length + index_length) / 1024 / 1024 'MB' FROM information_schema.TABLES WHERE table_schema = '" . $db_root->escape($row['databasename']) . "' GROUP BY table_schema ;");
$row['size'] = $mbdata['MB'];
eval("\$mysqls.=\"" . getTemplate("mysql/mysqls_database") . "\";");
$count++;
}
$i++;
}
$db_root->close();
// End root-session
$mysqls_count = $db->num_rows($result);
eval("echo \"" . getTemplate("mysql/mysqls") . "\";");

View File

@@ -15,6 +15,7 @@ $header
<tr>
<td class="field_display_border_left">{$lng['mysql']['databasename']}&nbsp;&nbsp;{$arrowcode['databasename']}</td>
<td class="field_display">{$lng['mysql']['databasedescription']}&nbsp;&nbsp;{$arrowcode['description']}</td>
<td class="field_display">{$lng['panel']['megabyte']}</td>
<if 1 < count($sql_root)><td class="field_display">{$lng['mysql']['mysql_server']}</td></if>
<td class="field_display_search" colspan="2">{$sortcode}</td>
</tr>
@@ -33,4 +34,4 @@ $header
</form>
<br />
<br />
$footer
$footer

View File

@@ -27,6 +27,7 @@
<tr>
<th>{$lng['mysql']['databasename']}&nbsp;{$arrowcode['databasename']}</th>
<th>{$lng['mysql']['databasedescription']}&nbsp;{$arrowcode['description']}</th>
<th>{$lng['panel']['megabyte']}</th>
<if 1 < count($sql_root)><th>{$lng['mysql']['mysql_server']}</th></if>
<th>{$lng['panel']['options']}</th>
</tr>

View File

@@ -1,6 +1,7 @@
<tr>
<td>{$row['databasename']}</td>
<td>{$row['description']}</td>
<td>{$row['size']}</td>
<if 1 < count($sql_root)><td>{$sql_root[$row['dbserver']]['caption']}</td></if>
<if $row['apsdb'] != '1'>
<td>