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;
|
||||
$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") . "\";");
|
||||
|
||||
@@ -15,6 +15,7 @@ $header
|
||||
<tr>
|
||||
<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['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
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<tr>
|
||||
<th>{$lng['mysql']['databasename']} {$arrowcode['databasename']}</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>
|
||||
<th>{$lng['panel']['options']}</th>
|
||||
</tr>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user