All properties of the class are read-only TODO: Use lazy initialisation for some of the properties since not all of the server_status_*.php pages need all the data that this class provides.
/**
 * Prints html for auto refreshing processes list
 *
 * @return string
 */
function PMA_getHtmlForProcessListAutoRefresh()
{
    $notice = Message::notice(__('Note: Enabling the auto refresh here might cause ' . 'heavy traffic between the web server and the MySQL server.'))->getDisplay();
    $retval = $notice . '<div class="tabLinks">';
    $retval .= '<label>' . __('Refresh rate') . ': ';
    $retval .= ServerStatusData::getHtmlForRefreshList('refreshRate', 5, array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200));
    $retval .= '</label>';
    $retval .= '<a id="toggleRefresh" href="#">';
    $retval .= Util::getImage('play.png') . __('Start auto refresh');
    $retval .= '</a>';
    $retval .= '</div>';
    return $retval;
}
/**
 * Returns html with Settings dialog
 *
 * @return string
 */
function PMA_getHtmlForSettingsDialog()
{
    $retval = '<div class="popupContent settingsPopup">';
    $retval .= '<a href="#addNewChart">';
    $retval .= PMA\libraries\Util::getImage('b_chart.png') . __('Add chart');
    $retval .= '</a>';
    $retval .= '<a href="#rearrangeCharts">';
    $retval .= PMA\libraries\Util::getImage('b_tblops.png') . __('Enable charts dragging');
    $retval .= '</a>';
    $retval .= '<div class="clearfloat paddingtop"></div>';
    $retval .= '<div class="floatleft">';
    $retval .= __('Refresh rate') . '<br />';
    $retval .= ServerStatusData::getHtmlForRefreshList('gridChartRefresh', 5, array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200));
    $retval .= '<br />';
    $retval .= '</div>';
    $retval .= '<div class="floatleft">';
    $retval .= __('Chart columns');
    $retval .= '<br />';
    $retval .= '<select name="chartColumns">';
    $retval .= '<option>1</option>';
    $retval .= '<option>2</option>';
    $retval .= '<option>3</option>';
    $retval .= '<option>4</option>';
    $retval .= '<option>5</option>';
    $retval .= '<option>6</option>';
    $retval .= '</select>';
    $retval .= '</div>';
    $retval .= '<div class="clearfloat paddingtop">';
    $retval .= '<b>' . __('Chart arrangement') . '</b> ';
    $retval .= PMA\libraries\Util::showHint(__('The arrangement of the charts is stored to the browsers local storage. ' . 'You may want to export it if you have a complicated set up.'));
    $retval .= '<br/>';
    $retval .= '<a class="ajax" href="#importMonitorConfig">';
    $retval .= __('Import');
    $retval .= '</a>';
    $retval .= '&nbsp;&nbsp;';
    $retval .= '<a class="disableAjax" href="#exportMonitorConfig">';
    $retval .= __('Export');
    $retval .= '</a>';
    $retval .= '&nbsp;&nbsp;';
    $retval .= '<a href="#clearMonitorConfig">';
    $retval .= __('Reset to default');
    $retval .= '</a>';
    $retval .= '</div>';
    $retval .= '</div>';
    return $retval;
}
 * JS Includes
 */
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('jquery/jquery.tablesorter.js');
$scripts->addFile('jquery/jquery.sortableTable.js');
$scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
// for charting
$scripts->addFile('jqplot/jquery.jqplot.js');
$scripts->addFile('jqplot/plugins/jqplot.pieRenderer.js');
$scripts->addFile('jqplot/plugins/jqplot.canvasTextRenderer.js');
$scripts->addFile('jqplot/plugins/jqplot.canvasAxisLabelRenderer.js');
$scripts->addFile('jqplot/plugins/jqplot.dateAxisRenderer.js');
$scripts->addFile('jqplot/plugins/jqplot.highlighter.js');
$scripts->addFile('jqplot/plugins/jqplot.cursor.js');
$scripts->addFile('jqplot/plugins/jqplot.byteFormatter.js');
$scripts->addFile('server_status_monitor.js');
$scripts->addFile('server_status_sorter.js');
/**
 * start output
 */
