Translated using Weblate (Japanese)
[phpmyadmin.git] / server_status_processes.php
blob39e048a186a8ad94f91307765fac950d2f651c5c
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * displays the server status > processes list
6 * @package PhpMyAdmin
7 */
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';
16 /**
17 * Replication library
19 require_once 'libraries/replication.inc.php';
21 $serverStatusData = new Data();
22 $response = Response::getInstance();
24 /**
25 * Kills a selected process
26 * on ajax request
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);
36 } else {
37 $message = PhpMyAdmin\Message::error(
38 __(
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());
50 } else {
51 // Load the full page
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>');
62 exit;