Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/QA_4_2' into QA_4_2
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed May 18, 2014
2 parents 47399d8 + 1174903 commit ec9f73c
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 22 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -9,6 +9,7 @@ phpMyAdmin - ChangeLog
- bug Respect ['ShowCreateDb'] in the navi panel
- bug #4392 Cannot see databases in nav panel on databases grouping when disabled database expansion
- bug #4419 No more calendar into search tab
- bug #4398 Monitor should fit into screen width

4.2.1.0 (2014-05-13)
- bug #4380 Cannot display table structure with enums containing special characters
Expand Down
46 changes: 32 additions & 14 deletions js/server_status_monitor.js
Expand Up @@ -3,7 +3,8 @@ var runtime = {},
server_time_diff,
server_os,
is_superuser,
server_db_isLocal;
server_db_isLocal,
chartSize;
AJAX.registerOnload('server_status_monitor.js', function () {
var $js_data_form = $('#js_data');
server_time_diff = new Date().getTime() - $js_data_form.find("input[name=server_time]").val();
Expand Down Expand Up @@ -383,7 +384,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
$("#chartGrid").sortableTable({
ignoreRect: {
top: 8,
left: chartSize().width - 63,
left: chartSize.width - 63,
width: 54,
height: 24
}
Expand All @@ -400,10 +401,13 @@ AJAX.registerOnload('server_status_monitor.js', function () {
$('div.popupContent select[name="chartColumns"]').change(function () {
monitorSettings.columns = parseInt(this.value, 10);

var newSize = chartSize();

calculateChartSize();
// Empty cells should keep their size so you can drop onto them
$('#chartGrid tr td').css('width', newSize.width + 'px');
$('#chartGrid tr td').css('width', chartSize.width + 'px');
$('#chartGrid .monitorChart').css({
width: chartSize.width + 'px',
height: chartSize.height + 'px'
});

/* Reorder all charts that it fills all column cells */
var numColumns;
Expand Down Expand Up @@ -441,7 +445,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
}

if (monitorSettings.gridMaxPoints == 'auto') {
runtime.gridMaxPoints = Math.round((newSize.width - 40) / 12);
runtime.gridMaxPoints = Math.round((chartSize.width - 40) / 12);
}

runtime.xmin = new Date().getTime() - server_time_diff - runtime.gridMaxPoints * monitorSettings.gridRefresh;
Expand All @@ -451,6 +455,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
$("#chartGrid").sortableTable('refresh');
}

refreshChartGrid();
saveMonitor(); // Save settings
});

Expand Down Expand Up @@ -999,7 +1004,8 @@ AJAX.registerOnload('server_status_monitor.js', function () {
}

// Empty cells should keep their size so you can drop onto them
$('#chartGrid tr td').css('width', chartSize().width + 'px');
calculateChartSize();
$('#chartGrid tr td').css('width', chartSize.width + 'px');

buildRequiredDataList();
refreshChartGrid();
Expand All @@ -1026,11 +1032,18 @@ AJAX.registerOnload('server_status_monitor.js', function () {
}

/* Calculactes the dynamic chart size that depends on the column width */
function chartSize() {
var wdt = $('#logTable').innerWidth() / monitorSettings.columns - (monitorSettings.columns - 1) * chartSpacing.width;
return {
width: wdt,
height: 0.75 * wdt
function calculateChartSize() {
var panelWidth;
if ($("body").height() > $(window).height()) { // has vertical scroll bar
panelWidth = $('#logTable').innerWidth();
} else {
panelWidth = $('#logTable').innerWidth() - 10; // leave some space for vertical scroll bar
}

var wdt = (panelWidth - monitorSettings.columns * chartSpacing.width) / monitorSettings.columns;
chartSize = {
width: Math.floor(wdt),
height: Math.floor(0.75 * wdt)
};
}

Expand Down Expand Up @@ -1115,10 +1128,15 @@ AJAX.registerOnload('server_status_monitor.js', function () {
$('#chartGrid').append('<tr></tr>');
}

if (!chartSize) {
calculateChartSize();
}
$('#chartGrid tr:last').append(
'<td><div id="gridChartContainer' + runtime.chartAI + '" class="">' +
'<div class="ui-state-default monitorChart" id="' +
'gridchart' + runtime.chartAI + '"></div></div></td>'
'<div class="ui-state-default monitorChart"' +
' id="gridchart' + runtime.chartAI + '"' +
' style="width:' + chartSize.width + 'px; height:' + chartSize.height + 'px;"></div>' +
'</div></td>'
);
}

Expand Down
4 changes: 0 additions & 4 deletions libraries/server_status_monitor.lib.php
Expand Up @@ -345,10 +345,6 @@ function PMA_getHtmlForSettingsDialog()
$retval .= '<option>4</option>';
$retval .= '<option>5</option>';
$retval .= '<option>6</option>';
$retval .= '<option>7</option>';
$retval .= '<option>8</option>';
$retval .= '<option>9</option>';
$retval .= '<option>10</option>';
$retval .= '</select>';
$retval .= '</div>';
$retval .= '<div class="clearfloat paddingtop">';
Expand Down
9 changes: 7 additions & 2 deletions themes/original/css/common.css.php
Expand Up @@ -1023,10 +1023,15 @@
margin-left:10px;
}

table#chartGrid td {
padding: 3px;
margin: 0;
}

table#chartGrid div.monitorChart {
background: #EBEBEB;
width: 400px;
height: 300px;
overflow: hidden;
border: none;
}

div#serverstatus div.tabLinks {
Expand Down
9 changes: 7 additions & 2 deletions themes/pmahomme/css/common.css.php
Expand Up @@ -1336,10 +1336,15 @@
margin-left: 10px;
}

table#chartGrid td {
padding: 3px;
margin: 0;
}

table#chartGrid div.monitorChart {
background: #EBEBEB;
width: 400px;
height: 300px;
overflow: hidden;
border: none;
}

div#serverstatus div.tabLinks {
Expand Down

0 comments on commit ec9f73c

Please sign in to comment.