$ServerStatusData = new ServerStatusData();
/**
 * Output
 */
$response->addHTML('<div>');
$response->addHTML($ServerStatusData->getMenuHtml());
$response->addHTML(PMA_getHtmlForMonitor($ServerStatusData));
$response->addHTML(PMA_getHtmlForClientSideDataAndLinks($ServerStatusData));
$response->addHTML('</div>');
exit;
예제 #4
0
<?php

/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Displays query statistics for the server
 *
 * @package PhpMyAdmin
 */
use PMA\libraries\Message;
use PMA\libraries\ServerStatusData;
require_once 'libraries/common.inc.php';
require_once 'libraries/server_common.inc.php';
require_once 'libraries/server_status_queries.lib.php';
require_once 'libraries/replication.inc.php';
require_once 'libraries/replication_gui.lib.php';
$serverStatusData = new ServerStatusData();
$response = PMA\libraries\Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('server_status_queries.js');
/* < IE 9 doesn't support canvas natively */
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) {
    $scripts->addFile('jqplot/excanvas.js');
}
// for charting
$scripts->addFile('jqplot/jquery.jqplot.js');
$scripts->addFile('jqplot/plugins/jqplot.pieRenderer.js');
$scripts->addFile('jqplot/plugins/jqplot.canvasTextRenderer.js');
$scripts->addFile('jqplot/plugins/jqplot.canvasAxisLabelRenderer.js');
$scripts->addFile('jqplot/plugins/jqplot.dateAxisRenderer.js');
$scripts->addFile('jqplot/plugins/jqplot.highlighter.js');
require_once 'libraries/common.inc.php';
require_once 'libraries/server_common.inc.php';
require_once 'libraries/server_status_variables.lib.php';
require_once 'libraries/replication.inc.php';
require_once 'libraries/replication_gui.lib.php';
/**
 * flush status variables if requested
 */
if (isset($_REQUEST['flush'])) {
    $_flush_commands = array('STATUS', 'TABLES', 'QUERY CACHE');
    if (in_array($_REQUEST['flush'], $_flush_commands)) {
        $GLOBALS['dbi']->query('FLUSH ' . $_REQUEST['flush'] . ';');
    }
    unset($_flush_commands);
}
$serverStatusData = new ServerStatusData();
$response = PMA\libraries\Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('server_status_variables.js');
$scripts->addFile('jquery/jquery.tablesorter.js');
$scripts->addFile('server_status_sorter.js');
$response->addHTML('<div>');
$response->addHTML($serverStatusData->getMenuHtml());
if ($serverStatusData->dataLoaded) {
    $response->addHTML(PMA_getHtmlForFilter($serverStatusData));
    $response->addHTML(PMA_getHtmlForLinkSuggestions($serverStatusData));
    $response->addHTML(PMA_getHtmlForVariablesList($serverStatusData));
} else {
    $response->addHTML(Message::error(__('Not enough privilege to view status variables.'))->getDisplay());
}
예제 #6
0
/**
 * displays the advisor feature
 *
 * @package PhpMyAdmin
 */

use PMA\libraries\Message;
use PMA\libraries\Response;
use PMA\libraries\ServerStatusData;

require_once 'libraries/common.inc.php';
require_once 'libraries/server_status_advisor.lib.php';
require_once 'libraries/replication.inc.php';
require_once 'libraries/replication_gui.lib.php';

$serverStatusData = new ServerStatusData();

$response = Response::getInstance();
$scripts = $response->getHeader()->getScripts();
$scripts->addFile('server_status_advisor.js');

/**
 * Output
 */
$response->addHTML('<div>');
$response->addHTML($serverStatusData->getMenuHtml());
if ($serverStatusData->dataLoaded) {
    $response->addHTML(PMA_getHtmlForAdvisor());
} else {
    $response->addHTML(
        Message::error(