server_status_queries.php 1.4 KB

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