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