From 35c65ed15b2a3d8d2df8f93fd89fcdf2e5c835e3 Mon Sep 17 00:00:00 2001 From: xmujay Date: Sun, 5 May 2013 20:37:37 +0800 Subject: [PATCH] server_status.php refactor add getServerStateGeneralInfoHtml to correct general information --- server_status.php | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/server_status.php b/server_status.php index 592cf749cc..49cb2d9a66 100644 --- a/server_status.php +++ b/server_status.php @@ -60,6 +60,30 @@ exit; */ function getServerTrafficHtml($ServerStatusData) { + //display the server state General Information + $retval = getServerStateGeneralInfoHtml($ServerStatusData); + + //display the server state traffic + $retval .= getServerStateTrafficHtml($ServerStatusData); + + //display the server state connection information + $retval .= getServerStateConnectionsHtml($ServerStatusData); + + //display the Table Process List information + $retval .= getTableProcesslistHtml($ServerStatusData); + + return $retval; +} + +/** + * Prints server state General information + * + * @param Object $ServerStatusData An instance of the PMA_ServerStatusData class + * + * @return string + */ +function getServerStateGeneralInfoHtml($ServerStatusData) +{ $hour_factor = 3600 / $ServerStatusData->status['Uptime']; $start_time = PMA_DBI_fetchValue( 'SELECT UNIX_TIMESTAMP() - ' . $ServerStatusData->status['Uptime'] @@ -127,16 +151,7 @@ function getServerTrafficHtml($ServerStatusData) } } } - - //display the server state traffic - $retval .= getServerStateTrafficHtml($ServerStatusData); - - //display the server state connection information - $retval .= getServerStateConnectionsHtml($ServerStatusData); - - //display the Table Process List information - $retval .= getTableProcesslistHtml($ServerStatusData); - + return $retval; }