/* vim: set expandtab sw=4 ts=4 sts=4: */ /** * Server Status Advisor * * @package PhpMyAdmin */ /** * Unbind all event handlers before tearing down a page */ AJAX.registerTeardown('server_status_advisor.js', function () { $('a[href="#openAdvisorInstructions"]').off('click'); $('#statustabs_advisor').html(''); $('#advisorDialog').remove(); $('#instructionsDialog').remove(); }); AJAX.registerOnload('server_status_advisor.js', function () { // if no advisor is loaded if ($('#advisorData').length === 0) { return; } /** ** Server config advisor ****/ var $dialog = $('
').attr('id', 'advisorDialog'); var $instructionsDialog = $('') .attr('id', 'instructionsDialog') .html($('#advisorInstructionsDialog').html()); $('a[href="#openAdvisorInstructions"]').click(function () { var dlgBtns = {}; dlgBtns[PMA_messages.strClose] = function () { $(this).dialog('close'); }; $instructionsDialog.dialog({ title: PMA_messages.strAdvisorSystem, width: '60%', buttons: dlgBtns }); }); var $cnt = $('#statustabs_advisor'); var $tbody; var $tr; var str; var even = true; data = JSON.parse($('#advisorData').text()); $cnt.html(''); if (data.parse.errors.length > 0) { $cnt.append('Rules file not well formed, following errors were found:' + PMA_messages.strPerformanceIssues + '
'); $cnt.append('' + PMA_messages.strIssuse + ' | ' + PMA_messages.strRecommendation + ' |
---|
' + PMA_messages.strIssuse + ':
' + rule.issue + '
' + PMA_messages.strRecommendation + ':
' + rule.recommendation + '
' + PMA_messages.strJustification + ':
' + rule.justification + '
' + PMA_messages.strFormula + ':
' + rule.formula + '
' + PMA_messages.strTest + ':
' + rule.test + '