/**
 * Prints html for auto refreshing processes list
 *
 * @return string
 */
function PMA_getHtmlForProcessListAutoRefresh()
{
    $notice = PMA_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 .= PMA_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 .= PMA_Util::getImage('play.png') . __('Start auto refresh');
    $retval .= '</a>';
    $retval .= '</div>';
    return $retval;
}
 * Displays query statistics for the server
 *
 * @package PhpMyAdmin
 */
require_once 'libraries/common.inc.php';
require_once 'libraries/server_common.inc.php';
require_once 'libraries/ServerStatusData.class.php';
require_once 'libraries/server_status_queries.lib.php';
if (PMA_DRIZZLE) {
    $server_master_status = false;
    $server_slave_status = false;
} else {
    include_once 'libraries/replication.inc.php';
    include_once 'libraries/replication_gui.lib.php';
}
$ServerStatusData = new PMA_ServerStatusData();
$response = PMA_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');
示例#3
0
if (PMA_DRIZZLE) {
    $server_master_status = false;
    $server_slave_status = false;
} else {
    include_once 'libraries/replication.inc.php';
    include_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 PMA_ServerStatusData();
$response = PMA_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());
$response->addHTML(PMA_getHtmlForFilter($ServerStatusData));
$response->addHTML(PMA_getHtmlForLinkSuggestions($ServerStatusData));
$response->addHTML(PMA_getHtmlForVariablesList($ServerStatusData));
$response->addHTML('</div>');
exit;
示例#4
0
 * @package PhpMyAdmin
 */
require_once 'libraries/common.inc.php';
require_once 'libraries/server_common.inc.php';
require_once 'libraries/ServerStatusData.class.php';
/**
 * Replication library
 */
if (PMA_DRIZZLE) {
    $server_master_status = false;
    $server_slave_status = false;
} else {
    include_once 'libraries/replication.inc.php';
    include_once 'libraries/replication_gui.lib.php';
}
$ServerStatusData = new PMA_ServerStatusData();
/**
 * Kills a selected process
 */
if (!empty($_REQUEST['kill'])) {
    if (PMA_DBI_try_query('KILL ' . $_REQUEST['kill'] . ';')) {
        $message = PMA_Message::success(__('Thread %s was successfully killed.'));
    } else {
        $message = PMA_Message::error(__('phpMyAdmin was unable to kill thread %s.' . ' It probably has already been closed.'));
    }
    $message->addParam($_REQUEST['kill']);
}
/**
 * start output
 */
$response = PMA_Response::getInstance();
 * @package PhpMyAdmin
 */
require_once 'libraries/common.inc.php';
require_once 'libraries/server_common.inc.php';
require_once 'libraries/ServerStatusData.class.php';
require_once 'libraries/server_status.lib.php';
/**
 * Replication library
 */
if (PMA_DRIZZLE) {
    $GLOBALS['replication_info'] = array();
    $GLOBALS['replication_info']['master']['status'] = false;
    $GLOBALS['replication_info']['slave']['status'] = false;
} else {
    include_once 'libraries/replication.inc.php';
    include_once 'libraries/replication_gui.lib.php';
}
/**
 * start output
 */
$response = PMA_Response::getInstance();
$response->addHTML('<div>');
$serverStatusData = new PMA_ServerStatusData();
$response->addHTML($serverStatusData->getMenuHtml());
if ($serverStatusData->dataLoaded) {
    $response->addHTML(PMA_getHtmlForServerStatus($serverStatusData));
} else {
    $response->addHTML(PMA_Message::error(__('Not enough privilege to view server status.'))->getDisplay());
}
$response->addHTML('</div>');
exit;
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * displays the advisor feature
 *
 * @package PhpMyAdmin
 */
require_once 'libraries/common.inc.php';
require_once 'libraries/Advisor.class.php';
require_once 'libraries/ServerStatusData.class.php';
require_once 'libraries/server_status_advisor.lib.php';
if (PMA_DRIZZLE) {
    $GLOBALS['replication_info'] = array();
    $GLOBALS['replication_info']['master']['status'] = false;
    $GLOBALS['replication_info']['slave']['status'] = false;
} else {
    include_once 'libraries/replication.inc.php';
    include_once 'libraries/replication_gui.lib.php';
}
$ServerStatusData = new PMA_ServerStatusData();
$response = PMA_Response::getInstance();
$scripts = $response->getHeader()->getScripts();
$scripts->addFile('server_status_advisor.js');
/**
 * Output
 */
