fix for export to windows, take 2.
[openemr.git] / phpmyadmin / server_status_monitor.php
blob958bed2066c50c4147aa93c20964537e1c57a8b3
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Server status monitor feature
6 * @package PhpMyAdmin
7 */
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/server_common.inc.php';
11 require_once 'libraries/ServerStatusData.class.php';
12 require_once 'libraries/server_status_monitor.lib.php';
13 if (PMA_DRIZZLE) {
14 $server_master_status = false;
15 $server_slave_status = false;
16 } else {
17 include_once 'libraries/replication.inc.php';
18 include_once 'libraries/replication_gui.lib.php';
21 /**
22 * Ajax request
24 if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
25 // Send with correct charset
26 header('Content-Type: text/html; charset=UTF-8');
28 // real-time charting data
29 if (isset($_REQUEST['chart_data'])) {
30 switch($_REQUEST['type']) {
31 case 'chartgrid': // Data for the monitor
32 $ret = PMA_getJsonForChartingData();
33 PMA_Response::getInstance()->addJSON('message', $ret);
34 exit;
38 if (isset($_REQUEST['log_data'])) {
39 if (PMA_MYSQL_INT_VERSION < 50106) {
40 // Table logging is only available since 5.1.6
41 exit('""');
44 $start = intval($_REQUEST['time_start']);
45 $end = intval($_REQUEST['time_end']);
47 if ($_REQUEST['type'] == 'slow') {
48 $return = PMA_getJsonForLogDataTypeSlow($start, $end);
49 PMA_Response::getInstance()->addJSON('message', $return);
50 exit;
53 if ($_REQUEST['type'] == 'general') {
54 $return = PMA_getJsonForLogDataTypeGeneral($start, $end);
55 PMA_Response::getInstance()->addJSON('message', $return);
56 exit;
60 if (isset($_REQUEST['logging_vars'])) {
61 $loggingVars = PMA_getJsonForLoggingVars();
62 PMA_Response::getInstance()->addJSON('message', $loggingVars);
63 exit;
66 if (isset($_REQUEST['query_analyzer'])) {
67 $return = PMA_getJsonForQueryAnalyzer();
68 PMA_Response::getInstance()->addJSON('message', $return);
69 exit;
73 /**
74 * JS Includes
76 $header = $response->getHeader();
77 $scripts = $header->getScripts();
78 $scripts->addFile('jquery/jquery.tablesorter.js');
79 $scripts->addFile('jquery/jquery.sortableTable.js');
80 $scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
81 /* < IE 9 doesn't support canvas natively */
82 if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) {
83 $scripts->addFile('jqplot/excanvas.js');
85 $scripts->addFile('canvg/canvg.js');
86 // for charting
87 $scripts->addFile('jqplot/jquery.jqplot.js');
88 $scripts->addFile('jqplot/plugins/jqplot.pieRenderer.js');
89 $scripts->addFile('jqplot/plugins/jqplot.canvasTextRenderer.js');
90 $scripts->addFile('jqplot/plugins/jqplot.canvasAxisLabelRenderer.js');
91 $scripts->addFile('jqplot/plugins/jqplot.dateAxisRenderer.js');
92 $scripts->addFile('jqplot/plugins/jqplot.highlighter.js');
93 $scripts->addFile('jqplot/plugins/jqplot.cursor.js');
94 $scripts->addFile('jqplot/plugins/jqplot.byteFormatter.js');
96 $scripts->addFile('server_status_monitor.js');
97 $scripts->addFile('server_status_sorter.js');
101 * start output
103 $ServerStatusData = new PMA_ServerStatusData();
106 * Output
108 $response->addHTML('<div>');
109 $response->addHTML($ServerStatusData->getMenuHtml());
110 $response->addHTML(PMA_getHtmlForMonitor($ServerStatusData));
111 $response->addHTML(PMA_getHtmlForClientSideDataAndLinks($ServerStatusData));
112 $response->addHTML('</div>');
113 exit;