Merge pull request #15404 from jfcherng/fix-php74-curly-braces
[phpmyadmin.git] / server_status_queries.php
blob27fa6c9956f5ec9f543c505f5173ede86850ee2b
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 /**
5 * Displays query statistics for the server
7 * @package PhpMyAdmin
8 */
10 use PhpMyAdmin\Response;
11 use PhpMyAdmin\Message;
12 use PhpMyAdmin\Server\Status\Data;
13 use PhpMyAdmin\Server\Status\Queries;
15 require_once 'libraries/common.inc.php';
16 require_once 'libraries/server_common.inc.php';
17 require_once 'libraries/replication.inc.php';
19 $serverStatusData = new Data();
21 $response = Response::getInstance();
22 $header = $response->getHeader();
23 $scripts = $header->getScripts();
25 // for charting
26 $scripts->addFile('chart.js');
27 $scripts->addFile('vendor/jqplot/jquery.jqplot.js');
28 $scripts->addFile('vendor/jqplot/plugins/jqplot.pieRenderer.js');
29 $scripts->addFile('vendor/jqplot/plugins/jqplot.highlighter.js');
30 $scripts->addFile('vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js');
31 $scripts->addFile('vendor/jquery/jquery.tablesorter.js');
32 $scripts->addFile('server_status_sorter.js');
33 $scripts->addFile('server_status_queries.js');
35 // Add the html content to the response
36 $response->addHTML('<div>');
37 $response->addHTML($serverStatusData->getMenuHtml());
38 if ($serverStatusData->dataLoaded) {
39 $response->addHTML(Queries::getHtmlForQueryStatistics($serverStatusData));
40 } else {
41 $response->addHTML(
42 Message::error(
43 __('Not enough privilege to view query statistics.')
44 )->getDisplay()
47 $response->addHTML('</div>');
48 exit;