Show database-size in database-overview, fixes #834
Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
@@ -62,17 +62,24 @@ elseif($page == 'mysqls')
|
|||||||
$count = 0;
|
$count = 0;
|
||||||
$mysqls = '';
|
$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))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
if($paging->checkDisplay($i))
|
if($paging->checkDisplay($i))
|
||||||
{
|
{
|
||||||
$row = htmlentities_array($row);
|
$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") . "\";");
|
eval("\$mysqls.=\"" . getTemplate("mysql/mysqls_database") . "\";");
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
$db_root->close();
|
||||||
|
// End root-session
|
||||||
|
|
||||||
$mysqls_count = $db->num_rows($result);
|
$mysqls_count = $db->num_rows($result);
|
||||||
eval("echo \"" . getTemplate("mysql/mysqls") . "\";");
|
eval("echo \"" . getTemplate("mysql/mysqls") . "\";");
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ $header
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="field_display_border_left">{$lng['mysql']['databasename']} {$arrowcode['databasename']}</td>
|
<td class="field_display_border_left">{$lng['mysql']['databasename']} {$arrowcode['databasename']}</td>
|
||||||
<td class="field_display">{$lng['mysql']['databasedescription']} {$arrowcode['description']}</td>
|
<td class="field_display">{$lng['mysql']['databasedescription']} {$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>
|
<if 1 < count($sql_root)><td class="field_display">{$lng['mysql']['mysql_server']}</td></if>
|
||||||
<td class="field_display_search" colspan="2">{$sortcode}</td>
|
<td class="field_display_search" colspan="2">{$sortcode}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>{$lng['mysql']['databasename']} {$arrowcode['databasename']}</th>
|
<th>{$lng['mysql']['databasename']} {$arrowcode['databasename']}</th>
|
||||||
<th>{$lng['mysql']['databasedescription']} {$arrowcode['description']}</th>
|
<th>{$lng['mysql']['databasedescription']} {$arrowcode['description']}</th>
|
||||||
|
<th>{$lng['panel']['megabyte']}</th>
|
||||||
<if 1 < count($sql_root)><th>{$lng['mysql']['mysql_server']}</th></if>
|
<if 1 < count($sql_root)><th>{$lng['mysql']['mysql_server']}</th></if>
|
||||||
<th>{$lng['panel']['options']}</th>
|
<th>{$lng['panel']['options']}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{$row['databasename']}</td>
|
<td>{$row['databasename']}</td>
|
||||||
<td>{$row['description']}</td>
|
<td>{$row['description']}</td>
|
||||||
|
<td>{$row['size']}</td>
|
||||||
<if 1 < count($sql_root)><td>{$sql_root[$row['dbserver']]['caption']}</td></if>
|
<if 1 < count($sql_root)><td>{$sql_root[$row['dbserver']]['caption']}</td></if>
|
||||||
<if $row['apsdb'] != '1'>
|
<if $row['apsdb'] != '1'>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user