$response->addHTML('<div>');
$response->addHTML($ServerStatusData->getMenuHtml());
$response->addHTML(PMA_getHtmlForAdvisor());
$response->addHTML('</div>');
exit;
/**
 * Displays query statistics for the server
 *
 * @package PhpMyAdmin
 */
require_once 'libraries/common.inc.php';
require_once 'libraries/server_common.inc.php';
require_once 'libraries/ServerStatusData.class.php';
if (PMA_DRIZZLE) {
    $server_master_status = false;
    $server_slave_status = false;
} else {
    include_once 'libraries/replication.inc.php';
    include_once 'libraries/replication_gui.lib.php';
}
$ServerStatusData = new PMA_ServerStatusData();
$response = PMA_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');
/**
 * Returns html with Settings dialog
 *
 * @return string
 */
function PMA_getHtmlForSettingsDialog()
{
    $retval = '<div class="popupContent settingsPopup">';
    $retval .= '<a href="#addNewChart">';
    $retval .= PMA_Util::getImage('b_chart.png') . __('Add chart');
    $retval .= '</a>';
    $retval .= '<a href="#rearrangeCharts">';
    $retval .= PMA_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 .= PMA_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_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;
}
示例#9
0
$scripts->addFile('canvg/canvg.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 PMA_ServerStatusData();
/**
 * Define some data needed on the client side
 */
$input = '<input type="hidden" name="%s" value="%s" />';
$form = '<form id="js_data" class="hide">';
$form .= sprintf($input, 'server_time', microtime(true) * 1000);
$form .= sprintf($input, 'server_os', PHP_OS);
$form .= sprintf($input, 'is_superuser', PMA_isSuperuser());
$form .= sprintf($input, 'server_db_isLocal', $ServerStatusData->db_isLocal);
$form .= '</form>';
/**
 * Define some links used on client side
 */
$links = '<div id="profiling_docu" class="hide">';
$links .= PMA_Util::showMySQLDocu('general-thread-states', 'general-thread-states');
/**
 * displays the advisor feature
 *
 * @package PhpMyAdmin
 */
require_once 'libraries/common.inc.php';
require_once 'libraries/Advisor.class.php';
require_once 'libraries/ServerStatusData.class.php';
if (PMA_DRIZZLE) {
    $server_master_status = false;
    $server_slave_status = false;
} else {
    include_once 'libraries/replication.inc.php';
    include_once 'libraries/replication_gui.lib.php';
}
$ServerStatusData = new PMA_ServerStatusData();
$response = PMA_Response::getInstance();
$scripts = $response->getHeader()->getScripts();
$scripts->addFile('server_status_advisor.js');
$output = '<div>';
$output .= $ServerStatusData->getMenuHtml();
$output .= '<a href="#openAdvisorInstructions">';
$output .= PMA_Util::getIcon('b_help.png', __('Instructions'));
$output .= '</a>';
$output .= '<div id="statustabs_advisor"></div>';
$output .= '<div id="advisorInstructionsDialog" style="display:none;">';
$output .= '<p>';
$output .= __('The Advisor system can provide recommendations ' . 'on server variables by analyzing the server status variables.');
$output .= '</p>';
$output .= '<p>';
$output .= __('Do note however that this system provides recommendations ' . 'based on simple calculations and by rule of thumb which may ' . 'not necessarily apply to your system.');
    $server_slave_status = false;
} else {
    include_once 'libraries/replication.inc.php';
    include_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)) {
        PMA_DBI_query('FLUSH ' . $_REQUEST['flush'] . ';');
    }
    unset($_flush_commands);
}
$ServerStatusData = new PMA_ServerStatusData();
$response = PMA_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());
$response->addHTML(getFilterHtml($ServerStatusData));
$response->addHTML(getLinkSuggestionsHtml($ServerStatusData));
$response->addHTML(getVariablesTableHtml($ServerStatusData));
$response->addHTML('</div>');
exit;
/**
 * Returns the html for the list filter