2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * displays the server status > processes list
9 use PhpMyAdmin\Response
;
10 use PhpMyAdmin\Server\Status\Data
;
11 use PhpMyAdmin\Server\Status\Processes
;
13 require_once 'libraries/common.inc.php';
14 require_once 'libraries/server_common.inc.php';
19 require_once 'libraries/replication.inc.php';
21 $serverStatusData = new Data();
22 $response = Response
::getInstance();
25 * Kills a selected process
28 if ($response->isAjax() && !empty($_POST['kill'])) {
29 $kill = intval($_POST['kill']);
30 $query = $GLOBALS['dbi']->getKillQuery($kill);
31 if ($GLOBALS['dbi']->tryQuery($query)) {
32 $message = PhpMyAdmin\Message
::success(
33 __('Thread %s was successfully killed.')
35 $response->setRequestStatus(true);
37 $message = PhpMyAdmin\Message
::error(
39 'phpMyAdmin was unable to kill thread %s.'
40 . ' It probably has already been closed.'
43 $response->setRequestStatus(false);
45 $message->addParam($kill);
46 $response->addJSON('message', $message);
47 } elseif ($response->isAjax() && !empty($_POST['refresh'])) {
48 // Only sends the process list table
49 $response->addHTML(Processes
::getHtmlForServerProcesslist());
52 $header = $response->getHeader();
53 $scripts = $header->getScripts();
54 $scripts->addFile('server_status_processes.js');
55 $response->addHTML('<div>');
56 $response->addHTML($serverStatusData->getMenuHtml());
57 $response->addHTML(Processes
::getHtmlForProcessListFilter());
58 $response->addHTML(Processes
::getHtmlForServerProcesslist());
59 $response->addHTML(Processes
::getHtmlForProcessListAutoRefresh());
60 $response->addHTML('</div>');