diff --git a/server_status.php b/server_status.php index da775b9d3f..f0cfe15b16 100644 --- a/server_status.php +++ b/server_status.php @@ -1257,6 +1257,45 @@ function printServerTraffic() } else { $full_text_link = 'server_status.php' . PMA_generate_common_url(array('full' => 1)); } + + // This array contains display name and real column name of each + // sortable column in the table + $sortable_columns = array( + array( + 'column_name' => __('ID'), + 'order_by_field' => 'Id' + ), + array( + 'column_name' => __('User'), + 'order_by_field' => 'User' + ), + array( + 'column_name' => __('Host'), + 'order_by_field' => 'Host' + ), + array( + 'column_name' => __('Database'), + 'order_by_field' => 'db' + ), + array( + 'column_name' => __('Command'), + 'order_by_field' => 'Command' + ), + array( + 'column_name' => __('Time'), + 'order_by_field' => 'Time' + ), + array( + 'column_name' => __('Status'), + 'order_by_field' => 'State' + ), + array( + 'column_name' => __('SQL query'), + 'order_by_field' => 'Info' + ) + ); + $sortable_columns_count = count($sortable_columns); + if (PMA_DRIZZLE) { $sql_query = "SELECT p.id AS Id, @@ -1269,47 +1308,102 @@ function printServerTraffic() " . ($show_full_sql ? 's.query' : 'left(p.info, ' . (int)$GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] . ')') . " AS Info FROM data_dictionary.PROCESSLIST p " . ($show_full_sql ? 'LEFT JOIN data_dictionary.SESSIONS s ON s.session_id = p.id' : ''); + if (!empty($_REQUEST['order_by_field']) + && !empty($_REQUEST['sort_order']) + ) { + $sql_query .= ' ORDER BY p.' . $_REQUEST['order_by_field'] . ' ' . $_REQUEST['sort_order']; + } } else { $sql_query = $show_full_sql ? 'SHOW FULL PROCESSLIST' : 'SHOW PROCESSLIST'; + if (!empty($_REQUEST['order_by_field']) + && !empty($_REQUEST['sort_order']) + ) { + $sql_query = 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` ORDER BY `' + . $_REQUEST['order_by_field'] . '` ' . $_REQUEST['sort_order']; + } } + $result = PMA_DBI_query($sql_query); /** * Displays the page */ ?> -
| - | - | - | - | - | - | - | - | + | + + + - - |
+
+ onmouseout="$('.soimg').toggle()" onmouseover="$('.soimg').toggle()"
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
diff --git a/themes/pmahomme/jquery/jquery-ui-1.8.16.custom.css b/themes/pmahomme/jquery/jquery-ui-1.8.16.custom.css
index a087015598..4abfd610b0 100644
--- a/themes/pmahomme/jquery/jquery-ui-1.8.16.custom.css
+++ b/themes/pmahomme/jquery/jquery-ui-1.8.16.custom.css
@@ -60,7 +60,7 @@
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
-.ui-widget-content a { color: #222222; }
+.ui-widget-content a { color: #235A81; }
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
.ui-widget-header a { color: #222222; }
|---|