');
chartSpacing = {
- width: $('table#chartGrid td:nth-child(2)').offset().left
+ width: $('table#chartGrid td:nth-child(2)').offset().left
- $('table#chartGrid td:nth-child(1)').offset().left,
- height: $('table#chartGrid tr:nth-child(2) td:nth-child(2)').offset().top
+ height: $('table#chartGrid tr:nth-child(2) td:nth-child(2)').offset().top
- $('table#chartGrid tr:nth-child(1) td:nth-child(1)').offset().top
}
$('table#chartGrid').html('');
-
+
/* Add all charts - in correct order */
var keys = [];
$.each(runtime.charts, function(key, value) {
@@ -959,11 +959,11 @@ $(function() {
// Empty cells should keep their size so you can drop onto them
$('table#chartGrid tr td').css('width', chartSize().width + 'px');
-
+
buildRequiredDataList();
refreshChartGrid();
}
-
+
/* Destroys all monitor related resources */
function destroyGrid() {
if (runtime.charts) {
@@ -973,22 +973,22 @@ $(function() {
} catch(err) {}
});
}
-
+
try {
runtime.refreshRequest.abort();
} catch(err) {}
- try {
+ try {
clearTimeout(runtime.refreshTimeout);
} catch(err) {}
-
+
$('table#chartGrid').html('');
runtime.charts = null;
runtime.chartAI = 0;
monitorSettings = null;
}
-
- /* Calls destroyGrid() and initGrid(), but before doing so it saves the chart
+
+ /* Calls destroyGrid() and initGrid(), but before doing so it saves the chart
* data from each chart and restores it after the monitor is initialized again */
function rebuildGrid() {
var oldData = null;
@@ -1002,10 +1002,10 @@ $(function() {
}
});
}
-
+
destroyGrid();
initGrid();
-
+
if (oldData) {
$.each(runtime.charts, function(key, chartObj) {
for (var j = 0; j < chartObj.nodes.length; j++) {
@@ -1014,7 +1014,7 @@ $(function() {
}
}
});
- }
+ }
}
/* Calculactes the dynamic chart size that depends on the column width */
@@ -1211,7 +1211,7 @@ $(function() {
if (! htmlnode ) {
return;
}
-
+
var chart = null;
var chartKey = null;
$.each(runtime.charts, function(key, value) {
@@ -1221,7 +1221,7 @@ $(function() {
return false;
}
});
-
+
if (chart == null) {
return;
}
@@ -1231,18 +1231,18 @@ $(function() {
for (var i = 0; i' + chart.nodes[i].dataPoints[0].name + ': ';
}
-
+
dlgBtns = {};
dlgBtns[PMA_messages['strSave']] = function() {
runtime.charts[chartKey].title = $('div#emptyDialog input[name="chartTitle"]').attr('value');
runtime.charts[chartKey].chart.setTitle({ text: runtime.charts[chartKey].title });
-
+
$('div#emptyDialog input[name*="chartSerie"]').each(function() {
var idx = $(this).attr('name').split('-')[1];
runtime.charts[chartKey].nodes[idx].name = $(this).attr('value');
runtime.charts[chartKey].chart.series[idx].name = $(this).attr('value');
});
-
+
$(this).dialog('close');
saveMonitor();
};
@@ -1271,7 +1271,7 @@ $(function() {
loadLog('slow', min, max);
$(this).dialog("close");
};
-
+
dlgBtns[PMA_messages['strFromGeneralLog']] = function() {
loadLog('general', min, max);
$(this).dialog("close");
@@ -1296,15 +1296,15 @@ $(function() {
limitTypes: $('input#limitTypes').prop('checked')
});
}
-
-
+
+
/* Removes a chart from the grid */
function removeChart(chartObj) {
var htmlnode = chartObj.options.chart.renderTo;
if (! htmlnode ) {
return;
}
-
+
$.each(runtime.charts, function(key, value) {
if (value.chart.options.chart.renderTo == htmlnode) {
delete runtime.charts[key];
@@ -1328,10 +1328,10 @@ $(function() {
function refreshChartGrid() {
/* Send to server */
runtime.refreshRequest = $.post('server_status.php?' + url_query, {
- ajax_request: true,
- chart_data: 1,
- type: 'chartgrid',
- requiredData: $.toJSON(runtime.dataList)
+ ajax_request: true,
+ chart_data: 1,
+ type: 'chartgrid',
+ requiredData: $.toJSON(runtime.dataList)
}, function(data) {
var chartData;
try {
@@ -1341,7 +1341,7 @@ $(function() {
}
var value, i = 0;
var diff;
-
+
/* Update values in each graph */
$.each(runtime.charts, function(orderKey, elem) {
var key = elem.chartID;
@@ -1366,7 +1366,7 @@ $(function() {
//elem.chart.xAxis[0].setExtremes(runtime.xmin, runtime.xmax, false);
/* Calculate y value */
-
+
// If transform function given, use it
if (elem.nodes[j].transformFn) {
value = chartValueTransform(
@@ -1382,7 +1382,7 @@ $(function() {
value = parseFloat(chartData[key][j][0].value);
if (elem.nodes[j].display == 'differential') {
- if (oldChartData == null || oldChartData[key] == null) {
+ if (oldChartData == null || oldChartData[key] == null) {
continue;
}
value -= oldChartData[key][j][0].value;
@@ -1392,7 +1392,7 @@ $(function() {
value = value / elem.nodes[j].valueDivisor;
}
}
-
+
// Set y value, if defined
if (value != undefined) {
elem.chart.series[j].data.push([chartData.x, value]);
@@ -1432,9 +1432,9 @@ $(function() {
runtime.refreshTimeout = setTimeout(refreshChartGrid, monitorSettings.gridRefresh);
});
}
-
+
/* Function that supplies special value transform functions for chart values */
- function chartValueTransform(name, cur, prev) {
+ function chartValueTransform(name, cur, prev) {
switch(name) {
case 'cpu-linux':
if (prev == null) {
@@ -1474,7 +1474,7 @@ $(function() {
*/
function buildRequiredDataList() {
runtime.dataList = {};
- // Store an own id, because the property name is subject of reordering,
+ // Store an own id, because the property name is subject of reordering,
// thus destroying our mapping with runtime.charts <=> runtime.dataList
var chartID = 0;
$.each(runtime.charts, function(key, chart) {
@@ -1498,10 +1498,10 @@ $(function() {
if (! opts.limitTypes) {
opts.limitTypes = false;
}
-
+
$('#emptyDialog').dialog({title: PMA_messages['strAnalysingLogsTitle']});
- $('#emptyDialog').html(PMA_messages['strAnalysingLogs'] +
- ' ');
var dlgBtns = {};
@@ -1529,14 +1529,14 @@ $(function() {
removeVariables: opts.removeVariables,
limitTypes: opts.limitTypes
},
- function(data) {
+ function(data) {
var logData;
try {
logData = $.parseJSON(data);
} catch(err) {
return serverResponseError();
}
-
+
if (logData.rows.length != 0) {
runtime.logDataCols = buildLogTable(logData);
@@ -1585,26 +1585,26 @@ $(function() {
$(this).dialog("close");
$(document).scrollTop($('div#logTable').offset().top);
};
-
+
$('#emptyDialog').dialog( "option", "buttons", dlgBtns);
-
+
} else {
$('#emptyDialog').dialog({title: PMA_messages['strNoDataFoundTitle']});
$('#emptyDialog').html('
' + PMA_messages['strNoDataFound'] + '
');
-
+
var dlgBtns = {};
- dlgBtns[PMA_messages['strClose']] = function() {
- $(this).dialog("close");
+ dlgBtns[PMA_messages['strClose']] = function() {
+ $(this).dialog("close");
};
-
+
$('#emptyDialog').dialog( "option", "buttons", dlgBtns );
}
}
);
- /* Handles the actions performed when the user uses any of the log table filters
+ /* Handles the actions performed when the user uses any of the log table filters
* which are the filter by name and grouping with ignoring data in WHERE clauses
- *
+ *
* @param boolean Should be true when the users enabled or disabled to group queries ignoring data in WHERE clauses
*/
function filterQueries(varFilterChange) {
@@ -1616,7 +1616,7 @@ $(function() {
} else {
textFilter = new RegExp(val, 'i');
}
-
+
var rowSum = 0, totalSum = 0, i = 0, q;
var noVars = $('div#logTable input#noWHEREData').attr('checked');
var equalsFilter = /([^=]+)=(\d+|((\'|"|).*?[^\\])\4((\s+)|$))/gi;
@@ -1627,7 +1627,7 @@ $(function() {
var sumColumnName = runtime.logDataCols[runtime.logDataCols.length - 1];
var isSlowLog = opts.src == 'slow';
var columnSums = {};
-
+
// For the slow log we have to count many columns (query_time, lock_time, rows_examined, rows_sent, etc.)
var countRow = function(query, row) {
var cells = row.match(/