Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
This commit is contained in:
commit
8604ba0303
10
ChangeLog
10
ChangeLog
@ -1,4 +1,4 @@
|
||||
phpMyAdmin - ChangeLog
|
||||
phpMyAdmin - ChangeLog
|
||||
======================
|
||||
|
||||
3.5.0.0 (not yet released)
|
||||
@ -16,6 +16,10 @@
|
||||
+ Patch #3271804 for rfe #3177495, new DisableMultiTableMaintenance directive
|
||||
+ [interface] Reorganised server status page.
|
||||
+ [interface] Changed way of generating charts.
|
||||
+ rfe #939233 [interface] Flexible column width
|
||||
+ [interface] Mouse-based column reordering in query results
|
||||
+ AJAX for Insert to a table from database Structure page
|
||||
- Patch #3316969 PMA_ajaxShowMessage() does not respect timeout
|
||||
|
||||
3.4.3.0 (not yet released)
|
||||
- bug #3311170 [sync] Missing helper icons in Synchronize
|
||||
@ -26,6 +30,10 @@
|
||||
- bug #3313210 [interface] Columns class sometimes changed for nothing
|
||||
- patch #3313326 [interface] Some tooltips do not disappear
|
||||
- bug #3315720 [search] Fix search in non unicode tables
|
||||
- bug #3315741 [display] Inline query edit broken
|
||||
- patch #3317206 [privileges] Generate password option missing on new accounts
|
||||
- bug #3317293 [edit] Inline edit places HTML line breaks in edit area
|
||||
- bug #3319466 [interface] Inline query edit does not escape special characters
|
||||
|
||||
3.4.2.0 (2011-06-07)
|
||||
- bug #3301249 [interface] Iconic table operations does not remove inline edit label
|
||||
|
||||
@ -1073,7 +1073,7 @@ ALTER TABLE `pma_column_comments`
|
||||
Without configuring the storage, you can still access the recently used tables,
|
||||
but it will disappear after you logout.<br/><br/>
|
||||
|
||||
To allow the usage of this functionality:
|
||||
To allow the usage of this functionality persistently:
|
||||
|
||||
<ul>
|
||||
<li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
|
||||
|
||||
@ -58,9 +58,8 @@ PMA_DBI_select_db($db);
|
||||
$rowset = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
|
||||
|
||||
$count = 0;
|
||||
while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
||||
$myfieldname = 'Tables_in_' . htmlspecialchars($db);
|
||||
$table = $row[$myfieldname];
|
||||
while ($row = PMA_DBI_fetch_row($rowset)) {
|
||||
$table = $row[0];
|
||||
$comments = PMA_getComments($db, $table);
|
||||
|
||||
echo '<div>' . "\n";
|
||||
|
||||
@ -759,7 +759,7 @@ if (isset($Field) && count($Field) > 0) {
|
||||
while ($ind = PMA_DBI_fetch_assoc($ind_rs)) {
|
||||
$col1 = $tab . '.' . $ind['Column_name'];
|
||||
if (isset($col_all[$col1])) {
|
||||
if ($ind['non_unique'] == 0) {
|
||||
if ($ind['Non_unique'] == 0) {
|
||||
if (isset($col_where[$col1])) {
|
||||
$col_unique[$col1] = 'Y';
|
||||
} else {
|
||||
|
||||
@ -38,6 +38,8 @@
|
||||
require_once './libraries/common.inc.php';
|
||||
|
||||
$GLOBALS['js_include'][] = 'db_search.js';
|
||||
$GLOBALS['js_include'][] = 'sql.js';
|
||||
$GLOBALS['js_include'][] = 'makegrid.js';
|
||||
|
||||
/**
|
||||
* Gets some core libraries and send headers
|
||||
|
||||
@ -14,6 +14,7 @@ require_once './libraries/common.inc.php';
|
||||
* Runs common work
|
||||
*/
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
$GLOBALS['js_include'][] = 'makegrid.js';
|
||||
$GLOBALS['js_include'][] = 'sql.js';
|
||||
|
||||
require './libraries/db_common.inc.php';
|
||||
|
||||
@ -26,7 +26,14 @@ function loadResult(result_path , table_name , link , ajaxEnable){
|
||||
/** Load the browse results to the page */
|
||||
$("#table-info").show();
|
||||
$('#table-link').attr({"href" : 'sql.php?'+link }).text(table_name);
|
||||
$('#browse-results').load(result_path + " '"+'#sqlqueryresults' + "'").show();
|
||||
$('#browse-results').load(result_path + " '"+'#sqlqueryresults' + "'", null, function() {
|
||||
// because under db_search, window.parent.table is not defined yet,
|
||||
// we assign it manually from #table-link
|
||||
window.parent.table = $('#table-link').text().trim();
|
||||
|
||||
appendInlineAnchor();
|
||||
$('#table_results').makegrid();
|
||||
}).show();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -173,7 +180,6 @@ $(document).ready(function() {
|
||||
if (typeof response == 'string') {
|
||||
// found results
|
||||
$("#searchresults").html(response);
|
||||
$("#sqlqueryresults").trigger('appendAnchor');
|
||||
|
||||
$('#togglesearchresultlink')
|
||||
// always start with the Show message
|
||||
|
||||
170
js/functions.js
170
js/functions.js
@ -15,10 +15,9 @@ var sql_box_locked = false;
|
||||
var only_once_elements = new Array();
|
||||
|
||||
/**
|
||||
* @var ajax_message_init boolean boolean that stores status of
|
||||
* notification for PMA_ajaxShowNotification
|
||||
* @var int ajax_message_count Number of AJAX messages shown since page load
|
||||
*/
|
||||
var ajax_message_init = false;
|
||||
var ajax_message_count = 0;
|
||||
|
||||
/**
|
||||
* @var codemirror_editor object containing CodeMirror editor
|
||||
@ -31,7 +30,6 @@ var codemirror_editor = false;
|
||||
var chart_activeTimeouts = new Object();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add a hidden field to the form to indicate that this will be an
|
||||
* Ajax request (only if this hidden field does not exist)
|
||||
@ -659,10 +657,10 @@ $(document).ready(function() {
|
||||
* so that it works also for pages reached via AJAX)
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$('tr.odd, tr.even').live('hover',function() {
|
||||
$('tr.odd, tr.even').live('hover',function(event) {
|
||||
var $tr = $(this);
|
||||
$tr.toggleClass('hover');
|
||||
$tr.children().toggleClass('hover');
|
||||
$tr.toggleClass('hover',event.type=='mouseover');
|
||||
$tr.children().toggleClass('hover',event.type=='mouseover');
|
||||
});
|
||||
})
|
||||
|
||||
@ -1151,7 +1149,7 @@ function changeMIMEType(db, table, reference, mime_type)
|
||||
* Jquery Coding for inline editing SQL_QUERY
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
$(".inline_edit_sql").click( function(){
|
||||
$(".inline_edit_sql").live('click', function(){
|
||||
var db = $(this).prev().find("input[name='db']").val();
|
||||
var table = $(this).prev().find("input[name='table']").val();
|
||||
var token = $(this).prev().find("input[name='token']").val();
|
||||
@ -1166,7 +1164,12 @@ $(document).ready(function(){
|
||||
$(".btnSave").each(function(){
|
||||
$(this).click(function(){
|
||||
sql_query = $(this).prev().val();
|
||||
window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + sql_query + "&show_query=1&token=" + token);
|
||||
window.location.replace("import.php"
|
||||
+ "?db=" + encodeURIComponent(db)
|
||||
+ "&table=" + encodeURIComponent(table)
|
||||
+ "&sql_query=" + encodeURIComponent(sql_query)
|
||||
+ "&show_query=1"
|
||||
+ "&token=" + token);
|
||||
});
|
||||
});
|
||||
$(".btnDiscard").each(function(){
|
||||
@ -1244,83 +1247,64 @@ $(document).ready(function(){
|
||||
* optional, defaults to 'Loading...'
|
||||
* @param var timeout number of milliseconds for the message to be visible
|
||||
* optional, defaults to 5000
|
||||
* @return jQuery object jQuery Element that holds the message div
|
||||
* @return jQuery object jQuery Element that holds the message div
|
||||
*/
|
||||
|
||||
function PMA_ajaxShowMessage(message, timeout) {
|
||||
|
||||
//Handle the case when a empty data.message is passed. We don't want the empty message
|
||||
if(message == '') {
|
||||
//Handle the case when a empty data.message is passed. We don't want the empty message
|
||||
if (message == '') {
|
||||
return true;
|
||||
} else if (! message) {
|
||||
// If the message is undefined, show the default
|
||||
message = PMA_messages['strLoading'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @var msg String containing the message that has to be displayed
|
||||
* @default PMA_messages['strLoading']
|
||||
*/
|
||||
if(!message) {
|
||||
var msg = PMA_messages['strLoading'];
|
||||
}
|
||||
else {
|
||||
var msg = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var timeout Number of milliseconds for which {@link msg} will be visible
|
||||
* @var timeout Number of milliseconds for which the message will be visible
|
||||
* @default 5000 ms
|
||||
*/
|
||||
if(!timeout) {
|
||||
var to = 5000;
|
||||
}
|
||||
else {
|
||||
var to = timeout;
|
||||
if (! timeout) {
|
||||
timeout = 5000;
|
||||
}
|
||||
|
||||
if( !ajax_message_init) {
|
||||
//For the first time this function is called, append a new div
|
||||
$(function(){
|
||||
$('<div id="loading_parent"></div>')
|
||||
.insertBefore("#serverinfo");
|
||||
|
||||
$('<span id="loading" class="ajax_notification"></span>')
|
||||
.appendTo("#loading_parent")
|
||||
.html(msg)
|
||||
.fadeIn('medium')
|
||||
.delay(to)
|
||||
.fadeOut('medium', function(){
|
||||
$(this)
|
||||
.html("") //Clear the message
|
||||
.hide();
|
||||
});
|
||||
}, 'top.frame_content');
|
||||
ajax_message_init = true;
|
||||
// Create a parent element for the AJAX messages, if necessary
|
||||
if ($('#loading_parent').length == 0) {
|
||||
$('<div id="loading_parent"></div>')
|
||||
.insertBefore("#serverinfo");
|
||||
}
|
||||
else {
|
||||
//Otherwise, just show the div again after inserting the message
|
||||
$("#loading")
|
||||
.stop(true, true)
|
||||
.html(msg)
|
||||
|
||||
// Update message count to create distinct message elements every time
|
||||
ajax_message_count++;
|
||||
|
||||
// Remove all old messages, if any
|
||||
$(".ajax_notification[id^=ajax_message_num]").remove();
|
||||
|
||||
/**
|
||||
* @var $retval a jQuery object containing the reference
|
||||
* to the created AJAX message
|
||||
*/
|
||||
var $retval = $('<span class="ajax_notification" id="ajax_message_num_' + ajax_message_count + '"></span>')
|
||||
.hide()
|
||||
.appendTo("#loading_parent")
|
||||
.html(message)
|
||||
.fadeIn('medium')
|
||||
.delay(to)
|
||||
.delay(timeout)
|
||||
.fadeOut('medium', function() {
|
||||
$(this)
|
||||
.html("")
|
||||
.hide();
|
||||
})
|
||||
}
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
return $("#loading");
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the message shown for an Ajax operation when it's completed
|
||||
*/
|
||||
function PMA_ajaxRemoveMessage($this_msgbox) {
|
||||
$this_msgbox
|
||||
.stop(true, true)
|
||||
.fadeOut('medium', function() {
|
||||
$this_msgbox.hide();
|
||||
});
|
||||
if ($this_msgbox != 'undefined' && $this_msgbox instanceof jQuery) {
|
||||
$this_msgbox
|
||||
.stop(true, true)
|
||||
.fadeOut('medium');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1411,31 +1395,41 @@ function PMA_createChart(passedSettings) {
|
||||
events: {
|
||||
load: function() {
|
||||
var thisChart = this;
|
||||
var lastValue=null, curValue=null;
|
||||
var numLoadedPoints=0, otherSum=0;
|
||||
var lastValue = null, curValue = null;
|
||||
var numLoadedPoints = 0, otherSum = 0;
|
||||
var diff;
|
||||
// No realtime updates for graphs that are being exported, and disabled when no callback is set
|
||||
if(thisChart.options.chart.forExport==true || !passedSettings.realtime || !passedSettings.realtime.callback) return;
|
||||
if(thisChart.options.chart.forExport == true ||
|
||||
! passedSettings.realtime ||
|
||||
! passedSettings.realtime.callback) return;
|
||||
|
||||
thisChart.options.realtime.timeoutCallBack = function() {
|
||||
$.get(passedSettings.realtime.url,{ajax_request:1, chart_data:1, type:passedSettings.realtime.type},function(data) {
|
||||
curValue = jQuery.parseJSON(data);
|
||||
//if(lastValue==null) lastValue = curValue;
|
||||
|
||||
if(lastValue==null) diff = curValue.x - thisChart.xAxis[0].getExtremes().max;
|
||||
else diff = parseInt(curValue.x - lastValue.x);
|
||||
|
||||
thisChart.xAxis[0].setExtremes(thisChart.xAxis[0].getExtremes().min+diff, thisChart.xAxis[0].getExtremes().max+diff, false);
|
||||
|
||||
passedSettings.realtime.callback(thisChart,curValue,lastValue,numLoadedPoints);
|
||||
|
||||
lastValue = curValue;
|
||||
numLoadedPoints++;
|
||||
|
||||
// Timeout has been cleared => don't start a new timeout
|
||||
if(chart_activeTimeouts[container]==null) return;
|
||||
chart_activeTimeouts[container] = setTimeout(thisChart.options.realtime.timeoutCallBack, thisChart.options.realtime.refreshRate);
|
||||
|
||||
$.post(passedSettings.realtime.url,
|
||||
{ ajax_request: true, chart_data: 1, type: passedSettings.realtime.type },
|
||||
function(data) {
|
||||
curValue = jQuery.parseJSON(data);
|
||||
|
||||
if(lastValue==null) diff = curValue.x - thisChart.xAxis[0].getExtremes().max;
|
||||
else diff = parseInt(curValue.x - lastValue.x);
|
||||
|
||||
thisChart.xAxis[0].setExtremes(
|
||||
thisChart.xAxis[0].getExtremes().min+diff,
|
||||
thisChart.xAxis[0].getExtremes().max+diff,
|
||||
false
|
||||
);
|
||||
|
||||
passedSettings.realtime.callback(thisChart,curValue,lastValue,numLoadedPoints);
|
||||
|
||||
lastValue = curValue;
|
||||
numLoadedPoints++;
|
||||
|
||||
// Timeout has been cleared => don't start a new timeout
|
||||
if(chart_activeTimeouts[container]==null) return;
|
||||
|
||||
chart_activeTimeouts[container] = setTimeout(
|
||||
thisChart.options.realtime.timeoutCallBack,
|
||||
thisChart.options.realtime.refreshRate
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@ -1469,8 +1463,8 @@ function PMA_createChart(passedSettings) {
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
return '<b>'+ this.series.name +'</b><br/>'+
|
||||
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) +'<br/>'+
|
||||
return '<b>' + this.series.name +'</b><br/>' +
|
||||
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
|
||||
Highcharts.numberFormat(this.y, 2);
|
||||
}
|
||||
},
|
||||
|
||||
@ -308,12 +308,9 @@ extend(Chart.prototype, {
|
||||
chart = this,
|
||||
canvas=createElement('canvas');
|
||||
|
||||
if (typeof FlashCanvas != "undefined") {
|
||||
FlashCanvas.initElement(canvas);
|
||||
}
|
||||
|
||||
$('body').append(canvas);
|
||||
$(canvas).hide();
|
||||
$(canvas).css('position','absolute');
|
||||
$(canvas).css('left','-10000px');
|
||||
|
||||
var submitData = function(chartData) {
|
||||
// merge the options
|
||||
@ -352,11 +349,19 @@ extend(Chart.prototype, {
|
||||
if(options && options.type=='image/svg+xml') {
|
||||
submitData(chart.getSVG(chartOptions));
|
||||
} else {
|
||||
if (typeof FlashCanvas != "undefined") {
|
||||
FlashCanvas.initElement(canvas);
|
||||
}
|
||||
|
||||
// Generate data uri and submit once done
|
||||
canvg(canvas, chart.getSVG(chartOptions),{
|
||||
ignoreAnimation:true,
|
||||
ignoreMouse:true,
|
||||
renderCallback:function() { submitData(canvas.toDataURL()); }
|
||||
renderCallback:function() {
|
||||
// IE8 fix: flashcanvas doesn't update the canvas immediately, thus requiring setTimeout.
|
||||
// See also http://groups.google.com/group/flashcanvas/browse_thread/thread/e36ff7a03e1bfb0a
|
||||
setTimeout(function() { submitData(canvas.toDataURL()); }, 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
617
js/makegrid.js
Normal file
617
js/makegrid.js
Normal file
@ -0,0 +1,617 @@
|
||||
(function ($) {
|
||||
$.grid = function(t) {
|
||||
// prepare the grid
|
||||
var g = {
|
||||
// constant
|
||||
minColWidth: 5,
|
||||
|
||||
// variables, assigned with default value, changed later
|
||||
alignment: 'horizontal', // 3 possibilities: vertical, horizontal, horizontalflipped
|
||||
actionSpan: 5,
|
||||
colOrder: new Array(), // array of column order
|
||||
tableCreateTime: null, // table creation time, only available in "Browse tab"
|
||||
hintShown: false, // true if hint balloon is shown, used by updateHint() method
|
||||
reorderHint: '', // string, hint for column reordering
|
||||
sortHint: '', // string, hint for column sorting
|
||||
markHint: '', // string, hint for column marking
|
||||
showReorderHint: false, // boolean, used by showHint() method
|
||||
showSortHint: false, // boolean, used by showHint() method
|
||||
showMarkHint: false,
|
||||
hintIsHiding: false, // true when hint is still shown, but hide() already called
|
||||
|
||||
// functions
|
||||
dragStartRsz: function(e, obj) { // start column resize
|
||||
var n = $(this.cRsz).find('div').index(obj);
|
||||
this.colRsz = {
|
||||
x0: e.pageX,
|
||||
n: n,
|
||||
obj: obj,
|
||||
objLeft: $(obj).position().left,
|
||||
objWidth: this.alignment != 'vertical' ?
|
||||
$(this.t).find('th.draggable:eq(' + n + ') span').outerWidth() :
|
||||
$(this.t).find('tr:first td:eq(' + n + ') span').outerWidth()
|
||||
};
|
||||
$('body').css('cursor', 'col-resize');
|
||||
$('body').noSelect();
|
||||
},
|
||||
|
||||
dragStartMove: function(e, obj) { // start column move
|
||||
// prepare the cCpy and cPointer from the dragged column
|
||||
$(this.cCpy).text($(obj).text());
|
||||
var objPos = $(obj).position();
|
||||
if (this.alignment != 'vertical') {
|
||||
$(this.cCpy).css({
|
||||
top: objPos.top + 20,
|
||||
left: objPos.left,
|
||||
height: $(obj).height(),
|
||||
width: $(obj).width()
|
||||
});
|
||||
$(this.cPointer).css({
|
||||
top: objPos.top
|
||||
});
|
||||
} else { // vertical alignment
|
||||
$(this.cCpy).css({
|
||||
top: objPos.top,
|
||||
left: objPos.left + 30,
|
||||
height: $(obj).height(),
|
||||
width: $(obj).width()
|
||||
});
|
||||
$(this.cPointer).css({
|
||||
top: objPos.top
|
||||
});
|
||||
}
|
||||
|
||||
// get the column index, zero-based
|
||||
var n = this.getHeaderIdx(obj);
|
||||
|
||||
this.colMov = {
|
||||
x0: e.pageX,
|
||||
y0: e.pageY,
|
||||
n: n,
|
||||
newn: n,
|
||||
obj: obj,
|
||||
objTop: objPos.top,
|
||||
objLeft: objPos.left
|
||||
};
|
||||
$('body').css('cursor', 'move');
|
||||
this.hideHint();
|
||||
$('body').noSelect();
|
||||
},
|
||||
|
||||
dragMove: function(e) {
|
||||
if (this.colRsz) {
|
||||
var dx = e.pageX - this.colRsz.x0;
|
||||
if (this.colRsz.objWidth + dx > this.minColWidth)
|
||||
$(this.colRsz.obj).css('left', this.colRsz.objLeft + dx + 'px');
|
||||
} else if (this.colMov) {
|
||||
// dragged column animation
|
||||
if (this.alignment != 'vertical') {
|
||||
var dx = e.pageX - this.colMov.x0;
|
||||
$(this.cCpy)
|
||||
.css('left', this.colMov.objLeft + dx)
|
||||
.show();
|
||||
} else { // vertical alignment
|
||||
var dy = e.pageY - this.colMov.y0;
|
||||
$(this.cCpy)
|
||||
.css('top', this.colMov.objTop + dy)
|
||||
.show();
|
||||
}
|
||||
|
||||
// pointer animation
|
||||
var hoveredCol = this.getHoveredCol(e);
|
||||
if (hoveredCol) {
|
||||
var newn = this.getHeaderIdx(hoveredCol);
|
||||
this.colMov.newn = newn;
|
||||
if (newn != this.colMov.n) {
|
||||
// show the column pointer in the right place
|
||||
var colPos = $(hoveredCol).position();
|
||||
if (this.alignment != 'vertical') {
|
||||
var newleft = newn < this.colMov.n ?
|
||||
colPos.left :
|
||||
colPos.left + $(hoveredCol).outerWidth();
|
||||
$(this.cPointer)
|
||||
.css({
|
||||
left: newleft,
|
||||
visibility: 'visible'
|
||||
});
|
||||
} else { // vertical alignment
|
||||
var newtop = newn < this.colMov.n ?
|
||||
colPos.top :
|
||||
colPos.top + $(hoveredCol).outerHeight();
|
||||
$(this.cPointer)
|
||||
.css({
|
||||
top: newtop,
|
||||
visibility: 'visible'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// no movement to other column, hide the column pointer
|
||||
$(this.cPointer).css('visibility', 'hidden');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
dragEnd: function(e) {
|
||||
if (this.colRsz) {
|
||||
var dx = e.pageX - this.colRsz.x0;
|
||||
var nw = this.colRsz.objWidth + dx;
|
||||
if (nw < this.minColWidth) {
|
||||
nw = this.minColWidth;
|
||||
}
|
||||
var n = this.colRsz.n;
|
||||
// do the resizing
|
||||
if (this.alignment != 'vertical') {
|
||||
$(this.t).find('tr').each(function() {
|
||||
$(this).find('th.draggable:eq(' + n + ') span,' +
|
||||
'td:eq(' + (g.actionSpan + n) + ') span')
|
||||
.css('width', nw);
|
||||
});
|
||||
} else { // vertical alignment
|
||||
$(this.t).find('tr').each(function() {
|
||||
$(this).find('td:eq(' + n + ') span')
|
||||
.css('width', nw);
|
||||
});
|
||||
}
|
||||
$('body').css('cursor', 'default');
|
||||
this.reposRsz();
|
||||
this.colRsz = false;
|
||||
} else if (this.colMov) {
|
||||
// shift columns
|
||||
if (this.colMov.newn != this.colMov.n) {
|
||||
this.shiftCol(this.colMov.n, this.colMov.newn);
|
||||
// assign new position
|
||||
var objPos = $(this.colMov.obj).position();
|
||||
this.colMov.objTop = objPos.top;
|
||||
this.colMov.objLeft = objPos.left;
|
||||
this.colMov.n = this.colMov.newn;
|
||||
// send request to server to remember the column order
|
||||
if (this.tableCreateTime) {
|
||||
this.sendColOrder();
|
||||
}
|
||||
this.refreshRestoreButton();
|
||||
}
|
||||
|
||||
// animate new column position
|
||||
$(this.cCpy).stop(true, true)
|
||||
.animate({
|
||||
top: g.colMov.objTop,
|
||||
left: g.colMov.objLeft
|
||||
}, 'fast')
|
||||
.fadeOut();
|
||||
$(this.cPointer).css('visibility', 'hidden');
|
||||
|
||||
this.colMov = false;
|
||||
}
|
||||
$('body').css('cursor', 'default');
|
||||
$('body').noSelect(false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Reposition column resize bars.
|
||||
*/
|
||||
reposRsz: function() {
|
||||
$(this.cRsz).find('div').hide();
|
||||
$firstRowCols = this.alignment != 'vertical' ?
|
||||
$(this.t).find('tr:first th.draggable') :
|
||||
$(this.t).find('tr:first td');
|
||||
for (var n = 0; n < $firstRowCols.length; n++) {
|
||||
$this = $($firstRowCols[n]);
|
||||
$cb = $(g.cRsz).find('div:eq(' + n + ')'); // column border
|
||||
var pad = parseInt($this.css('padding-right'));
|
||||
$cb.css('left', Math.floor($this.position().left + $this.width() + pad))
|
||||
.show();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Shift column from index oldn to newn.
|
||||
*/
|
||||
shiftCol: function(oldn, newn) {
|
||||
if (this.alignment != 'vertical') {
|
||||
$(this.t).find('tr').each(function() {
|
||||
if (newn < oldn) {
|
||||
$(this).find('th.draggable:eq(' + newn + '),' +
|
||||
'td:eq(' + (g.actionSpan + newn) + ')')
|
||||
.before($(this).find('th.draggable:eq(' + oldn + '),' +
|
||||
'td:eq(' + (g.actionSpan + oldn) + ')'));
|
||||
} else {
|
||||
$(this).find('th.draggable:eq(' + newn + '),' +
|
||||
'td:eq(' + (g.actionSpan + newn) + ')')
|
||||
.after($(this).find('th.draggable:eq(' + oldn + '),' +
|
||||
'td:eq(' + (g.actionSpan + oldn) + ')'));
|
||||
}
|
||||
});
|
||||
// reposition the column resize bars
|
||||
this.reposRsz();
|
||||
|
||||
} else { // vertical alignment
|
||||
// shift rows
|
||||
if (newn < oldn) {
|
||||
$(this.t).find('tr:eq(' + (g.actionSpan + newn) + ')')
|
||||
.before($(this.t).find('tr:eq(' + (g.actionSpan + oldn) + ')'));
|
||||
} else {
|
||||
$(this.t).find('tr:eq(' + (g.actionSpan + newn) + ')')
|
||||
.after($(this.t).find('tr:eq(' + (g.actionSpan + oldn) + ')'));
|
||||
}
|
||||
}
|
||||
// adjust the colOrder
|
||||
var tmp = this.colOrder[oldn];
|
||||
this.colOrder.splice(oldn, 1);
|
||||
this.colOrder.splice(newn, 0, tmp);
|
||||
},
|
||||
|
||||
/**
|
||||
* Find currently hovered table column's header (excluding actions column).
|
||||
* @return the hovered column's th object or undefined if no hovered column found.
|
||||
*/
|
||||
getHoveredCol: function(e) {
|
||||
var hoveredCol;
|
||||
$headers = $(this.t).find('th.draggable');
|
||||
if (this.alignment != 'vertical') {
|
||||
$headers.each(function() {
|
||||
var left = $(this).position().left;
|
||||
var right = left + $(this).outerWidth();
|
||||
if (left <= e.pageX && e.pageX <= right) {
|
||||
hoveredCol = this;
|
||||
}
|
||||
});
|
||||
} else { // vertical alignment
|
||||
$headers.each(function() {
|
||||
var top = $(this).position().top;
|
||||
var bottom = top + $(this).height();
|
||||
if (top <= e.pageY && e.pageY <= bottom) {
|
||||
hoveredCol = this;
|
||||
}
|
||||
});
|
||||
}
|
||||
return hoveredCol;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get a zero-based index from a <th class="draggable"> tag in a table.
|
||||
*/
|
||||
getHeaderIdx: function(obj) {
|
||||
var n;
|
||||
if (this.alignment != 'vertical') {
|
||||
n = $(obj).parents('tr').find('th.draggable').index(obj);
|
||||
} else {
|
||||
var column_idx = $(obj).index();
|
||||
var $th_in_same_column = $(this.t).find('th.draggable:nth-child(' + (column_idx + 1) + ')');
|
||||
n = $th_in_same_column.index(obj);
|
||||
}
|
||||
return n;
|
||||
},
|
||||
|
||||
/**
|
||||
* Reposition the table back to normal order.
|
||||
*/
|
||||
restore: function() {
|
||||
// use insertion sort, since we already have shiftCol function
|
||||
for (var i = 1; i < this.colOrder.length; i++) {
|
||||
var x = this.colOrder[i];
|
||||
var j = i - 1;
|
||||
while (j >= 0 && x < this.colOrder[j]) {
|
||||
j--;
|
||||
}
|
||||
if (j != i - 1) {
|
||||
this.shiftCol(i, j + 1);
|
||||
}
|
||||
}
|
||||
if (this.tableCreateTime) {
|
||||
// send request to server to remember the column order
|
||||
this.sendColOrder();
|
||||
}
|
||||
this.refreshRestoreButton();
|
||||
},
|
||||
|
||||
/**
|
||||
* Send column order to the server.
|
||||
*/
|
||||
sendColOrder: function() {
|
||||
$.post('sql.php', {
|
||||
ajax_request: true,
|
||||
db: window.parent.db,
|
||||
table: window.parent.table,
|
||||
token: window.parent.token,
|
||||
set_col_order: true,
|
||||
col_order: this.colOrder.toString(),
|
||||
table_create_time: this.tableCreateTime
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Refresh restore button state.
|
||||
* Make restore button disabled if the table is similar with initial state.
|
||||
*/
|
||||
refreshRestoreButton: function() {
|
||||
// check if table state is as initial state
|
||||
var isInitial = true;
|
||||
for (var i = 0; i < this.colOrder.length; i++) {
|
||||
if (this.colOrder[i] != i) {
|
||||
isInitial = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// enable or disable restore button
|
||||
if (isInitial) {
|
||||
$('.restore_column').hide();
|
||||
} else {
|
||||
$('.restore_column').show();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Show hint with the text supplied.
|
||||
*/
|
||||
showHint: function(e) {
|
||||
if (!this.colRsz && !this.colMov) { // if not resizing or dragging
|
||||
var text = '';
|
||||
if (this.showReorderHint) {
|
||||
text += this.reorderHint;
|
||||
}
|
||||
if (this.showSortHint) {
|
||||
text += text.length > 0 ? '<br />' : '';
|
||||
text += this.sortHint;
|
||||
}
|
||||
if (this.showMarkHint) {
|
||||
text += text.length > 0 ? '<br />' : '';
|
||||
text += this.markHint;
|
||||
}
|
||||
|
||||
// hide the hint if no text
|
||||
if (!text) {
|
||||
this.hideHint();
|
||||
return;
|
||||
}
|
||||
|
||||
$(this.dHint).html(text);
|
||||
if (!this.hintShown || this.hintIsHiding) {
|
||||
$(this.dHint)
|
||||
.stop(true, true)
|
||||
.css({
|
||||
top: e.pageY,
|
||||
left: e.pageX + 15
|
||||
})
|
||||
.show('fast');
|
||||
this.hintShown = true;
|
||||
this.hintIsHiding = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Hide the hint.
|
||||
*/
|
||||
hideHint: function() {
|
||||
if (this.hintShown) {
|
||||
$(this.dHint)
|
||||
.stop(true, true)
|
||||
.hide(300, function() {
|
||||
g.hintShown = false;
|
||||
g.hintIsHiding = false;
|
||||
});
|
||||
this.hintIsHiding = true;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Update hint position.
|
||||
*/
|
||||
updateHint: function(e) {
|
||||
if (this.hintShown) {
|
||||
$(this.dHint).css({
|
||||
top: e.pageY,
|
||||
left: e.pageX + 15
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g.gDiv = document.createElement('div'); // create global div
|
||||
g.cRsz = document.createElement('div'); // column resizer
|
||||
g.cCpy = document.createElement('div'); // column copy, to store copy of dragged column header
|
||||
g.cPointer = document.createElement('div'); // column pointer, used when reordering column
|
||||
g.dHint = document.createElement('div'); // draggable hint
|
||||
|
||||
// assign the table alignment
|
||||
g.alignment = $("#top_direction_dropdown").val();
|
||||
|
||||
// adjust g.cCpy
|
||||
g.cCpy.className = 'cCpy';
|
||||
$(g.cCpy).hide();
|
||||
|
||||
// adjust g.cPoint
|
||||
g.cPointer.className = g.alignment != 'vertical' ? 'cPointer' : 'cPointerVer';
|
||||
$(g.cPointer).css('visibility', 'hidden');
|
||||
|
||||
// adjust g.dHint
|
||||
g.dHint.className = 'dHint';
|
||||
$(g.dHint).hide();
|
||||
|
||||
// chain table and grid together
|
||||
t.grid = g;
|
||||
g.t = t;
|
||||
|
||||
// get first row data columns
|
||||
var $firstRowCols = g.alignment != 'vertical' ?
|
||||
$(t).find('tr:first th.draggable') :
|
||||
$(t).find('tr:first td');
|
||||
|
||||
// assign first column (actions) span
|
||||
if (! $(t).find('tr:first th:first').hasClass('draggable')) { // action header exist
|
||||
g.actionSpan = g.alignment != 'vertical' ?
|
||||
$(t).find('tr:first th:first').prop('colspan') :
|
||||
$(t).find('tr:first th:first').prop('rowspan');
|
||||
} else {
|
||||
g.actionSpan = 0;
|
||||
}
|
||||
|
||||
// assign table create time
|
||||
// #table_create_time will only available if we are in "Browse" tab
|
||||
g.tableCreateTime = $('#table_create_time').val();
|
||||
|
||||
// assign column reorder & column sort hint
|
||||
g.reorderHint = $('#col_order_hint').val();
|
||||
g.sortHint = $('#sort_hint').val();
|
||||
g.markHint = $('#col_mark_hint').val();
|
||||
|
||||
// determine whether to show the column reordering hint or not
|
||||
g.showReorderHint = $firstRowCols.length > 1;
|
||||
|
||||
// initialize column order
|
||||
$col_order = $('#col_order');
|
||||
if ($col_order.length > 0) {
|
||||
g.colOrder = $col_order.val().split(',');
|
||||
for (var i = 0; i < g.colOrder.length; i++) {
|
||||
g.colOrder[i] = parseInt(g.colOrder[i]);
|
||||
}
|
||||
} else {
|
||||
g.colOrder = new Array();
|
||||
for (var i = 0; i < $firstRowCols.length; i++) {
|
||||
g.colOrder.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
// create column borders
|
||||
$firstRowCols.each(function() {
|
||||
$this = $(this);
|
||||
var cb = document.createElement('div'); // column border
|
||||
var pad = parseInt($this.css('padding-right'));
|
||||
$(cb).css('left', Math.floor($this.position().left + $this.width() + pad));
|
||||
$(cb).addClass('colborder');
|
||||
$(cb).mousedown(function(e) {
|
||||
g.dragStartRsz(e, this);
|
||||
});
|
||||
$(g.cRsz).append(cb);
|
||||
});
|
||||
|
||||
// wrap all data cells, except actions cell, with span
|
||||
$(t).find('th, td:not(:has(span))')
|
||||
.wrapInner('<span />');
|
||||
|
||||
// register events
|
||||
if ($firstRowCols.length > 1) {
|
||||
$(t).find('th.draggable')
|
||||
.css('cursor', 'move')
|
||||
.mousedown(function(e) {
|
||||
g.dragStartMove(e, this);
|
||||
});
|
||||
}
|
||||
$(t).find('th.draggable')
|
||||
.mouseenter(function(e) {
|
||||
g.showMarkHint = !g.showSortHint;
|
||||
g.showHint(e);
|
||||
})
|
||||
.mouseleave(function(e) {
|
||||
g.hideHint();
|
||||
});
|
||||
$(t).find('th.draggable a')
|
||||
.attr('title', '') // hide default tooltip for sorting
|
||||
.mouseenter(function(e) {
|
||||
g.showSortHint = true;
|
||||
g.showMarkHint = false;
|
||||
g.showHint(e);
|
||||
})
|
||||
.mouseleave(function(e) {
|
||||
g.showSortHint = false;
|
||||
g.showMarkHint = true;
|
||||
g.showHint(e);
|
||||
});
|
||||
$(document).mousemove(function(e) {
|
||||
g.dragMove(e);
|
||||
g.updateHint(e);
|
||||
});
|
||||
$(document).mouseup(function(e) {
|
||||
g.dragEnd(e);
|
||||
});
|
||||
$('.restore_column').click(function() {
|
||||
g.restore();
|
||||
});
|
||||
|
||||
// add table class
|
||||
$(t).addClass('pma_table');
|
||||
|
||||
// link all divs
|
||||
$(t).before(g.gDiv);
|
||||
$(g.gDiv).append(t);
|
||||
$(g.gDiv).prepend(g.cRsz);
|
||||
$(g.gDiv).append(g.cCpy);
|
||||
$(g.gDiv).append(g.cPointer);
|
||||
$(g.gDiv).append(g.dHint);
|
||||
|
||||
// some adjustment
|
||||
g.refreshRestoreButton();
|
||||
g.cRsz.className = 'cRsz';
|
||||
$(t).removeClass('data');
|
||||
$(g.gDiv).addClass('data');
|
||||
$(g.cRsz).css('height', $(t).height());
|
||||
$(t).find('th a').bind('dragstart', function() {
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
// document ready checking
|
||||
var docready = false;
|
||||
$(document).ready(function() {
|
||||
docready = true;
|
||||
});
|
||||
|
||||
// Additional jQuery functions
|
||||
/**
|
||||
* Make resizable, reorderable grid.
|
||||
*/
|
||||
$.fn.makegrid = function() {
|
||||
return this.each(function() {
|
||||
if (!docready) {
|
||||
var t = this;
|
||||
$(document).ready(function() {
|
||||
$.grid(t);
|
||||
});
|
||||
} else {
|
||||
$.grid(this);
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Refresh grid. This must be called after changing the grid's content.
|
||||
*/
|
||||
$.fn.refreshgrid = function() {
|
||||
return this.each(function() {
|
||||
if (!docready) {
|
||||
var t = this;
|
||||
$(document).ready(function() {
|
||||
if (t.grid) t.grid.reposRsz();
|
||||
});
|
||||
} else {
|
||||
if (this.grid) this.grid.reposRsz();
|
||||
}
|
||||
});
|
||||
}
|
||||
$.fn.noSelect = function (p) { //no select plugin by Paulo P.Marinas
|
||||
var prevent = (p == null) ? true : p;
|
||||
if (prevent) {
|
||||
return this.each(function () {
|
||||
if ($.browser.msie || $.browser.safari) $(this).bind('selectstart', function () {
|
||||
return false;
|
||||
});
|
||||
else if ($.browser.mozilla) {
|
||||
$(this).css('MozUserSelect', 'none');
|
||||
$('body').trigger('focus');
|
||||
} else if ($.browser.opera) $(this).bind('mousedown', function () {
|
||||
return false;
|
||||
});
|
||||
else $(this).attr('unselectable', 'on');
|
||||
});
|
||||
} else {
|
||||
return this.each(function () {
|
||||
if ($.browser.msie || $.browser.safari) $(this).unbind('selectstart');
|
||||
else if ($.browser.mozilla) $(this).css('MozUserSelect', 'inherit');
|
||||
else if ($.browser.opera) $(this).unbind('mousedown');
|
||||
else $(this).removeAttr('unselectable', 'on');
|
||||
});
|
||||
}
|
||||
}; //end noSelect
|
||||
|
||||
})(jQuery);
|
||||
|
||||
@ -61,6 +61,8 @@ $js_messages['strRemovingSelectedUsers'] = __('Removing Selected Users');
|
||||
$js_messages['strClose'] = __('Close');
|
||||
|
||||
/* for server_status.js */
|
||||
$js_messages['strEdit'] = __('Edit');
|
||||
|
||||
$js_messages['strLiveTrafficChart'] = __('Live traffic chart');
|
||||
$js_messages['strLiveConnChart'] = __('Live conn./process chart');
|
||||
$js_messages['strLiveQueryChart'] = __('Live query chart');
|
||||
@ -75,6 +77,17 @@ $js_messages['strThousandsSeperator'] = __(',');
|
||||
/* l10n: Decimal separator */
|
||||
$js_messages['strDecimalSeperator'] = __('.');
|
||||
|
||||
$js_messages['strChartKBSent'] = __('KiB sent since last refresh');
|
||||
$js_messages['strChartKBReceived'] = __('KiB received since last refresh');
|
||||
$js_messages['strChartServerTraffic'] = __('Server traffic (in KiB)');
|
||||
$js_messages['strChartConnections'] = __('Connections since last refresh');
|
||||
$js_messages['strChartProcesses'] = __('Processes');
|
||||
$js_messages['strChartConnectionsTitle'] = __('Connections / Processes');
|
||||
$js_messages['strChartIssuedQueries'] = __('Issued queries since last refresh');
|
||||
$js_messages['strChartIssuedQueriesTitle'] = __('Issued queries');
|
||||
|
||||
$js_messages['strChartQueryPie'] = __('Query statistics');
|
||||
|
||||
/* For inline query editing */
|
||||
$js_messages['strGo'] = __('Go');
|
||||
$js_messages['strCancel'] = __('Cancel');
|
||||
|
||||
@ -21,9 +21,13 @@ $(function() {
|
||||
return /^[0-9]?[0-9,\.]*\s?(k|M|G|T|%)?$/.test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
var num = jQuery.tablesorter.formatFloat( s.replace(PMA_messages['strThousandsSeperator'],'').replace(PMA_messages['strDecimalSeperator'],'.') );
|
||||
var num = jQuery.tablesorter.formatFloat(
|
||||
s.replace(PMA_messages['strThousandsSeperator'],'')
|
||||
.replace(PMA_messages['strDecimalSeperator'],'.')
|
||||
);
|
||||
|
||||
var factor = 1;
|
||||
switch (s.charAt(s.length-1)) {
|
||||
switch (s.charAt(s.length - 1)) {
|
||||
case '%': factor = -2; break;
|
||||
// Todo: Complete this list (as well as in the regexp a few lines up)
|
||||
case 'k': factor = 3; break;
|
||||
@ -31,7 +35,8 @@ $(function() {
|
||||
case 'G': factor = 9; break;
|
||||
case 'T': factor = 12; break;
|
||||
}
|
||||
return num*Math.pow(10,factor);
|
||||
|
||||
return num * Math.pow(10,factor);
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
@ -45,12 +50,16 @@ $(function() {
|
||||
var odd_row=false;
|
||||
var text=''; // Holds filter text
|
||||
var queryPieChart = null;
|
||||
/* Chart configuration */
|
||||
|
||||
/* Chart configuration */
|
||||
// Defines what the tabs are currently displaying (realtime or data)
|
||||
var tabStatus = new Object();
|
||||
// Holds the current chart instances for each tab
|
||||
var tabChart = new Object();
|
||||
|
||||
$.ajaxSetup({
|
||||
cache:false
|
||||
});
|
||||
|
||||
// Add tabs
|
||||
$('#serverStatusTabs').tabs({
|
||||
@ -69,12 +78,23 @@ $(function() {
|
||||
tabStatus[$(this).attr('id')] = 'static';
|
||||
});
|
||||
|
||||
// Handles refresh rate changing
|
||||
$('.statuslinks select').change(function() {
|
||||
var chart=tabChart[$(this).parents('div.ui-tabs-panel').attr('id')];
|
||||
chart.options.realtime.refreshRate = 1000*parseInt(this.value);
|
||||
chart.xAxis[0].setExtremes(new Date().getTime() - chart.options.realtime.numMaxPoints * chart.options.realtime.refreshRate, chart.xAxis[0].getExtremes().max, true);
|
||||
|
||||
chart.xAxis[0].setExtremes(
|
||||
new Date().getTime() - chart.options.realtime.numMaxPoints * chart.options.realtime.refreshRate,
|
||||
chart.xAxis[0].getExtremes().max,
|
||||
true
|
||||
);
|
||||
|
||||
// Clear current timeout and set timeout with the new refresh rate
|
||||
clearTimeout(chart_activeTimeouts[chart.options.chart.renderTo]);
|
||||
chart_activeTimeouts[chart.options.chart.renderTo] = setTimeout(chart.options.realtime.timeoutCallBack, chart.options.realtime.refreshRate);
|
||||
chart_activeTimeouts[chart.options.chart.renderTo] = setTimeout(
|
||||
chart.options.realtime.timeoutCallBack,
|
||||
chart.options.realtime.refreshRate
|
||||
);
|
||||
});
|
||||
|
||||
// Ajax refresh of variables (always the first element in each tab)
|
||||
@ -107,26 +127,32 @@ $(function() {
|
||||
|
||||
if(tabstat=='static' || tabstat=='liveconnections') {
|
||||
var settings = {
|
||||
series: [{name:'kB sent since last refresh',data:[]},{name:'kB received since last refresh',data:[]}],
|
||||
title: {text:'Server traffic (in kB)'},
|
||||
realtime:{ url:'server_status.php?'+url_query,
|
||||
series: [
|
||||
{ name: PMA_messages['strChartKBSent'], data: [] },
|
||||
{ name: PMA_messages['strChartKBReceived'], data: [] }
|
||||
],
|
||||
title: { text: PMA_messages['strChartServerTraffic'] },
|
||||
realtime: { url:'server_status.php?' + url_query,
|
||||
type: 'traffic',
|
||||
callback: function(chartObj, curVal, lastVal,numLoadedPoints) {
|
||||
callback: function(chartObj, curVal, lastVal, numLoadedPoints) {
|
||||
if(lastVal==null) return;
|
||||
chartObj.series[0].addPoint(
|
||||
{ x:curVal.x, y:(curVal.y_sent-lastVal.y_sent)/1024},
|
||||
false, numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
{ x: curVal.x, y: (curVal.y_sent - lastVal.y_sent) / 1024 },
|
||||
false,
|
||||
numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
);
|
||||
chartObj.series[1].addPoint(
|
||||
{ x:curVal.x, y:(curVal.y_received-lastVal.y_received)/1024},
|
||||
true, numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
{ x: curVal.x, y: (curVal.y_received - lastVal.y_received) / 1024 },
|
||||
true,
|
||||
numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setupLiveChart($tab,this,settings);
|
||||
if(tabstat=='liveconnections') $tab.find('.statuslinks a.liveconnectionsLink').html(PMA_messages['strLiveConnChart']);
|
||||
if(tabstat == 'liveconnections')
|
||||
$tab.find('.statuslinks a.liveconnectionsLink').html(PMA_messages['strLiveConnChart']);
|
||||
tabStatus[$tab.attr('id')]='livetraffic';
|
||||
} else {
|
||||
$(this).html(PMA_messages['strLiveTrafficChart']);
|
||||
@ -141,28 +167,34 @@ $(function() {
|
||||
var $tab=$(this).parents('div.ui-tabs-panel');
|
||||
var tabstat = tabStatus[$tab.attr('id')];
|
||||
|
||||
if(tabstat=='static' || tabstat=='livetraffic') {
|
||||
if(tabstat == 'static' || tabstat == 'livetraffic') {
|
||||
var settings = {
|
||||
series: [{name:'Connections since last refresh', data:[]},{name:'Processes', data:[]}],
|
||||
title: {text:'Connections / Processes'},
|
||||
realtime:{ url:'server_status.php?'+url_query,
|
||||
series: [
|
||||
{ name: PMA_messages['strChartConnections'], data: [] },
|
||||
{ name: PMA_messages['strChartProcesses'], data: [] }
|
||||
],
|
||||
title: { text: PMA_messages['strChartConnectionsTitle'] },
|
||||
realtime: { url:'server_status.php?'+url_query,
|
||||
type: 'proc',
|
||||
callback: function(chartObj, curVal, lastVal,numLoadedPoints) {
|
||||
if(lastVal==null) return;
|
||||
chartObj.series[0].addPoint(
|
||||
{ x:curVal.x, y:curVal.y_conn-lastVal.y_conn },
|
||||
false, numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
{ x: curVal.x, y: curVal.y_conn - lastVal.y_conn },
|
||||
false,
|
||||
numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
);
|
||||
chartObj.series[1].addPoint(
|
||||
{ x:curVal.x, y:curVal.y_proc },
|
||||
true, numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
{ x: curVal.x, y: curVal.y_proc },
|
||||
true,
|
||||
numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
setupLiveChart($tab,this,settings);
|
||||
if(tabstat=='livetraffic') $tab.find('.statuslinks a.livetrafficLink').html(PMA_messages['strLiveTrafficChart']);
|
||||
if(tabstat == 'livetraffic')
|
||||
$tab.find('.statuslinks a.livetrafficLink').html(PMA_messages['strLiveTrafficChart']);
|
||||
tabStatus[$tab.attr('id')]='liveconnections';
|
||||
} else {
|
||||
$(this).html(PMA_messages['strLiveConnChart']);
|
||||
@ -172,62 +204,63 @@ $(function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
// Live query charting
|
||||
// Live query statistics
|
||||
$('.statuslinks a.livequeriesLink').click(function() {
|
||||
var $tab=$(this).parents('div.ui-tabs-panel');
|
||||
var settings=null;
|
||||
var $tab = $(this).parents('div.ui-tabs-panel');
|
||||
var settings = null;
|
||||
|
||||
if(tabStatus[$tab.attr('id')]=='static') {
|
||||
if(tabStatus[$tab.attr('id')] == 'static') {
|
||||
settings = {
|
||||
series: [{name:'Issued queries since last refresh', data:[]}],
|
||||
title: {text:'Issued queries'},
|
||||
series: [ { name: PMA_messages['strChartIssuedQueries'], data: [] } ],
|
||||
title: { text: PMA_messages['strChartIssuedQueriesTitle'] },
|
||||
tooltip: { formatter:function() { return this.point.name; } },
|
||||
realtime:{ url:'server_status.php?'+url_query,
|
||||
realtime: { url:'server_status.php?'+url_query,
|
||||
type: 'queries',
|
||||
callback: function(chartObj, curVal, lastVal,numLoadedPoints) {
|
||||
if(lastVal==null) return;
|
||||
if(lastVal == null) return;
|
||||
chartObj.series[0].addPoint(
|
||||
{ x:curVal.x, y:curVal.y-lastVal.y, name:sortedQueriesPointInfo(curVal,lastVal) },
|
||||
true, numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
{ x: curVal.x, y: curVal.y - lastVal.y, name: sortedQueriesPointInfo(curVal,lastVal) },
|
||||
true,
|
||||
numLoadedPoints >= chartObj.options.realtime.numMaxPoints
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
} else {
|
||||
$(this).html(PMA_messages['strLiveQueryChart']);
|
||||
}
|
||||
|
||||
setupLiveChart($tab,this,settings);
|
||||
tabStatus[$tab.attr('id')]='livequeries';
|
||||
tabStatus[$tab.attr('id')] = 'livequeries';
|
||||
return false;
|
||||
});
|
||||
|
||||
function setupLiveChart($tab,link,settings) {
|
||||
if(settings!=null) {
|
||||
if(settings != null) {
|
||||
// Loading a chart with existing chart => remove old chart first
|
||||
if(tabStatus[$tab.attr('id')]!='static') {
|
||||
clearTimeout(chart_activeTimeouts[$tab.attr('id')+"_chart_cnt"]);
|
||||
chart_activeTimeouts[$tab.attr('id')+"_chart_cnt"]=null;
|
||||
if(tabStatus[$tab.attr('id')] != 'static') {
|
||||
clearTimeout(chart_activeTimeouts[$tab.attr('id') + "_chart_cnt"]);
|
||||
chart_activeTimeouts[$tab.attr('id')+"_chart_cnt"] = null;
|
||||
tabChart[$tab.attr('id')].destroy();
|
||||
// Also reset the select list
|
||||
$tab.find('.statuslinks select').get(0).selectedIndex=0;
|
||||
$tab.find('.statuslinks select').get(0).selectedIndex = 0;
|
||||
}
|
||||
|
||||
if(!settings.chart) settings.chart = {};
|
||||
settings.chart.renderTo=$tab.attr('id')+"_chart_cnt";
|
||||
if(! settings.chart) settings.chart = {};
|
||||
settings.chart.renderTo = $tab.attr('id') + "_chart_cnt";
|
||||
|
||||
$tab.find('.tabInnerContent')
|
||||
.hide()
|
||||
.after('<div style="clear:both; min-width:500px; height:400px; padding-bottom:80px;" id="'+$tab.attr('id')+'_chart_cnt"></div>');
|
||||
tabChart[$tab.attr('id')]=PMA_createChart(settings);
|
||||
.after('<div class="liveChart" id="' + $tab.attr('id') + '_chart_cnt"></div>');
|
||||
tabChart[$tab.attr('id')] = PMA_createChart(settings);
|
||||
$(link).html(PMA_messages['strStaticData']);
|
||||
$tab.find('.statuslinks a.tabRefresh').hide();
|
||||
$tab.find('.statuslinks select').show();
|
||||
} else {
|
||||
clearTimeout(chart_activeTimeouts[$tab.attr('id')+"_chart_cnt"]);
|
||||
chart_activeTimeouts[$tab.attr('id')+"_chart_cnt"]=null;
|
||||
clearTimeout(chart_activeTimeouts[$tab.attr('id') + "_chart_cnt"]);
|
||||
chart_activeTimeouts[$tab.attr('id') + "_chart_cnt"]=null;
|
||||
$tab.find('.tabInnerContent').show();
|
||||
$tab.find('div#'+$tab.attr('id')+'_chart_cnt').remove();
|
||||
$tab.find('div#'+$tab.attr('id') + '_chart_cnt').remove();
|
||||
tabStatus[$tab.attr('id')]='static';
|
||||
tabChart[$tab.attr('id')].destroy();
|
||||
$tab.find('.statuslinks a.tabRefresh').show();
|
||||
@ -243,9 +276,10 @@ $(function() {
|
||||
});
|
||||
|
||||
$('#filterText').keyup(function(e) {
|
||||
if($(this).val().length==0) textFilter=null;
|
||||
else textFilter = new RegExp("(^|_)"+$(this).val(),'i');
|
||||
text=$(this).val();
|
||||
if($(this).val().length == 0) textFilter = null;
|
||||
else textFilter = new RegExp("(^|_)" + $(this).val(),'i');
|
||||
|
||||
text = $(this).val();
|
||||
filterVariables();
|
||||
});
|
||||
|
||||
@ -258,11 +292,11 @@ $(function() {
|
||||
function initTab(tab,data) {
|
||||
switch(tab.attr('id')) {
|
||||
case 'statustabs_traffic':
|
||||
if(data!=null) tab.find('.tabInnerContent').html(data);
|
||||
if(data != null) tab.find('.tabInnerContent').html(data);
|
||||
initTooltips();
|
||||
break;
|
||||
case 'statustabs_queries':
|
||||
if(data!=null) {
|
||||
if(data != null) {
|
||||
queryPieChart.destroy();
|
||||
tab.find('.tabInnerContent').html(data);
|
||||
}
|
||||
@ -273,10 +307,9 @@ $(function() {
|
||||
cdata.push([key,parseInt(value)]);
|
||||
});
|
||||
|
||||
queryPieChart=PMA_createChart({
|
||||
queryPieChart = PMA_createChart({
|
||||
chart: {
|
||||
renderTo: 'serverstatusquerieschart'
|
||||
|
||||
},
|
||||
title: {
|
||||
text:'',
|
||||
@ -284,7 +317,7 @@ $(function() {
|
||||
},
|
||||
series: [{
|
||||
type:'pie',
|
||||
name: 'Query statistics',
|
||||
name: PMA_messages['strChartQueryPie'],
|
||||
data: cdata
|
||||
}],
|
||||
plotOptions: {
|
||||
@ -293,20 +326,22 @@ $(function() {
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
formatter: function() {
|
||||
return '<b>'+ this.point.name +'</b><br> '+ Highcharts.numberFormat(this.percentage, 2) +' %';
|
||||
formatter: function() {
|
||||
return '<b>'+ this.point.name +'</b><br/> ' + Highcharts.numberFormat(this.percentage, 2) + ' %';
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function() { return '<b>'+ this.point.name +'</b><br/>'+Highcharts.numberFormat(this.y, 2)+'<br/>('+Highcharts.numberFormat(this.percentage, 2) +' %)'; }
|
||||
formatter: function() {
|
||||
return '<b>' + this.point.name + '</b><br/>' + Highcharts.numberFormat(this.y, 2) + '<br/>(' + Highcharts.numberFormat(this.percentage, 2) + ' %)';
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'statustabs_allvars':
|
||||
if(data!=null) {
|
||||
if(data != null) {
|
||||
tab.find('.tabInnerContent').html(data);
|
||||
filterVariables();
|
||||
}
|
||||
@ -329,7 +364,7 @@ $(function() {
|
||||
});
|
||||
|
||||
$('#serverstatusqueriesdetails tr:first th')
|
||||
.append('<img class="sortableIcon" src="'+pma_theme_image+'cleardot.gif" alt="">');
|
||||
.append('<img class="sortableIcon" src="' + pma_theme_image + 'cleardot.gif" alt="">');
|
||||
|
||||
break;
|
||||
|
||||
@ -343,7 +378,7 @@ $(function() {
|
||||
});
|
||||
|
||||
$('#serverstatusvariables tr:first th')
|
||||
.append('<img class="sortableIcon" src="'+pma_theme_image+'cleardot.gif" alt="">');
|
||||
.append('<img class="sortableIcon" src="' + pma_theme_image + 'cleardot.gif" alt="">');
|
||||
|
||||
break;
|
||||
}
|
||||
@ -351,14 +386,14 @@ $(function() {
|
||||
|
||||
/* Filters the status variables by name/category/alert in the variables tab */
|
||||
function filterVariables() {
|
||||
var useful_links=0;
|
||||
var useful_links = 0;
|
||||
var section = text;
|
||||
|
||||
if(categoryFilter.length>0) section = categoryFilter;
|
||||
if(categoryFilter.length > 0) section = categoryFilter;
|
||||
|
||||
if(section.length>1) {
|
||||
if(section.length > 1) {
|
||||
$('#linkSuggestions span').each(function() {
|
||||
if($(this).attr('class').indexOf('status_'+section)!=-1) {
|
||||
if($(this).attr('class').indexOf('status_'+section) != -1) {
|
||||
useful_links++;
|
||||
$(this).css('display','');
|
||||
} else {
|
||||
@ -369,16 +404,16 @@ $(function() {
|
||||
});
|
||||
}
|
||||
|
||||
if(useful_links>0)
|
||||
if(useful_links > 0)
|
||||
$('#linkSuggestions').css('display','');
|
||||
else $('#linkSuggestions').css('display','none');
|
||||
|
||||
odd_row=false;
|
||||
$('#serverstatusvariables th.name').each(function() {
|
||||
if((textFilter==null || textFilter.exec($(this).text()))
|
||||
&& (!alertFilter || $(this).next().find('span.attention').length>0)
|
||||
&& (categoryFilter.length==0 || $(this).parent().hasClass('s_'+categoryFilter))) {
|
||||
odd_row = !odd_row;
|
||||
if((textFilter == null || textFilter.exec($(this).text()))
|
||||
&& (! alertFilter || $(this).next().find('span.attention').length>0)
|
||||
&& (categoryFilter.length == 0 || $(this).parent().hasClass('s_'+categoryFilter))) {
|
||||
odd_row = ! odd_row;
|
||||
$(this).parent().css('display','');
|
||||
if(odd_row) {
|
||||
$(this).parent().addClass('odd');
|
||||
@ -406,22 +441,22 @@ $(function() {
|
||||
if(value-lastQueries.pointInfo[key] > 0) {
|
||||
queryKeys.push(key);
|
||||
queryValues.push(value-lastQueries.pointInfo[key]);
|
||||
sumTotal+=value-lastQueries.pointInfo[key];
|
||||
sumTotal += value-lastQueries.pointInfo[key];
|
||||
}
|
||||
});
|
||||
var numQueries = queryKeys.length;
|
||||
var pointInfo = '<b>' + PMA_messages['strTotal'] + ': ' + sumTotal + '</b><br>';
|
||||
|
||||
while(queryKeys.length > 0) {
|
||||
max=0;
|
||||
for(var i=0; i<queryKeys.length; i++) {
|
||||
max = 0;
|
||||
for(var i=0; i < queryKeys.length; i++) {
|
||||
if(queryValues[i] > max) {
|
||||
max = queryValues[i];
|
||||
maxIdx = i;
|
||||
}
|
||||
}
|
||||
if(numQueries > 8 && num>=6)
|
||||
sumOther+=queryValues[maxIdx];
|
||||
if(numQueries > 8 && num >= 6)
|
||||
sumOther += queryValues[maxIdx];
|
||||
else pointInfo += queryKeys[maxIdx].substr(4).replace('_',' ') + ': ' + queryValues[maxIdx] + '<br>';
|
||||
|
||||
queryKeys.splice(maxIdx,1);
|
||||
|
||||
@ -1,42 +1,92 @@
|
||||
$(function() {
|
||||
var textFilter=null;
|
||||
var odd_row=false;
|
||||
|
||||
// Filter options are invisible for disabled js users
|
||||
$('fieldset#tableFilter').css('display','');
|
||||
|
||||
$('#filterText').keyup(function(e) {
|
||||
if($(this).val().length==0) textFilter=null;
|
||||
else textFilter = new RegExp("(^| )"+$(this).val(),'i');
|
||||
filterVariables();
|
||||
});
|
||||
|
||||
function filterVariables() {
|
||||
odd_row=false;
|
||||
var mark_next=false;
|
||||
var firstCell;
|
||||
|
||||
$('table.filteredData tbody tr').each(function() {
|
||||
firstCell = $(this).children(':first');
|
||||
|
||||
if(mark_next || textFilter==null || textFilter.exec(firstCell.text())) {
|
||||
// If current row is 'marked', also display next row
|
||||
if($(this).hasClass('marked') && !mark_next)
|
||||
mark_next=true;
|
||||
else mark_next=false;
|
||||
|
||||
odd_row = !odd_row;
|
||||
$(this).css('display','');
|
||||
if(odd_row) {
|
||||
$(this).addClass('odd');
|
||||
$(this).removeClass('even');
|
||||
} else {
|
||||
$(this).addClass('even');
|
||||
$(this).removeClass('odd');
|
||||
}
|
||||
} else {
|
||||
$(this).css('display','none');
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
var textFilter=null;
|
||||
var odd_row=false;
|
||||
var testString = 'abcdefghijklmnopqrstuvwxyz0123456789,ABCEFGHIJKLMOPQRSTUVWXYZ';
|
||||
var $tmpDiv;
|
||||
var charWidth;
|
||||
|
||||
/*** This code snippet takes care that the table stays readable. It cuts off long strings when the window is resized ***/
|
||||
$('table.data').after($tmpDiv=$('<span>'+testString+'</span>'));
|
||||
charWidth = $tmpDiv.width() / testString.length;
|
||||
$tmpDiv.remove();
|
||||
|
||||
$(window).resize(limitTableWidth);
|
||||
limitTableWidth();
|
||||
|
||||
function limitTableWidth() {
|
||||
var fulltext;
|
||||
var charDiff;
|
||||
var maxTableWidth;
|
||||
var $tmpTable;
|
||||
|
||||
$('table.data').after($tmpTable=$('<table id="testTable" style="width:100%;"><tr><td>'+testString+'</td></tr></table>'));
|
||||
maxTableWidth = $('#testTable').width();
|
||||
$tmpTable.remove();
|
||||
charDiff = ($('table.data').width()-maxTableWidth) / charWidth;
|
||||
|
||||
if($('body').innerWidth() < $('table.data').width()+10 || $('body').innerWidth() > $('table.data').width()+20) {
|
||||
var maxChars=0;
|
||||
|
||||
$('table.data tbody tr td:nth-child(2)').each(function() {
|
||||
maxChars=Math.max($(this).text().length,maxChars);
|
||||
});
|
||||
|
||||
// Do not resize smaller if there's only 50 chars displayed already
|
||||
if(charDiff > 0 && maxChars < 50) return;
|
||||
|
||||
$('table.data tbody tr td:nth-child(2)').each(function() {
|
||||
if((charDiff>0 && $(this).text().length > maxChars-charDiff) || (charDiff<0 && $(this).find('abbr.cutoff').length>0)) {
|
||||
if($(this).find('abbr.cutoff').length > 0)
|
||||
fulltext = $(this).find('abbr.cutoff').attr('title');
|
||||
else {
|
||||
fulltext = $(this).text();
|
||||
// Do not cut off elements with html in it and hope they are not too long
|
||||
if(fulltext.length != $(this).html().length) return 0;
|
||||
}
|
||||
|
||||
if(fulltext.length < maxChars-charDiff)
|
||||
$(this).html(fulltext);
|
||||
else $(this).html('<abbr class="cutoff" title="'+fulltext+'">'+fulltext.substr(0,maxChars-charDiff-3)+'...</abbr>');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Filter options are invisible for disabled js users
|
||||
$('fieldset#tableFilter').css('display','');
|
||||
|
||||
$('#filterText').keyup(function(e) {
|
||||
if($(this).val().length==0) textFilter=null;
|
||||
else textFilter = new RegExp("(^| )"+$(this).val(),'i');
|
||||
filterVariables();
|
||||
});
|
||||
|
||||
function filterVariables() {
|
||||
odd_row=false;
|
||||
var mark_next=false;
|
||||
var firstCell;
|
||||
|
||||
$('table.filteredData tbody tr').each(function() {
|
||||
firstCell = $(this).children(':first');
|
||||
|
||||
if(mark_next || textFilter==null || textFilter.exec(firstCell.text())) {
|
||||
// If current row is 'marked', also display next row
|
||||
if($(this).hasClass('marked') && !mark_next)
|
||||
mark_next=true;
|
||||
else mark_next=false;
|
||||
|
||||
odd_row = !odd_row;
|
||||
$(this).css('display','');
|
||||
if(odd_row) {
|
||||
$(this).addClass('odd');
|
||||
$(this).removeClass('even');
|
||||
} else {
|
||||
$(this).addClass('even');
|
||||
$(this).removeClass('odd');
|
||||
}
|
||||
} else {
|
||||
$(this).css('display','none');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
123
js/sql.js
123
js/sql.js
@ -42,12 +42,13 @@ function getFieldName($this_field, disp_mode) {
|
||||
else {
|
||||
var this_field_index = $this_field.index();
|
||||
// ltr or rtl direction does not impact how the DOM was generated
|
||||
//
|
||||
// check if the action column in the left exist
|
||||
var leftActionExist = !$('#table_results').find('th:first').hasClass('draggable');
|
||||
// 5 columns to account for the checkbox, edit, appended inline edit, copy and delete anchors but index is zero-based so substract 4
|
||||
var field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index-4 )+') a').text();
|
||||
var field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index - (leftActionExist ? 4 : 0)) + ') a').text();
|
||||
// happens when just one row (headings contain no a)
|
||||
if ("" == field_name) {
|
||||
field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index-4 )+')').text();
|
||||
field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index - (leftActionExist ? 4 : 0)) + ')').text();
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,6 +212,24 @@ $(document).ready(function() {
|
||||
$("#sqlqueryresults").live('appendAnchor',function() {
|
||||
appendInlineAnchor();
|
||||
})
|
||||
|
||||
/**
|
||||
* Attach the {@link makegrid} function to a custom event, which will be
|
||||
* triggered manually everytime the table of results is reloaded
|
||||
* @memberOf jQuery
|
||||
*/
|
||||
$("#sqlqueryresults").live('makegrid', function() {
|
||||
$('#table_results').makegrid();
|
||||
})
|
||||
|
||||
/**
|
||||
* Attach the {@link refreshgrid} function to a custom event, which will be
|
||||
* triggered manually everytime the table of results is manipulated (e.g., by inline edit)
|
||||
* @memberOf jQuery
|
||||
*/
|
||||
$("#sqlqueryresults").live('refreshgrid', function() {
|
||||
$('#table_results').refreshgrid();
|
||||
})
|
||||
|
||||
/**
|
||||
* Trigger the appendAnchor event to prepare the first table for inline edit
|
||||
@ -324,6 +343,7 @@ $(document).ready(function() {
|
||||
$('#sqlqueryresults').show();
|
||||
$("#sqlqueryresults").html(data);
|
||||
$("#sqlqueryresults").trigger('appendAnchor');
|
||||
$("#sqlqueryresults").trigger('makegrid');
|
||||
$('#togglequerybox').show();
|
||||
if($("#togglequerybox").siblings(":visible").length > 0) {
|
||||
$("#togglequerybox").trigger('click');
|
||||
@ -364,6 +384,7 @@ $(document).ready(function() {
|
||||
$.post($the_form.attr('action'), $the_form.serialize(), function(data) {
|
||||
$("#sqlqueryresults").html(data);
|
||||
$("#sqlqueryresults").trigger('appendAnchor');
|
||||
$("#sqlqueryresults").trigger('makegrid');
|
||||
PMA_init_slider();
|
||||
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
@ -387,6 +408,7 @@ $(document).ready(function() {
|
||||
$.post($the_form.attr('action'), $the_form.serialize() + '&ajax_request=true', function(data) {
|
||||
$("#sqlqueryresults").html(data);
|
||||
$("#sqlqueryresults").trigger('appendAnchor');
|
||||
$("#sqlqueryresults").trigger('makegrid');
|
||||
PMA_init_slider();
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
}) // end $.post()
|
||||
@ -412,7 +434,8 @@ $(document).ready(function() {
|
||||
$.get($anchor.attr('href'), $anchor.serialize() + '&ajax_request=true', function(data) {
|
||||
$("#sqlqueryresults")
|
||||
.html(data)
|
||||
.trigger('appendAnchor');
|
||||
.trigger('appendAnchor')
|
||||
.trigger('makegrid');
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
}) // end $.get()
|
||||
})//end Sort results table
|
||||
@ -431,7 +454,8 @@ $(document).ready(function() {
|
||||
$.post($form.attr('action'), $form.serialize() + '&ajax_request=true' , function(data) {
|
||||
$("#sqlqueryresults")
|
||||
.html(data)
|
||||
.trigger('appendAnchor');
|
||||
.trigger('appendAnchor')
|
||||
.trigger('makegrid');
|
||||
PMA_init_slider();
|
||||
}) // end $.post()
|
||||
})
|
||||
@ -517,21 +541,22 @@ $(document).ready(function() {
|
||||
$this_hide.parent().removeClass("hover noclick");
|
||||
$this_hide.siblings().removeClass("hover");
|
||||
|
||||
var last_column = $this_hide.siblings().length;
|
||||
var $input_siblings = $this_hide.parent('tr').find('.inline_edit');
|
||||
var txt = '';
|
||||
for(var i = 4; i < last_column; i++) {
|
||||
if($this_hide.siblings("td:eq(" + i + ")").hasClass("inline_edit") == false) {
|
||||
continue;
|
||||
$input_siblings.each(function() {
|
||||
var $this_hide_siblings = $(this);
|
||||
txt = $this_hide_siblings.data('original_data');
|
||||
if($this_hide_siblings.children('span').children().length != 0) {
|
||||
$this_hide_siblings.children('span').empty();
|
||||
$this_hide_siblings.children('span').append(txt);
|
||||
}
|
||||
txt = $this_hide.siblings("td:eq(" + i + ")").data('original_data');
|
||||
if($this_hide.siblings("td:eq(" + i + ")").children().length != 0) {
|
||||
$this_hide.siblings("td:eq(" + i + ")").empty();
|
||||
$this_hide.siblings("td:eq(" + i + ")").append(txt);
|
||||
}
|
||||
}
|
||||
});
|
||||
$(this).prev().prev().remove();
|
||||
$(this).prev().remove();
|
||||
$(this).remove();
|
||||
|
||||
// refresh the grid
|
||||
$("#sqlqueryresults").trigger('refreshgrid');
|
||||
});
|
||||
} else {
|
||||
var txt = '';
|
||||
@ -539,7 +564,8 @@ $(document).ready(function() {
|
||||
|
||||
$('#table_results tbody tr td span a#hide').click(function() {
|
||||
var $hide_a = $(this);
|
||||
var pos = $hide_a.parents('td').index();
|
||||
var $this_hide = $(this).parents('td');
|
||||
var pos = $this_hide.index();
|
||||
|
||||
var $this_span = $hide_a.parent();
|
||||
$this_span.find('a, br').remove();
|
||||
@ -547,22 +573,26 @@ $(document).ready(function() {
|
||||
|
||||
var $this_row = $this_span.parents('tr');
|
||||
// changing inline_edit_active to inline_edit_anchor
|
||||
$this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("inline_edit_active").addClass("inline_edit_anchor");
|
||||
$this_hide.removeClass("inline_edit_active").addClass("inline_edit_anchor");
|
||||
|
||||
// removing marked and hover classes.
|
||||
$this_row.parent('tbody').find('tr').find("td:eq(" + pos + ")").removeClass("marked hover");
|
||||
|
||||
for( var i = 6; i <= rows + 2; i++){
|
||||
for( var i = 0; i <= rows + 2; i++){
|
||||
if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").hasClass("inline_edit") == false) {
|
||||
continue;
|
||||
}
|
||||
txt = $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").data('original_data');
|
||||
$this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").empty();
|
||||
$this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").append(txt);
|
||||
$this_row_siblings = $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")");
|
||||
txt = $this_row_siblings.data('original_data');
|
||||
$this_row_siblings.children('span').empty();
|
||||
$this_row_siblings.children('span').append(txt);
|
||||
}
|
||||
$(this).prev().remove();
|
||||
$(this).prev().remove();
|
||||
$(this).remove();
|
||||
|
||||
// refresh the grid
|
||||
$("#sqlqueryresults").trigger('refreshgrid');
|
||||
});
|
||||
}
|
||||
|
||||
@ -594,7 +624,7 @@ $(document).ready(function() {
|
||||
/**
|
||||
* @var data_value Current value of this field
|
||||
*/
|
||||
var data_value = $(this).html();
|
||||
var data_value = $(this).children('span').html();
|
||||
|
||||
// We need to retrieve the value from the server for truncated/relation fields
|
||||
// Find the field name
|
||||
@ -603,6 +633,10 @@ $(document).ready(function() {
|
||||
* @var this_field Object referring to this field (<td>)
|
||||
*/
|
||||
var $this_field = $(this);
|
||||
/**
|
||||
* @var this_field_span Object referring to this field's child (<span>)
|
||||
*/
|
||||
var $this_field_span = $(this).children('span');
|
||||
/**
|
||||
* @var field_name String containing the name of this field.
|
||||
* @see getFieldName()
|
||||
@ -620,11 +654,11 @@ $(document).ready(function() {
|
||||
/**
|
||||
* @var curr_value String current value of the field (for fields that are of type enum or set).
|
||||
*/
|
||||
var curr_value = $this_field.text();
|
||||
var curr_value = $this_field_span.text();
|
||||
|
||||
if($this_field.is(':not(.not_null)')){
|
||||
// add a checkbox to mark null for all the field that are nullable.
|
||||
$this_field.html('<div class="null_div">Null :<input type="checkbox" class="checkbox_null_'+ field_name + '_' + this_row_index +'"></div>');
|
||||
$this_field_span.html('<div class="null_div">Null :<input type="checkbox" class="checkbox_null_'+ field_name + '_' + this_row_index +'"></div>');
|
||||
// check the 'checkbox_null_<field_name>_<row_index>' if the corresponding value is null
|
||||
if($this_field.is('.null')) {
|
||||
$('.checkbox_null_' + field_name + '_' + this_row_index).attr('checked', true);
|
||||
@ -671,15 +705,17 @@ $(document).ready(function() {
|
||||
})
|
||||
|
||||
} else {
|
||||
$this_field.html('<div class="null_div"></div>');
|
||||
$this_field_span.html('<div class="null_div"></div>');
|
||||
}
|
||||
|
||||
// In each input sibling, wrap the current value in a textarea
|
||||
// and store the current value in a hidden span
|
||||
if($this_field.is(':not(.truncated, .transformed, .relation, .enum, .set, .null)')) {
|
||||
// handle non-truncated, non-transformed, non-relation values
|
||||
|
||||
value = data_value.replace("<br>", "\n");
|
||||
// We don't need to get any more data, just wrap the value
|
||||
$this_field.append('<textarea>'+data_value+'</textarea>');
|
||||
$this_field_span.append('<textarea>' + value + '</textarea>');
|
||||
$this_field.data('original_data', data_value);
|
||||
}
|
||||
else if($this_field.is('.truncated, .transformed')) {
|
||||
@ -700,8 +736,9 @@ $(document).ready(function() {
|
||||
'inline_edit' : true
|
||||
}, function(data) {
|
||||
if(data.success == true) {
|
||||
$this_field.append('<textarea>'+data.value+'</textarea>');
|
||||
$this_field_span.append('<textarea>'+data.value+'</textarea>');
|
||||
$this_field.data('original_data', data_value);
|
||||
$("#sqlqueryresults").trigger('refreshgrid');
|
||||
}
|
||||
else {
|
||||
PMA_ajaxShowMessage(data.error);
|
||||
@ -727,8 +764,9 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
$.post('sql.php', post_params, function(data) {
|
||||
$this_field.append(data.dropdown);
|
||||
$this_field_span.append(data.dropdown);
|
||||
$this_field.data('original_data', data_value);
|
||||
$("#sqlqueryresults").trigger('refreshgrid');
|
||||
}) // end $.post()
|
||||
}
|
||||
else if($this_field.is('.enum')) {
|
||||
@ -748,8 +786,9 @@ $(document).ready(function() {
|
||||
'curr_value' : curr_value
|
||||
}
|
||||
$.post('sql.php', post_params, function(data) {
|
||||
$this_field.append(data.dropdown);
|
||||
$this_field_span.append(data.dropdown);
|
||||
$this_field.data('original_data', data_value);
|
||||
$("#sqlqueryresults").trigger('refreshgrid');
|
||||
}) // end $.post()
|
||||
}
|
||||
else if($this_field.is('.set')) {
|
||||
@ -770,16 +809,21 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
$.post('sql.php', post_params, function(data) {
|
||||
$this_field.append(data.select);
|
||||
$this_field_span.append(data.select);
|
||||
$this_field.data('original_data', data_value);
|
||||
$("#sqlqueryresults").trigger('refreshgrid');
|
||||
}) // end $.post()
|
||||
}
|
||||
else if($this_field.is('.null')) {
|
||||
//handle null fields
|
||||
$this_field.append('<textarea></textarea>');
|
||||
$this_field_span.append('<textarea></textarea>');
|
||||
$this_field.data('original_data', 'NULL');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// refresh the grid
|
||||
$("#sqlqueryresults").trigger('refreshgrid');
|
||||
|
||||
}) // End On click, replace the current field with an input/textarea
|
||||
|
||||
/**
|
||||
@ -801,7 +845,7 @@ $(document).ready(function() {
|
||||
* being edited
|
||||
*
|
||||
*/
|
||||
var $this_td = $(this).parent().parent();
|
||||
var $this_td = $(this).parents('td');
|
||||
var $test_element = ''; // to test the presence of a element
|
||||
|
||||
// Initialize variables
|
||||
@ -1168,10 +1212,11 @@ function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings,
|
||||
$input_siblings.each(function() {
|
||||
// Inline edit post has been successful.
|
||||
$this_sibling = $(this);
|
||||
$this_sibling_span = $(this).children('span');
|
||||
|
||||
var is_null = $this_sibling.find('input:checkbox').is(':checked');
|
||||
if (is_null) {
|
||||
$this_sibling.html('NULL');
|
||||
$this_sibling_span.html('NULL');
|
||||
$this_sibling.addClass('null');
|
||||
} else {
|
||||
$this_sibling.removeClass('null');
|
||||
@ -1231,9 +1276,12 @@ function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings,
|
||||
}
|
||||
}
|
||||
}
|
||||
$this_sibling.html(new_html);
|
||||
$this_sibling_span.html(new_html);
|
||||
}
|
||||
})
|
||||
|
||||
// refresh the grid
|
||||
$("#sqlqueryresults").trigger('refreshgrid');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1280,6 +1328,11 @@ $(document).ready(function() {
|
||||
$('.column_heading.marker').live('click', function() {
|
||||
PMA_changeClassForColumn($(this), 'marked');
|
||||
});
|
||||
|
||||
/**
|
||||
* create resizable table
|
||||
*/
|
||||
$("#sqlqueryresults").trigger('makegrid');
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
@ -67,6 +67,7 @@ $(document).ready(function() {
|
||||
// found results
|
||||
$("#sqlqueryresults").html(response);
|
||||
$("#sqlqueryresults").trigger('appendAnchor');
|
||||
$("#sqlqueryresults").trigger('makegrid');
|
||||
$('#tbl_search_form')
|
||||
// work around for bug #3168569 - Issue on toggling the "Hide search criteria" in chrome.
|
||||
.slideToggle()
|
||||
|
||||
@ -504,7 +504,7 @@ class PMA_Index
|
||||
$r .= '</td>';
|
||||
$r .= '<td>' . htmlspecialchars($column->getCardinality()) . '</td>';
|
||||
$r .= '<td>' . htmlspecialchars($column->getCollation()) . '</td>';
|
||||
$r .= '<td>' . htmlspecialchars($column->getNull()) . '</td>';
|
||||
$r .= '<td>' . htmlspecialchars($column->getNull(true)) . '</td>';
|
||||
|
||||
if ($column->getSeqInIndex() == 1) {
|
||||
$r .= '<td ' . $row_span . '>'
|
||||
@ -635,7 +635,7 @@ class PMA_Index_Column
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_cardinality = 0;
|
||||
protected $_cardinality = null;
|
||||
|
||||
public function __construct($params = array())
|
||||
{
|
||||
@ -679,9 +679,11 @@ class PMA_Index_Column
|
||||
return $this->_cardinality;
|
||||
}
|
||||
|
||||
public function getNull()
|
||||
public function getNull($as_text = false)
|
||||
{
|
||||
return $this->_null;
|
||||
return $as_text
|
||||
? (!$this->_null || $this->_null == 'NO' ? __('No') : __('Yes'))
|
||||
: $this->_null;
|
||||
}
|
||||
|
||||
public function getSeqInIndex()
|
||||
|
||||
@ -14,7 +14,7 @@ require_once './libraries/Message.class.php';
|
||||
*
|
||||
* @package phpMyAdmin
|
||||
*/
|
||||
class RecentTable
|
||||
class PMA_RecentTable
|
||||
{
|
||||
/**
|
||||
* Defines the internal PMA table which contains recent tables.
|
||||
@ -33,9 +33,9 @@ class RecentTable
|
||||
public $tables;
|
||||
|
||||
/**
|
||||
* RecentTable instance.
|
||||
* PMA_RecentTable instance.
|
||||
*
|
||||
* @var RecentTable
|
||||
* @var PMA_RecentTable
|
||||
*/
|
||||
private static $_instance;
|
||||
|
||||
@ -56,12 +56,12 @@ class RecentTable
|
||||
/**
|
||||
* Returns class instance.
|
||||
*
|
||||
* @return RecentTable
|
||||
* @return PMA_RecentTable
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(self::$_instance)) {
|
||||
self::$_instance = new RecentTable();
|
||||
self::$_instance = new PMA_RecentTable();
|
||||
}
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
@ -12,9 +12,10 @@
|
||||
class PMA_Table
|
||||
{
|
||||
/**
|
||||
* UI preferences property: sorted column
|
||||
* UI preferences properties
|
||||
*/
|
||||
const PROP_SORTED_COLUMN = 'sorted_col';
|
||||
const PROP_COLUMN_ORDER = 'col_order';
|
||||
|
||||
static $cache = array();
|
||||
|
||||
@ -1195,6 +1196,27 @@ class PMA_Table
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all columns
|
||||
*
|
||||
* returns an array with all columns
|
||||
*
|
||||
* @param boolean whether to quote name with backticks ``
|
||||
* @return array
|
||||
*/
|
||||
public function getColumns($backquoted = true)
|
||||
{
|
||||
$sql = 'SHOW COLUMNS FROM ' . $this->getFullName(true);
|
||||
$indexed = PMA_DBI_fetch_result($sql, 'Field', 'Field');
|
||||
|
||||
$return = array();
|
||||
foreach ($indexed as $column) {
|
||||
$return[] = $this->getFullName($backquoted) . '.' . ($backquoted ? PMA_backquote($column) : $column);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return UI preferences for this table from phpMyAdmin database.
|
||||
*
|
||||
@ -1275,26 +1297,12 @@ class PMA_Table
|
||||
$this->uiprefs =& $_SESSION['tmp_user_values']['table_uiprefs'][$this->db_name][$this->name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get UI preferences array for this table.
|
||||
* If pmadb and table_uiprefs is set, it will get the UI preferences from
|
||||
* phpMyAdmin database.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getUiPrefs()
|
||||
{
|
||||
if (! isset($this->uiprefs)) {
|
||||
$this->loadUiPrefs();
|
||||
}
|
||||
return $this->uiprefs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a property from UI preferences.
|
||||
* Return false if the property is not found.
|
||||
* Available property:
|
||||
* - PROP_SORTED_COLUMN
|
||||
* - PROP_COLUMN_ORDER
|
||||
*
|
||||
* @uses loadUiPrefs()
|
||||
*
|
||||
@ -1306,6 +1314,42 @@ class PMA_Table
|
||||
if (! isset($this->uiprefs)) {
|
||||
$this->loadUiPrefs();
|
||||
}
|
||||
// do checking based on property
|
||||
if ($property == self::PROP_SORTED_COLUMN) {
|
||||
if (isset($this->uiprefs[$property])) {
|
||||
// check if the column name is exist in this table
|
||||
$tmp = explode(' ', $this->uiprefs[$property]);
|
||||
$colname = $tmp[0];
|
||||
$avail_columns = $this->getColumns();
|
||||
foreach ($avail_columns as $each_col) {
|
||||
// check if $each_col ends with $colname
|
||||
if (substr_compare($each_col, $colname,
|
||||
strlen($each_col) - strlen($colname)) === 0) {
|
||||
return $this->uiprefs[$property];
|
||||
}
|
||||
}
|
||||
// remove the property, since it is not exist anymore in database
|
||||
$this->removeUiProp(self::PROP_SORTED_COLUMN);
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if ($property == self::PROP_COLUMN_ORDER) {
|
||||
if (isset($this->uiprefs[$property])) {
|
||||
// check if the table has not been modified
|
||||
if (self::sGetStatusInfo($this->db_name, $this->name, 'CREATE_TIME') ==
|
||||
$this->uiprefs['CREATE_TIME']) {
|
||||
return $this->uiprefs[$property];
|
||||
} else {
|
||||
// remove the property, since the table has been modified
|
||||
$this->removeUiProp(self::PROP_COLUMN_ORDER);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// default behaviour for other property:
|
||||
return isset($this->uiprefs[$property]) ? $this->uiprefs[$property] : false;
|
||||
}
|
||||
|
||||
@ -1313,16 +1357,34 @@ class PMA_Table
|
||||
* Set a property from UI preferences.
|
||||
* If pmadb and table_uiprefs is set, it will save the UI preferences to
|
||||
* phpMyAdmin database.
|
||||
* Available property:
|
||||
* - PROP_SORTED_COLUMN
|
||||
* - PROP_COLUMN_ORDER
|
||||
*
|
||||
* @param string $property
|
||||
* @param mixed $value
|
||||
* @return true|PMA_Message
|
||||
* @param string $table_create_time Needed for PROP_COLUMN_ORDER
|
||||
* @return boolean|PMA_Message
|
||||
*/
|
||||
public function setUiProp($property, $value)
|
||||
public function setUiProp($property, $value, $table_create_time = NULL)
|
||||
{
|
||||
if (! isset($this->uiprefs)) {
|
||||
$this->loadUiPrefs();
|
||||
}
|
||||
// we want to save the create time if the property is PROP_COLUMN_ORDER
|
||||
if ($property == self::PROP_COLUMN_ORDER) {
|
||||
$curr_create_time = self::sGetStatusInfo($this->db_name, $this->name, 'CREATE_TIME');
|
||||
if (isset($table_create_time) &&
|
||||
$table_create_time == $curr_create_time) {
|
||||
$this->uiprefs['CREATE_TIME'] = $curr_create_time;
|
||||
} else {
|
||||
// there is no $table_create_time, or
|
||||
// supplied $table_create_time is older than current create time,
|
||||
// so don't save
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// save the value
|
||||
$this->uiprefs[$property] = $value;
|
||||
// check if pmadb is set
|
||||
if (strlen($GLOBALS['cfg']['Server']['pmadb'])
|
||||
@ -1331,5 +1393,25 @@ class PMA_Table
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a property from UI preferences.
|
||||
*
|
||||
* @param string $property
|
||||
*/
|
||||
public function removeUiProp($property)
|
||||
{
|
||||
if (! isset($this->uiprefs)) {
|
||||
$this->loadUiPrefs();
|
||||
}
|
||||
if (isset($this->uiprefs[$property])) {
|
||||
unset($this->uiprefs[$property]);
|
||||
// check if pmadb is set
|
||||
if (strlen($GLOBALS['cfg']['Server']['pmadb'])
|
||||
&& strlen($GLOBALS['cfg']['Server']['table_uiprefs'])) {
|
||||
return $this->saveUiprefsToDb();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -288,7 +288,7 @@ class PMA_Theme_Manager
|
||||
$theme_preview_href = '<a href="' . $theme_preview_path . '" target="themes" onclick="'
|
||||
. "window.open('" . $theme_preview_path . "','themes','left=10,top=20,width=510,height=350,scrollbars=yes,status=yes,resizable=yes');"
|
||||
. '">';
|
||||
$select_box .= $theme_preview_href . __('Theme / Style') . '</a>:' . "\n";
|
||||
$select_box .= $theme_preview_href . __('Theme') . '</a>:' . "\n";
|
||||
|
||||
$select_box .= '<select name="set_theme" xml:lang="en" dir="ltr"'
|
||||
.' onchange="this.form.submit();" >';
|
||||
|
||||
@ -1032,6 +1032,22 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
|
||||
// Analyze it
|
||||
if (isset($parsed_sql)) {
|
||||
$analyzed_display_query = PMA_SQP_analyze($parsed_sql);
|
||||
|
||||
// Same as below (append LIMIT), append the remembered ORDER BY
|
||||
if ($GLOBALS['cfg']['RememberSorting']
|
||||
&& isset($analyzed_display_query[0]['queryflags']['select_from'])
|
||||
&& isset($GLOBALS['sql_order_to_append'])) {
|
||||
$query_base = $analyzed_display_query[0]['section_before_limit']
|
||||
. "\n" . $GLOBALS['sql_order_to_append']
|
||||
. $analyzed_display_query[0]['section_after_limit'];
|
||||
|
||||
// Need to reparse query
|
||||
$parsed_sql = PMA_SQP_parse($query_base);
|
||||
// update the $analyzed_display_query
|
||||
$analyzed_display_query[0]['section_before_limit'] .= $GLOBALS['sql_order_to_append'];
|
||||
$analyzed_display_query[0]['order_by_clause'] = $GLOBALS['sorted_col'];
|
||||
}
|
||||
|
||||
// Here we append the LIMIT added for navigation, to
|
||||
// enable its display. Adding it higher in the code
|
||||
// to $sql_query would create a problem when
|
||||
|
||||
@ -184,6 +184,25 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
||||
} // end of the 'PMA_setDisplayMode()' function
|
||||
|
||||
|
||||
/**
|
||||
* Return true if we are executing a query in the form of
|
||||
* "SELECT * FROM <a table> ..."
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function PMA_isSelect()
|
||||
{
|
||||
// global variables set from sql.php
|
||||
global $is_count, $is_export, $is_func, $is_analyse;
|
||||
global $analyzed_sql;
|
||||
|
||||
return ! ($is_count || $is_export || $is_func || $is_analyse)
|
||||
&& count($analyzed_sql[0]['select_expr']) == 0
|
||||
&& isset($analyzed_sql[0]['queryflags']['select_from'])
|
||||
&& count($analyzed_sql[0]['table_ref']) == 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Displays a navigation button
|
||||
*
|
||||
@ -374,6 +393,26 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_di
|
||||
);
|
||||
} // end move toward
|
||||
?>
|
||||
<td>
|
||||
<input class="restore_column hide" type="submit" value="<?php echo __('Restore column order'); ?>" />
|
||||
<?php
|
||||
if (PMA_isSelect()) {
|
||||
// generate the column order, if it is set
|
||||
$pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
|
||||
$col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER);
|
||||
if ($col_order) {
|
||||
echo '<input id="col_order" type="hidden" value="' . implode(',', $col_order) . '" />';
|
||||
}
|
||||
// generate table create time
|
||||
echo '<input id="table_create_time" type="hidden" value="' .
|
||||
PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['table'], 'CREATE_TIME') . '" />';
|
||||
}
|
||||
// generate hints
|
||||
echo '<input id="col_order_hint" type="hidden" value="' . __('Drag to reorder') . '" />';
|
||||
echo '<input id="sort_hint" type="hidden" value="' . __('Click to sort') . '" />';
|
||||
echo '<input id="col_mark_hint" type="hidden" value="' . __('Click to mark/unmark') . '" />';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -699,7 +738,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
// ... elseif display an empty column if the actions links are disabled to match the rest of the table
|
||||
elseif ($GLOBALS['cfg']['RowActionLinks'] == 'none' && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|
||||
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
|
||||
echo '<td></td>';
|
||||
echo '<th></th>';
|
||||
}
|
||||
|
||||
// 2. Displays the fields' name
|
||||
@ -739,7 +778,17 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $fields_cnt; $i++) {
|
||||
if (PMA_isSelect()) {
|
||||
// prepare to get the column order, if available
|
||||
$pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
|
||||
$col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER);
|
||||
} else {
|
||||
$col_order = false;
|
||||
}
|
||||
|
||||
for ($j = 0; $j < $fields_cnt; $j++) {
|
||||
// assign $i with appropriate column order
|
||||
$i = $col_order ? $col_order[$j] : $j;
|
||||
// See if this column should get highlight because it's used in the
|
||||
// where-query.
|
||||
if (isset($highlight_columns[$fields_meta[$i]->name]) || isset($highlight_columns[PMA_backquote($fields_meta[$i]->name)])) {
|
||||
@ -874,6 +923,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
|
||||
echo '<th';
|
||||
$th_class = array();
|
||||
$th_class[] = 'draggable';
|
||||
if ($condition_field) {
|
||||
$th_class[] = 'condition';
|
||||
}
|
||||
@ -892,7 +942,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
echo '>' . $order_link . $comments . '</th>';
|
||||
}
|
||||
$vertical_display['desc'][] = ' <th '
|
||||
. ($condition_field ? ' class="condition"' : '') . '>' . "\n"
|
||||
. 'class="draggable' . ($condition_field ? ' condition' : '') . '">' . "\n"
|
||||
. $order_link . $comments . ' </th>' . "\n";
|
||||
} // end if (2.1)
|
||||
|
||||
@ -901,9 +951,12 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|
||||
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
|
||||
echo '<th';
|
||||
$th_class = array();
|
||||
$th_class[] = 'draggable';
|
||||
if ($condition_field) {
|
||||
echo ' class="condition"';
|
||||
$th_class[] = 'condition';
|
||||
}
|
||||
echo ' class="' . implode(' ', $th_class) . '"';
|
||||
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
|
||||
echo ' valign="bottom"';
|
||||
}
|
||||
@ -921,7 +974,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
echo "\n" . $comments . '</th>';
|
||||
}
|
||||
$vertical_display['desc'][] = ' <th '
|
||||
. ($condition_field ? ' class="condition"' : '') . '>' . "\n"
|
||||
. 'class="draggable' . ($condition_field ? ' condition"' : '') . '">' . "\n"
|
||||
. ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n"
|
||||
. $comments . ' </th>';
|
||||
} // end else (2.2)
|
||||
@ -1154,6 +1207,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
if ($vertical_display['emptypre'] > 0) {
|
||||
echo ' <th colspan="' . $vertical_display['emptypre'] . '">' . "\n"
|
||||
.' </th>' . "\n";
|
||||
} else if ($GLOBALS['cfg']['RowActionLinks'] == 'none') {
|
||||
echo ' <th></th>' . "\n";
|
||||
}
|
||||
|
||||
foreach ($vertical_display['desc'] as $val) {
|
||||
@ -1289,7 +1344,19 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
} // end if (1)
|
||||
|
||||
// 2. Displays the rows' values
|
||||
for ($i = 0; $i < $fields_cnt; ++$i) {
|
||||
|
||||
if (PMA_isSelect()) {
|
||||
// prepare to get the column order, if available
|
||||
$pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
|
||||
$col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER);
|
||||
} else {
|
||||
$col_order = false;
|
||||
}
|
||||
|
||||
for ($j = 0; $j < $fields_cnt; ++$j) {
|
||||
// assign $i with appropriate column order
|
||||
$i = $col_order ? $col_order[$j] : $j;
|
||||
|
||||
$meta = $fields_meta[$i];
|
||||
$not_null_class = $meta->not_null ? 'not_null' : '';
|
||||
$relation_class = isset($map[$meta->name]) ? 'relation' : '';
|
||||
@ -1656,8 +1723,18 @@ function PMA_displayVerticalTable()
|
||||
echo '</tr>' . "\n";
|
||||
} // end if
|
||||
|
||||
if (PMA_isSelect()) {
|
||||
// prepare to get the column order, if available
|
||||
$pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
|
||||
$col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER);
|
||||
} else {
|
||||
$col_order = false;
|
||||
}
|
||||
|
||||
// Displays data
|
||||
foreach ($vertical_display['desc'] AS $key => $val) {
|
||||
foreach ($vertical_display['desc'] AS $j => $val) {
|
||||
// assign appropriate key with current column order
|
||||
$key = $col_order ? $col_order[$j] : $j;
|
||||
|
||||
echo '<tr>' . "\n";
|
||||
echo $val;
|
||||
|
||||
@ -19,7 +19,7 @@ require_once './libraries/RecentTable.class.php';
|
||||
* @param string $table The table name
|
||||
*/
|
||||
function PMA_addRecentTable($db, $table) {
|
||||
$tmp_result = RecentTable::getInstance()->add($db, $table);
|
||||
$tmp_result = PMA_RecentTable::getInstance()->add($db, $table);
|
||||
if ($tmp_result === true) {
|
||||
echo '<span class="hide" id="update_recent_tables"></span>';
|
||||
} else {
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
* string $anchor: anchor to the documentation page
|
||||
* string $chapter: chapter of "HTML, one page per chapter" documentation
|
||||
* string $type: type of system variable
|
||||
* string $format: if set to 'byte' it will format the variable with PMA_formatByteDown()
|
||||
*/
|
||||
$VARIABLE_DOC_LINKS = array();
|
||||
$VARIABLE_DOC_LINKS['auto_increment_increment'] = array('auto_increment_increment','replication-options-master','sysvar');
|
||||
@ -16,11 +17,11 @@ $VARIABLE_DOC_LINKS['back_log'] = array('back_log','server-system-variables','sy
|
||||
$VARIABLE_DOC_LINKS['basedir'] = array('basedir','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['big_tables'] = array('big-tables','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['bind_address'] = array('bind-address','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['binlog_cache_size'] = array('binlog_cache_size','replication-options-binary-log','sysvar');
|
||||
$VARIABLE_DOC_LINKS['binlog_cache_size'] = array('binlog_cache_size','replication-options-binary-log','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['binlog_direct_non_transactional_updates'] = array('binlog_direct_non_transactional_updates','replication-options-binary-log','sysvar');
|
||||
$VARIABLE_DOC_LINKS['binlog_format'] = array('binlog-format','server-options','sysvar');
|
||||
$VARIABLE_DOC_LINKS['binlog_stmt_cache_size'] = array('binlog_stmt_cache_size','replication-options-binary-log','sysvar');
|
||||
$VARIABLE_DOC_LINKS['bulk_insert_buffer_size'] = array('bulk_insert_buffer_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['binlog_stmt_cache_size'] = array('binlog_stmt_cache_size','replication-options-binary-log','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['bulk_insert_buffer_size'] = array('bulk_insert_buffer_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['character_set_client'] = array('character_set_client','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['character_set_connection'] = array('character_set_connection','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['character_set_database'] = array('character_set_database','server-system-variables','sysvar');
|
||||
@ -84,11 +85,11 @@ $VARIABLE_DOC_LINKS['init_file'] = array('init-file','server-options','option_my
|
||||
$VARIABLE_DOC_LINKS['init_slave'] = array('init_slave','replication-options-slave','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_adaptive_flushing'] = array('innodb_adaptive_flushing','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_adaptive_hash_index'] = array('innodb_adaptive_hash_index','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_additional_mem_pool_size'] = array('innodb_additional_mem_pool_size','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_additional_mem_pool_size'] = array('innodb_additional_mem_pool_size','innodb-parameters','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['innodb_autoextend_increment'] = array('innodb_autoextend_increment','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_autoinc_lock_mode'] = array('innodb_autoinc_lock_mode','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_buffer_pool_instances'] = array('innodb_buffer_pool_instances','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_buffer_pool_size'] = array('innodb_buffer_pool_size','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_buffer_pool_size'] = array('innodb_buffer_pool_size','innodb-parameters','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['innodb_change_buffering'] = array('innodb_change_buffering','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_checksums'] = array('innodb_checksums','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_commit_concurrency'] = array('innodb_commit_concurrency','innodb-parameters','sysvar');
|
||||
@ -107,8 +108,8 @@ $VARIABLE_DOC_LINKS['innodb_force_recovery'] = array('innodb_force_recovery','in
|
||||
$VARIABLE_DOC_LINKS['innodb_io_capacity'] = array('innodb_io_capacity','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_lock_wait_timeout'] = array('innodb_lock_wait_timeout','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_locks_unsafe_for_binlog'] = array('innodb_locks_unsafe_for_binlog','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_log_buffer_size'] = array('innodb_log_buffer_size','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_log_file_size'] = array('innodb_log_file_size','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_log_buffer_size'] = array('innodb_log_buffer_size','innodb-parameters','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['innodb_log_file_size'] = array('innodb_log_file_size','innodb-parameters','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['innodb_log_files_in_group'] = array('innodb_log_files_in_group','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_log_group_home_dir'] = array('innodb_log_group_home_dir','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['innodb_max_dirty_pages_pct'] = array('innodb_max_dirty_pages_pct','innodb-parameters','sysvar');
|
||||
@ -138,15 +139,15 @@ $VARIABLE_DOC_LINKS['innodb_version'] = array('innodb_version','innodb-parameter
|
||||
$VARIABLE_DOC_LINKS['innodb_write_io_threads'] = array('innodb_write_io_threads','innodb-parameters','sysvar');
|
||||
$VARIABLE_DOC_LINKS['insert_id'] = array('insert_id','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['interactive_timeout'] = array('interactive_timeout','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['join_buffer_size'] = array('join_buffer_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['join_buffer_size'] = array('join_buffer_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['keep_files_on_create'] = array('keep_files_on_create','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['key_buffer_size'] = array('key_buffer_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['key_buffer_size'] = array('key_buffer_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['key_cache_age_threshold'] = array('key_cache_age_threshold','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['key_cache_block_size'] = array('key_cache_block_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['key_cache_block_size'] = array('key_cache_block_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['key_cache_division_limit'] = array('key_cache_division_limit','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['language'] = array('language','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['large_files_support'] = array('large_files_support','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['large_page_size'] = array('large_page_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['large_page_size'] = array('large_page_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['large_pages'] = array('large-pages','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['last_insert_id'] = array('last_insert_id','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['lc_messages'] = array('lc-messages','server-options','option_mysqld');
|
||||
@ -172,19 +173,19 @@ $VARIABLE_DOC_LINKS['lower_case_file_system'] = array('lower_case_file_system','
|
||||
$VARIABLE_DOC_LINKS['lower_case_table_names'] = array('lower_case_table_names','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['master-bind'] = array('','replication-options',0);
|
||||
$VARIABLE_DOC_LINKS['max_allowed_packet'] = array('max_allowed_packet','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_binlog_cache_size'] = array('max_binlog_cache_size','replication-options-binary-log','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_binlog_size'] = array('max_binlog_size','replication-options-binary-log','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_binlog_stmt_cache_size'] = array('max_binlog_stmt_cache_size','replication-options-binary-log','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_binlog_cache_size'] = array('max_binlog_cache_size','replication-options-binary-log','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['max_binlog_size'] = array('max_binlog_size','replication-options-binary-log','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['max_binlog_stmt_cache_size'] = array('max_binlog_stmt_cache_size','replication-options-binary-log','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['max_connect_errors'] = array('max_connect_errors','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_connections'] = array('max_connections','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_delayed_threads'] = array('max_delayed_threads','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_error_count'] = array('max_error_count','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_heap_table_size'] = array('max_heap_table_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_heap_table_size'] = array('max_heap_table_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['max_insert_delayed_threads'] = array('max_insert_delayed_threads','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_join_size'] = array('max_join_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_length_for_sort_data'] = array('max_length_for_sort_data','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_prepared_stmt_count'] = array('max_prepared_stmt_count','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_relay_log_size'] = array('max_relay_log_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_relay_log_size'] = array('max_relay_log_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['max_seeks_for_key'] = array('max_seeks_for_key','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_sort_length'] = array('max_sort_length','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['max_sp_recursion_depth'] = array('max_sp_recursion_depth','server-system-variables','sysvar');
|
||||
@ -193,12 +194,12 @@ $VARIABLE_DOC_LINKS['max_user_connections'] = array('max_user_connections','serv
|
||||
$VARIABLE_DOC_LINKS['max_write_lock_count'] = array('max_write_lock_count','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['memlock'] = array('memlock','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['min_examined_row_limit'] = array('min-examined-row-limit','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['myisam_data_pointer_size'] = array('myisam_data_pointer_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['myisam_max_sort_file_size'] = array('myisam_max_sort_file_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['myisam_mmap_size'] = array('myisam_mmap_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['myisam_data_pointer_size'] = array('myisam_data_pointer_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['myisam_max_sort_file_size'] = array('myisam_max_sort_file_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['myisam_mmap_size'] = array('myisam_mmap_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['myisam_recover_options'] = array('myisam_recover_options','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['myisam_repair_threads'] = array('myisam_repair_threads','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['myisam_sort_buffer_size'] = array('myisam_sort_buffer_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['myisam_sort_buffer_size'] = array('myisam_sort_buffer_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['myisam_stats_method'] = array('myisam_stats_method','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['myisam_use_mmap'] = array('myisam_use_mmap','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['named_pipe'] = array('named_pipe','server-system-variables','sysvar');
|
||||
@ -234,25 +235,25 @@ $VARIABLE_DOC_LINKS['performance_schema_max_thread_instances'] = array('performa
|
||||
$VARIABLE_DOC_LINKS['pid_file'] = array('pid-file','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['plugin_dir'] = array('plugin_dir','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['port'] = array('port','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['preload_buffer_size'] = array('preload_buffer_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['preload_buffer_size'] = array('preload_buffer_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['profiling'] = array('profiling','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['profiling_history_size'] = array('profiling_history_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['protocol_version'] = array('protocol_version','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['proxy_user'] = array('proxy_user','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['pseudo_thread_id'] = array('pseudo_thread_id','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['query_alloc_block_size'] = array('query_alloc_block_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['query_alloc_block_size'] = array('query_alloc_block_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['query_cache_limit'] = array('query_cache_limit','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['query_cache_min_res_unit'] = array('query_cache_min_res_unit','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['query_cache_size'] = array('query_cache_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['query_cache_size'] = array('query_cache_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['query_cache_type'] = array('query_cache_type','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['query_cache_wlock_invalidate'] = array('query_cache_wlock_invalidate','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['query_prealloc_size'] = array('query_prealloc_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['query_prealloc_size'] = array('query_prealloc_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['rand_seed1'] = array('rand_seed1','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['rand_seed2'] = array('rand_seed2','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['range_alloc_block_size'] = array('range_alloc_block_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['read_buffer_size'] = array('read_buffer_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['range_alloc_block_size'] = array('range_alloc_block_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['read_buffer_size'] = array('read_buffer_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['read_only'] = array('read_only','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['read_rnd_buffer_size'] = array('read_rnd_buffer_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['read_rnd_buffer_size'] = array('read_rnd_buffer_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['relay-log-index'] = array('relay-log-index','replication-options-slave','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['relay_log_index'] = array('relay_log_index','replication-options-slave','sysvar');
|
||||
$VARIABLE_DOC_LINKS['relay_log_info_file'] = array('relay_log_info_file','replication-options-slave','sysvar');
|
||||
@ -291,7 +292,7 @@ $VARIABLE_DOC_LINKS['slow_launch_time'] = array('slow_launch_time','server-syste
|
||||
$VARIABLE_DOC_LINKS['slow_query_log'] = array('slow-query-log','server-options','server-system-variables');
|
||||
$VARIABLE_DOC_LINKS['slow_query_log_file'] = array('slow_query_log_file','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['socket'] = array('socket','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['sort_buffer_size'] = array('sort_buffer_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['sort_buffer_size'] = array('sort_buffer_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['sql_auto_is_null'] = array('sql_auto_is_null','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['sql_big_selects'] = array('sql_big_selects','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['sql_big_tables'] = array('big-tables','server-options','server-system-variables');
|
||||
@ -332,10 +333,10 @@ $VARIABLE_DOC_LINKS['time_format'] = array('time_format','server-system-variable
|
||||
$VARIABLE_DOC_LINKS['time_zone'] = array('time_zone','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['timed_mutexes'] = array('timed_mutexes','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['timestamp'] = array('timestamp','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['tmp_table_size'] = array('tmp_table_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['tmp_table_size'] = array('tmp_table_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['tmpdir'] = array('tmpdir','server-options','option_mysqld');
|
||||
$VARIABLE_DOC_LINKS['transaction_alloc_block_size'] = array('transaction_alloc_block_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['transaction_prealloc_size'] = array('transaction_prealloc_size','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['transaction_alloc_block_size'] = array('transaction_alloc_block_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['transaction_prealloc_size'] = array('transaction_prealloc_size','server-system-variables','sysvar','byte');
|
||||
$VARIABLE_DOC_LINKS['tx_isolation'] = array('tx_isolation','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['unique_checks'] = array('unique_checks','server-system-variables','sysvar');
|
||||
$VARIABLE_DOC_LINKS['updatable_views_with_limit'] = array('updatable_views_with_limit','server-system-variables','sysvar');
|
||||
|
||||
@ -59,7 +59,7 @@ require_once './libraries/RecentTable.class.php';
|
||||
* Check if it is an ajax request to reload the recent tables list.
|
||||
*/
|
||||
if ($GLOBALS['is_ajax_request'] && $_REQUEST['recent_table']) {
|
||||
PMA_ajaxResponse('', true, array('options' => RecentTable::getInstance()->getHtmlSelectOption()) );
|
||||
PMA_ajaxResponse('', true, array('options' => PMA_RecentTable::getInstance()->getHtmlSelectOption()) );
|
||||
}
|
||||
|
||||
// keep the offset of the db list in session before closing it
|
||||
@ -195,7 +195,7 @@ require './libraries/navigation_header.inc.php';
|
||||
// display recently used tables
|
||||
if ($GLOBALS['cfg']['LeftRecentTable'] > 0) {
|
||||
echo '<div id="recentTableList">';
|
||||
echo RecentTable::getInstance()->getHtmlSelect();
|
||||
echo PMA_RecentTable::getInstance()->getHtmlSelect();
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
1508
po/be@latin.po
1508
po/be@latin.po
File diff suppressed because it is too large
Load Diff
1437
po/en_GB.po
1437
po/en_GB.po
File diff suppressed because it is too large
Load Diff
1278
po/phpmyadmin.pot
1278
po/phpmyadmin.pot
File diff suppressed because it is too large
Load Diff
1515
po/pt_BR.po
1515
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
1498
po/sr@latin.po
1498
po/sr@latin.po
File diff suppressed because it is too large
Load Diff
1404
po/uz@latin.po
1404
po/uz@latin.po
File diff suppressed because it is too large
Load Diff
1436
po/zh_CN.po
1436
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
1593
po/zh_TW.po
1593
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
# vim: expandtab sw=4 ts=4 sts=4:
|
||||
export LC_COLLATE=C
|
||||
export LANG=C
|
||||
LOCS=`ls po/*.po | sed 's@.*/\(.*\)\.po@\1@'`
|
||||
xgettext \
|
||||
-d phpmyadmin \
|
||||
@ -12,7 +12,7 @@ xgettext \
|
||||
--debug \
|
||||
--keyword=__ --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \
|
||||
--copyright-holder="phpMyAdmin devel team" \
|
||||
`find . -name '*.php' | sort`
|
||||
`find . -name '*.php' -not -path './test/*' | sort`
|
||||
|
||||
ver=`sed -n "/PMA_VERSION', '/ s/.*PMA_VERSION', '\(.*\)'.*/\1/p" libraries/Config.class.php`
|
||||
|
||||
|
||||
@ -1698,7 +1698,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
||||
|
||||
unset ($row);
|
||||
echo ' <fieldset id="fieldset_add_user">' . "\n"
|
||||
. ' <a href="server_privileges.php?' . $GLOBALS['url_query'] . '&adduser=1">' . "\n"
|
||||
. ' <a href="server_privileges.php?' . $GLOBALS['url_query'] . '&adduser=1" class="' . $conditional_class . '">' . "\n"
|
||||
. PMA_getIcon('b_usradd.png')
|
||||
. ' ' . __('Add user') . '</a>' . "\n"
|
||||
. ' </fieldset>' . "\n";
|
||||
|
||||
@ -14,6 +14,7 @@ require_once './libraries/common.inc.php';
|
||||
* Does the common work
|
||||
*/
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
$GLOBALS['js_include'][] = 'makegrid.js';
|
||||
$GLOBALS['js_include'][] = 'sql.js';
|
||||
|
||||
require_once './libraries/server_common.inc.php';
|
||||
|
||||
@ -15,29 +15,48 @@ if (! defined('PMA_NO_VARIABLES_IMPORT')) {
|
||||
define('PMA_NO_VARIABLES_IMPORT', true);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true)
|
||||
$GLOBALS['is_header_sent'] = true;
|
||||
|
||||
require_once './libraries/common.inc.php';
|
||||
|
||||
/**
|
||||
* Function to output refresh rate selection.
|
||||
*/
|
||||
function PMA_choose_refresh_rate() {
|
||||
echo '<option value="5">' . __('Refresh rate') . '</option>';
|
||||
foreach (array(1, 2, 5, 20, 40, 60, 120, 300, 600) as $rate) {
|
||||
if ($rate % 60 == 0) {
|
||||
$minrate = $rate / 60;
|
||||
echo '<option value="' . $rate . '">' . sprintf(_ngettext('%d minute', '%d minutes', $minrate), $minrate) . '</option>';
|
||||
} else {
|
||||
echo '<option value="' . $rate . '">' . sprintf(_ngettext('%d second', '%d seconds', $rate), $rate) . '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax request
|
||||
*/
|
||||
|
||||
// Prevent ajax requests from being cached
|
||||
if (isset($_REQUEST['ajax_request'])) {
|
||||
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||
header_remove('Last-Modified');
|
||||
if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
|
||||
// Send with correct charset
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
if (isset($_REQUEST["query_chart"])) {
|
||||
exit(createQueryChart());
|
||||
}
|
||||
if(isset($_REQUEST['chart_data'])) {
|
||||
// real-time charting data
|
||||
if (isset($_REQUEST['chart_data'])) {
|
||||
switch($_REQUEST['type']) {
|
||||
case 'proc':
|
||||
$c = PMA_DBI_fetch_result('SHOW GLOBAL STATUS WHERE Variable_name="Connections"', 0, 1);
|
||||
$result = PMA_DBI_query('SHOW PROCESSLIST');
|
||||
$num_procs = PMA_DBI_num_rows($result);
|
||||
|
||||
$ret = Array('x'=>(microtime(true)*1000),'y_proc'=>$num_procs,'y_conn'=>$c['Connections']);
|
||||
$ret = array(
|
||||
'x' => microtime(true)*1000,
|
||||
'y_proc' => $num_procs,
|
||||
'y_conn' => $c['Connections']
|
||||
);
|
||||
|
||||
exit(json_encode($ret));
|
||||
case 'queries':
|
||||
$queries = PMA_DBI_fetch_result('SHOW GLOBAL STATUS WHERE Variable_name LIKE "Com_%" AND Value>0', 0, 1);
|
||||
@ -45,13 +64,23 @@ if (isset($_REQUEST['ajax_request'])) {
|
||||
// admin commands are not queries
|
||||
unset($queries['Com_admin_commands']);
|
||||
|
||||
$sum=array_sum($queries);
|
||||
$ret = Array('x'=>(microtime(true)*1000),'y'=>$sum,'pointInfo'=>$queries);
|
||||
$sum = array_sum($queries);
|
||||
$ret = array(
|
||||
'x' => microtime(true)*1000,
|
||||
'y' => $sum,
|
||||
'pointInfo' => $queries
|
||||
);
|
||||
|
||||
exit(json_encode($ret));
|
||||
case 'traffic':
|
||||
$traffic = PMA_DBI_fetch_result('SHOW GLOBAL STATUS WHERE Variable_name="Bytes_received" OR Variable_name="Bytes_sent"', 0, 1);
|
||||
|
||||
$ret = Array('x'=>(microtime(true)*1000),'y_sent'=>$traffic['Bytes_sent'],'y_received'=>$traffic['Bytes_received']);
|
||||
$ret = array(
|
||||
'x' => microtime(true)*1000,
|
||||
'y_sent' => $traffic['Bytes_sent'],
|
||||
'y_received' => $traffic['Bytes_received']
|
||||
);
|
||||
|
||||
exit(json_encode($ret));
|
||||
|
||||
}
|
||||
@ -295,17 +324,17 @@ $links['innodb']['doc'] = 'innodb';
|
||||
|
||||
|
||||
// Variable to contain all com_ variables
|
||||
$used_queries = Array();
|
||||
$used_queries = array();
|
||||
|
||||
// Variable to map variable names to their respective section name (used for js category filtering)
|
||||
$allocationMap = Array();
|
||||
$allocationMap = array();
|
||||
|
||||
// sort vars into arrays
|
||||
foreach ($server_status as $name => $value) {
|
||||
foreach ($allocations as $filter => $section) {
|
||||
if (strpos($name, $filter) !== FALSE) {
|
||||
if (strpos($name, $filter) !== false) {
|
||||
$allocationMap[$name] = $section;
|
||||
if($section=='com' && $value>0) $used_queries[$name] = $value;
|
||||
if ($section == 'com' && $value > 0) $used_queries[$name] = $value;
|
||||
break; // Only exits inner loop
|
||||
}
|
||||
}
|
||||
@ -315,7 +344,7 @@ foreach ($server_status as $name => $value) {
|
||||
unset($used_queries['Com_admin_commands']);
|
||||
|
||||
/* Ajax request refresh */
|
||||
if(isset($_REQUEST['show']) && isset($_REQUEST['ajax_request'])) {
|
||||
if (isset($_REQUEST['show']) && isset($_REQUEST['ajax_request'])) {
|
||||
switch($_REQUEST['show']) {
|
||||
case 'query_statistics':
|
||||
printQueryStatistics();
|
||||
@ -360,8 +389,9 @@ pma_theme_image = '<?php echo $GLOBALS['pmaThemeImage']; ?>';
|
||||
/**
|
||||
* Displays the sub-page heading
|
||||
*/
|
||||
if($GLOBALS['cfg']['MainPageIconic'])
|
||||
if ($GLOBALS['cfg']['MainPageIconic']) {
|
||||
echo '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_status.png" width="16" height="16" alt="" />';
|
||||
}
|
||||
|
||||
echo __('Runtime Information');
|
||||
|
||||
@ -380,17 +410,7 @@ echo __('Runtime Information');
|
||||
<?php echo __('Refresh'); ?>
|
||||
</a>
|
||||
<select name="trafficChartRefresh" style="display:none;">
|
||||
<option value="5"><?php echo __('Refresh rate'); ?></option>
|
||||
<option value="1">1 <?php echo __('second'); ?></option>
|
||||
<option value="2">2 <?php echo __('seconds'); ?></option>
|
||||
<option value="5">5 <?php echo __('seconds'); ?></option>
|
||||
<option value="10">10 <?php echo __('seconds'); ?></option>
|
||||
<option value="20">20 <?php echo __('seconds'); ?></option>
|
||||
<option value="40">40 <?php echo __('seconds'); ?></option>
|
||||
<option value="60">1 <?php echo __('minutes'); ?></option>
|
||||
<option value="120">2 <?php echo __('minutes'); ?></option>
|
||||
<option value="300">5 <?php echo __('minutes'); ?></option>
|
||||
<option value="600">10 <?php echo __('minutes'); ?></option>
|
||||
<?php PMA_choose_refresh_rate(); ?>
|
||||
</select>
|
||||
|
||||
<a class="tabChart livetrafficLink" href="#">
|
||||
@ -413,17 +433,7 @@ echo __('Runtime Information');
|
||||
<?php echo __('Refresh'); ?>
|
||||
</a>
|
||||
<select name="queryChartRefresh" style="display:none;">
|
||||
<option value="5"><?php echo __('Refresh rate'); ?></option>
|
||||
<option value="1">1 <?php echo __('second'); ?></option>
|
||||
<option value="2">2 <?php echo __('seconds'); ?></option>
|
||||
<option value="5">5 <?php echo __('seconds'); ?></option>
|
||||
<option value="10">10 <?php echo __('seconds'); ?></option>
|
||||
<option value="20">20 <?php echo __('seconds'); ?></option>
|
||||
<option value="40">40 <?php echo __('seconds'); ?></option>
|
||||
<option value="60">1 <?php echo __('minutes'); ?></option>
|
||||
<option value="120">2 <?php echo __('minutes'); ?></option>
|
||||
<option value="300">5 <?php echo __('minutes'); ?></option>
|
||||
<option value="600">10 <?php echo __('minutes'); ?></option>
|
||||
<?php PMA_choose_refresh_rate(); ?>
|
||||
</select>
|
||||
<a class="tabChart livequeriesLink" href="#">
|
||||
<?php echo __('Live query chart'); ?>
|
||||
@ -454,7 +464,7 @@ echo __('Runtime Information');
|
||||
<select id="filterCategory" name="filterCategory">
|
||||
<option value=''><?php echo __('Filter by category...'); ?></option>
|
||||
<?php
|
||||
foreach($sections as $section_id=>$section_name) {
|
||||
foreach($sections as $section_id => $section_name) {
|
||||
?>
|
||||
<option value='<?php echo $section_id; ?>'><?php echo $section_name; ?></option>
|
||||
<?php
|
||||
@ -471,7 +481,7 @@ echo __('Runtime Information');
|
||||
echo '<span class="status_'.$section_name.'"> ';
|
||||
$i=0;
|
||||
foreach ($section_links as $link_name => $link_url) {
|
||||
if($i>0) echo ', ';
|
||||
if ($i > 0) echo ', ';
|
||||
if ('doc' == $link_name) {
|
||||
echo PMA_showMySQLDocu($link_url, $link_url);
|
||||
} else {
|
||||
@ -497,30 +507,32 @@ echo __('Runtime Information');
|
||||
function printQueryStatistics() {
|
||||
global $server_status, $used_queries, $url_query, $PMA_PHP_SELF;
|
||||
|
||||
$hour_factor = 3600 / $server_status['Uptime'];
|
||||
$hour_factor = 3600 / $server_status['Uptime'];
|
||||
|
||||
$total_queries = array_sum($used_queries);
|
||||
|
||||
?>
|
||||
<h3 id="serverstatusqueries"><?php echo
|
||||
//sprintf(__('<b>Query statistics</b>: Since its startup, %s queries have been sent to the server.'),
|
||||
//PMA_formatNumber($server_status['Questions'], 0));
|
||||
sprintf('Queries since startup: %s',PMA_formatNumber($total_queries, 0));
|
||||
//echo PMA_showMySQLDocu('server-status-variables', 'server-status-variables', false, 'statvar_Questions');
|
||||
<h3 id="serverstatusqueries">
|
||||
<?php
|
||||
echo sprintf('Queries since startup: %s',PMA_formatNumber($total_queries, 0));
|
||||
?>
|
||||
<br>
|
||||
<span style="font-size:60%; display:inline;">
|
||||
ø <?php echo __('per hour'); ?>:
|
||||
<?php echo PMA_formatNumber($total_queries * $hour_factor, 0); ?><br>
|
||||
<br>
|
||||
<span>
|
||||
<?php
|
||||
echo 'ø'.__('per hour').':';
|
||||
echo PMA_formatNumber($total_queries * $hour_factor, 0);
|
||||
echo '<br>';
|
||||
|
||||
ø <?php echo __('per minute'); ?>:
|
||||
<?php echo PMA_formatNumber( $total_queries * 60 / $server_status['Uptime'], 0); ?><br>
|
||||
|
||||
<?php if($total_queries / $server_status['Uptime'] >= 1) {
|
||||
?>
|
||||
ø <?php echo __('per second'); ?>:
|
||||
<?php echo PMA_formatNumber( $total_queries / $server_status['Uptime'], 0); ?><br>
|
||||
echo 'ø'.__('per minute').':';
|
||||
echo PMA_formatNumber( $total_queries * 60 / $server_status['Uptime'], 0);
|
||||
echo '<br>';
|
||||
|
||||
if ($total_queries / $server_status['Uptime'] >= 1) {
|
||||
echo 'ø'.__('per second').':';
|
||||
echo PMA_formatNumber( $total_queries / $server_status['Uptime'], 0);
|
||||
?>
|
||||
</span><br>
|
||||
</h3>
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -528,11 +540,11 @@ function printQueryStatistics() {
|
||||
arsort($used_queries);
|
||||
|
||||
$odd_row = true;
|
||||
$count_displayed_rows = 0;
|
||||
$perc_factor = 100 / $total_queries //(- $server_status['Connections']);
|
||||
$count_displayed_rows = 0;
|
||||
$perc_factor = 100 / $total_queries; //(- $server_status['Connections']);
|
||||
|
||||
?>
|
||||
</h3>
|
||||
|
||||
<table id="serverstatusqueriesdetails" class="data sortable">
|
||||
<col class="namecol" />
|
||||
<col class="valuecol" span="3" />
|
||||
@ -549,7 +561,7 @@ function printQueryStatistics() {
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$chart_json = Array();
|
||||
$chart_json = array();
|
||||
$query_sum = array_sum($used_queries);
|
||||
$other_sum = 0;
|
||||
foreach ($used_queries as $name => $value) {
|
||||
@ -558,9 +570,9 @@ function printQueryStatistics() {
|
||||
// For the percentage column, use Questions - Connections, because
|
||||
// the number of connections is not an item of the Query types
|
||||
// but is included in Questions. Then the total of the percentages is 100.
|
||||
$name = str_replace(Array('Com_','_'), Array('',' '), $name);
|
||||
$name = str_replace(array('Com_', '_'), array('', ' '), $name);
|
||||
|
||||
if($value < $query_sum * 0.02)
|
||||
if ($value < $query_sum * 0.02)
|
||||
$other_sum += $value;
|
||||
else $chart_json[$name] = $value;
|
||||
?>
|
||||
@ -578,21 +590,12 @@ function printQueryStatistics() {
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="serverstatusquerieschart" style="width:500px; height:350px; ">
|
||||
<div id="serverstatusquerieschart">
|
||||
<?php
|
||||
/*// Generate the graph if this is an ajax request
|
||||
if(isset($_REQUEST['ajax_request'])) {
|
||||
echo createQueryChart();
|
||||
} else {
|
||||
echo '<a href="'.$PMA_PHP_SELF.'?'.$url_query.'&query_chart=1#serverstatusqueries"'
|
||||
.'title="' . __('Show query chart') . '">['.__('Show query chart').']</a>';
|
||||
}*/
|
||||
|
||||
if($other_sum>0)
|
||||
if ($other_sum > 0)
|
||||
$chart_json[__('Other')] = $other_sum;
|
||||
|
||||
echo json_encode($chart_json);
|
||||
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
@ -611,10 +614,11 @@ function printServerTraffic() {
|
||||
'SELECT UNIX_TIMESTAMP() - ' . $server_status['Uptime']);
|
||||
|
||||
?>
|
||||
<h3><?php /* echo __('<b>Server traffic</b>: These tables show the network traffic statistics of this MySQL server since its startup.');*/
|
||||
echo sprintf(__('Network traffic since startup: %s'),
|
||||
implode(' ', PMA_formatByteDown( $server_status['Bytes_received'] + $server_status['Bytes_sent'], 3, 1))
|
||||
);
|
||||
<h3><?php
|
||||
echo sprintf(
|
||||
__('Network traffic since startup: %s'),
|
||||
implode(' ', PMA_formatByteDown( $server_status['Bytes_received'] + $server_status['Bytes_sent'], 3, 1))
|
||||
);
|
||||
?>
|
||||
</h3>
|
||||
|
||||
@ -636,7 +640,7 @@ function printServerTraffic() {
|
||||
} elseif ($server_slave_status) {
|
||||
echo __('This MySQL server works as <b>slave</b> in <b>replication</b> process.');
|
||||
}
|
||||
echo __('For further information about replication status on the server, please visit the <a href=#replication>replication section</a>.');
|
||||
echo __('For further information about replication status on the server, please visit the <a href="#replication">replication section</a>.');
|
||||
echo '</p>';
|
||||
}
|
||||
|
||||
@ -791,7 +795,7 @@ function printServerTraffic() {
|
||||
<th><?php echo __('Status'); ?></th>
|
||||
<th><?php
|
||||
echo __('SQL query');
|
||||
if (!PMA_DRIZZLE) { ?>
|
||||
if (! PMA_DRIZZLE) { ?>
|
||||
<a href="<?php echo $full_text_link; ?>"
|
||||
title="<?php echo empty($full) ? __('Show Full Queries') : __('Truncate Shown Queries'); ?>">
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'] . 's_' . (empty($_REQUEST['full']) ? 'full' : 'partial'); ?>text.png"
|
||||
@ -804,12 +808,12 @@ function printServerTraffic() {
|
||||
<tbody>
|
||||
<?php
|
||||
$odd_row = true;
|
||||
while($process = PMA_DBI_fetch_assoc($result)) {
|
||||
while ($process = PMA_DBI_fetch_assoc($result)) {
|
||||
if (PMA_DRIZZLE) {
|
||||
// Drizzle uses uppercase keys
|
||||
foreach ($process as $k => $v) {
|
||||
$k = $k !== 'DB'
|
||||
? $k = ucfirst(strtolower($k))
|
||||
? ucfirst(strtolower($k))
|
||||
: 'db';
|
||||
$process[$k] = $v;
|
||||
}
|
||||
@ -842,7 +846,7 @@ function printVariablesTable() {
|
||||
/**
|
||||
* Messages are built using the message name
|
||||
*/
|
||||
$strShowStatus = Array(
|
||||
$strShowStatus = array(
|
||||
'Aborted_connects' => __('The number of failed attempts to connect to the MySQL server.'),
|
||||
'Binlog_cache_disk_use' => __('The number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction.'),
|
||||
'Binlog_cache_use' => __('The number of transactions that used the temporary binary log cache.'),
|
||||
@ -1020,19 +1024,12 @@ function printVariablesTable() {
|
||||
<th><?php echo __('Description'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!--<tfoot>
|
||||
<tr class="tblFooters">
|
||||
<th colspan="3" class="tblFooters">
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>-->
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
$odd_row = false;
|
||||
foreach ($server_status as $name => $value) {
|
||||
$odd_row = !$odd_row;
|
||||
// $allocations
|
||||
?>
|
||||
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; echo isset($allocationMap[$name])?' s_'.$allocationMap[$name]:''; ?>">
|
||||
<th class="name"><?php echo htmlspecialchars($name) . PMA_showMySQLDocu('server-status-variables', 'server-status-variables', false, 'statvar_' . $name); ?>
|
||||
@ -1088,38 +1085,6 @@ function printVariablesTable() {
|
||||
<?php
|
||||
}
|
||||
|
||||
function createQueryChart($com_vars=FALSE) {
|
||||
/**
|
||||
* Chart generation
|
||||
*/
|
||||
require_once './libraries/chart.lib.php';
|
||||
|
||||
if(!$com_vars)
|
||||
$com_vars = PMA_DBI_fetch_result("SHOW GLOBAL STATUS LIKE 'Com\_%'", 0, 1);
|
||||
|
||||
// admin commands are not queries (e.g. they include COM_PING, which is excluded from $server_status['Questions'])
|
||||
unset($com_vars['Com_admin_commands']);
|
||||
|
||||
arsort($com_vars);
|
||||
|
||||
$merge_minimum = array_sum($com_vars) * 0.005;
|
||||
$merged_value = 0;
|
||||
|
||||
// remove zero values from the end, as well as merge together every value that is below 0.5%
|
||||
// variable empty for Drizzle
|
||||
if ($com_vars) {
|
||||
while (($last_element=end($com_vars)) <= $merge_minimum) {
|
||||
array_pop($com_vars);
|
||||
$merged_value += $last_element;
|
||||
}
|
||||
|
||||
$com_vars['Other'] = $merged_value;
|
||||
return PMA_chart_status($com_vars);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* cleanup of some deprecated values
|
||||
*/
|
||||
|
||||
@ -86,8 +86,10 @@ foreach ($serverVars as $name => $value) {
|
||||
<th nowrap="nowrap">
|
||||
<?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?></th>
|
||||
<td class="value"><?php
|
||||
if (strlen($value) < 16 && is_numeric($value)) {
|
||||
echo PMA_formatNumber($value, 0);
|
||||
if (is_numeric($value)) {
|
||||
if(isset($VARIABLE_DOC_LINKS[$name][3]) && $VARIABLE_DOC_LINKS[$name][3]=='byte')
|
||||
echo '<abbr title="'.PMA_formatNumber($value, 0).'">'.implode(' ',PMA_formatByteDown($value,3,3)).'</abbr>';
|
||||
else echo PMA_formatNumber($value, 0);
|
||||
$is_numeric = true;
|
||||
} else {
|
||||
echo htmlspecialchars($value);
|
||||
|
||||
23
sql.php
23
sql.php
@ -160,6 +160,17 @@ if(isset($_REQUEST['get_set_values']) && $_REQUEST['get_set_values'] == true) {
|
||||
$extra_data['select'] = $select;
|
||||
PMA_ajaxResponse(NULL, true, $extra_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check ajax request to set the column order
|
||||
*/
|
||||
if(isset($_REQUEST['set_col_order']) && $_REQUEST['set_col_order'] == true) {
|
||||
$pmatable = new PMA_Table($table, $db);
|
||||
$col_order = explode(',', $_REQUEST['col_order']);
|
||||
$retval = $pmatable->setUiProp(PMA_Table::PROP_COLUMN_ORDER, $col_order, $_REQUEST['table_create_time']);
|
||||
PMA_ajaxResponse(NULL, ($retval == true));
|
||||
}
|
||||
|
||||
// Default to browse if no query set and we have table
|
||||
// (needed for browsing from DefaultTabTable)
|
||||
if (empty($sql_query) && strlen($table) && strlen($db)) {
|
||||
@ -364,10 +375,13 @@ if ($is_select) { // see line 141
|
||||
$is_maint = true;
|
||||
}
|
||||
|
||||
// assign default full_sql_query
|
||||
$full_sql_query = $sql_query;
|
||||
|
||||
// Handle remembered sorting order, only for single table query
|
||||
if ($GLOBALS['cfg']['RememberSorting']
|
||||
&& basename($GLOBALS['PMA_PHP_SELF']) == 'sql.php'
|
||||
&& ! ($is_count || $is_export || $is_func || $is_analyse)
|
||||
&& count($analyzed_sql[0]['select_expr']) == 0
|
||||
&& isset($analyzed_sql[0]['queryflags']['select_from'])
|
||||
&& count($analyzed_sql[0]['table_ref']) == 1
|
||||
) {
|
||||
@ -377,7 +391,7 @@ if ($GLOBALS['cfg']['RememberSorting']
|
||||
if ($sorted_col) {
|
||||
// retrieve the remembered sorting order for current table
|
||||
$sql_order_to_append = ' ORDER BY ' . $sorted_col . ' ';
|
||||
$sql_query = $analyzed_sql[0]['section_before_limit'] . $sql_order_to_append . $analyzed_sql[0]['section_after_limit'];
|
||||
$full_sql_query = $analyzed_sql[0]['section_before_limit'] . $sql_order_to_append . $analyzed_sql[0]['section_after_limit'];
|
||||
|
||||
// update the $analyzed_sql
|
||||
$analyzed_sql[0]['section_before_limit'] .= $sql_order_to_append;
|
||||
@ -413,9 +427,7 @@ if ((! $cfg['ShowAll'] || $_SESSION['tmp_user_values']['max_rows'] != 'all')
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$full_sql_query = $sql_query;
|
||||
} // end if...else
|
||||
}
|
||||
|
||||
if (strlen($db)) {
|
||||
PMA_DBI_select_db($db);
|
||||
@ -847,6 +859,7 @@ else {
|
||||
} else {
|
||||
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
$GLOBALS['js_include'][] = 'makegrid.js';
|
||||
$GLOBALS['js_include'][] = 'sql.js';
|
||||
|
||||
unset($message);
|
||||
|
||||
@ -65,6 +65,7 @@ PMA_DBI_select_db($GLOBALS['db']);
|
||||
*/
|
||||
$goto_include = false;
|
||||
|
||||
$GLOBALS['js_include'][] = 'makegrid.js';
|
||||
// Needed for generation of Inline Edit anchors
|
||||
$GLOBALS['js_include'][] = 'sql.js';
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
require_once './libraries/common.inc.php';
|
||||
require_once './libraries/mysql_charsets.lib.php';
|
||||
|
||||
$GLOBALS['js_include'][] = 'makegrid.js';
|
||||
$GLOBALS['js_include'][] = 'sql.js';
|
||||
$GLOBALS['js_include'][] = 'tbl_select.js';
|
||||
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
|
||||
|
||||
@ -14,6 +14,7 @@ require_once './libraries/common.inc.php';
|
||||
* Runs common work
|
||||
*/
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
$GLOBALS['js_include'][] = 'makegrid.js';
|
||||
$GLOBALS['js_include'][] = 'sql.js';
|
||||
|
||||
require './libraries/tbl_common.php';
|
||||
|
||||
@ -156,7 +156,7 @@ echo sprintf(__('Welcome to %s'),
|
||||
|
||||
<form method="post" action="theme.php" target="_parent">
|
||||
<fieldset>
|
||||
<legend><?php echo __('Theme / Style'); ?></legend>
|
||||
<legend><?php echo __('Theme'); ?></legend>
|
||||
<?php
|
||||
echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox(false);
|
||||
?>
|
||||
|
||||
@ -17,7 +17,7 @@ $path_to_themes = $cfg['ThemePath'] . '/';
|
||||
require './libraries/header_http.inc.php';
|
||||
|
||||
/* HTML header */
|
||||
$page_title = 'phpMyAdmin - ' . __('Theme / Style');
|
||||
$page_title = 'phpMyAdmin - ' . __('Theme');
|
||||
require './libraries/header_meta_style.inc.php';
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
@ -37,7 +37,7 @@ function takeThis(what){
|
||||
</head>
|
||||
|
||||
<body id="bodythemes">
|
||||
<h1>phpMyAdmin - <?php echo __('Theme / Style'); ?></h1>
|
||||
<h1>phpMyAdmin - <?php echo __('Theme'); ?></h1>
|
||||
<p><a href="<?php echo PMA_linkURL('http://www.phpmyadmin.net/home_page/themes.php'); ?>#pma_<?php echo preg_replace('/([0-9]*)\.([0-9]*)\..*/', '\1_\2', PMA_VERSION); ?>"><?php echo __('Get more themes!'); ?></a></p>
|
||||
<?php
|
||||
$_SESSION['PMA_Theme_Manager']->printPreviews();
|
||||
|
||||
@ -258,6 +258,10 @@ td.null {
|
||||
text-align: <?php echo $right; ?>;
|
||||
}
|
||||
|
||||
table .valueHeader {
|
||||
text-align: <?php echo $right; ?>;
|
||||
white-space: normal;
|
||||
}
|
||||
table .value {
|
||||
text-align: <?php echo $right; ?>;
|
||||
white-space: normal;
|
||||
@ -960,6 +964,11 @@ img.sortableIcon {
|
||||
background-repeat:no-repeat;
|
||||
}
|
||||
|
||||
h3#serverstatusqueries span {
|
||||
font-size:60%;
|
||||
display:inline;
|
||||
}
|
||||
|
||||
table#serverstatusqueriesdetails th img.sortableIcon, table#serverstatusvariables th img.sortableIcon {
|
||||
background-image:url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>s_sortable.png);
|
||||
}
|
||||
@ -990,6 +999,8 @@ div#serverstatus table caption a.top {
|
||||
|
||||
div#serverstatusquerieschart {
|
||||
float:<?php echo $right; ?>;
|
||||
width:500px;
|
||||
height:350px;
|
||||
}
|
||||
|
||||
div#serverstatus table#serverstatusqueriesdetails {
|
||||
@ -1035,6 +1046,14 @@ div#serverstatus table tbody td.descr a:after,
|
||||
div#serverstatus table .tblFooters a:after {
|
||||
content: ']';
|
||||
}
|
||||
|
||||
div.liveChart {
|
||||
clear:both;
|
||||
min-width:500px;
|
||||
height:400px;
|
||||
padding-bottom:80px;
|
||||
}
|
||||
|
||||
/* end serverstatus */
|
||||
|
||||
/* querywindow */
|
||||
@ -1913,3 +1932,68 @@ span.mysql-separator {
|
||||
span.mysql-number {
|
||||
color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['digit_integer']; ?>;
|
||||
}
|
||||
|
||||
.colborder {
|
||||
border-right: solid 1px #FFFFFF;
|
||||
cursor: col-resize;
|
||||
height: 100%;
|
||||
margin-left: -3px;
|
||||
position: absolute;
|
||||
width: 5px;
|
||||
}
|
||||
|
||||
.pma_table th.draggable span, .pma_table tbody td span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.cRsz {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.draggable {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.cCpy {
|
||||
background: #000;
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
margin: 0.1em;
|
||||
padding: 0.3em;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.cPointer {
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>col_pointer.png);
|
||||
height: 20px;
|
||||
margin-left: -5px; /* must be minus half of its width */
|
||||
margin-top: -10px;
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
.cPointerVer { /* cPointer with vertical display mode */
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>col_pointer_ver.png);
|
||||
height: 10px;
|
||||
margin-left: -5px;
|
||||
margin-top: -5px; /* must be minus half of its height */
|
||||
position: absolute;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.dHint {
|
||||
background: #333;
|
||||
border:1px solid #000;
|
||||
color: #FFF;
|
||||
font-size: 0.8em;
|
||||
font-weight: bold;
|
||||
margin-top: -1em;
|
||||
opacity: 0.8;
|
||||
padding: 0.5em 1em;
|
||||
position: absolute;
|
||||
text-shadow: -1px -1px #000;
|
||||
-moz-border-radius: 0.3em;
|
||||
-webkit-border-radius: 0.3em;
|
||||
border-radius: 0.3em;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user