Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed May 5, 2013
2 parents c2de733 + 5fcab7b commit b493a89
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 95 deletions.
2 changes: 1 addition & 1 deletion js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ AJAX.registerOnload('config.js', function () {

// detect localStorage state
var ls_supported = window.localStorage || false;
var ls_exists = ls_supported ? (window.localStorage['config'] || false) : false;
var ls_exists = ls_supported ? (window.localStorage.config || false) : false;
$('div.localStorage-' + (ls_supported ? 'un' : '') + 'supported').hide();
$('div.localStorage-' + (ls_exists ? 'empty' : 'exists')).hide();
if (ls_exists) {
Expand Down
4 changes: 2 additions & 2 deletions js/makegrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1444,9 +1444,9 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
.dblclick(function (e) {
e.preventDefault();
$("<div/>")
.prop("title", PMA_messages["strColNameCopyTitle"])
.prop("title", PMA_messages.strColNameCopyTitle)
.addClass("modal-copy")
.text(PMA_messages["strColNameCopyText"])
.text(PMA_messages.strColNameCopyText)
.append(
$("<input/>")
.prop("readonly", true)
Expand Down
4 changes: 2 additions & 2 deletions js/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ $(function () {
if (this.value !== '') {
var arr = jQuery.parseJSON(this.value);
var $form = $(this).closest('form');
$form.find('input[name=db]').val(arr['db']);
$form.find('input[name=table]').val(arr['table']);
$form.find('input[name=db]').val(arr.db);
$form.find('input[name=table]').val(arr.table);
$form.submit();
}
});
Expand Down
12 changes: 6 additions & 6 deletions js/server_privileges.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
*/
function checkAddUser(the_form)
{
if (the_form.elements['pred_hostname'].value == 'userdefined' && the_form.elements['hostname'].value === '') {
if (the_form.elements.pred_hostname.value == 'userdefined' && the_form.elements.hostname.value === '') {
alert(PMA_messages.strHostEmpty);
the_form.elements['hostname'].focus();
the_form.elements.hostname.focus();
return false;
}

if (the_form.elements['pred_username'].value == 'userdefined' && the_form.elements['username'].value === '') {
if (the_form.elements.pred_username.value == 'userdefined' && the_form.elements.username.value === '') {
alert(PMA_messages.strUserEmpty);
the_form.elements['username'].focus();
the_form.elements.username.focus();
return false;
}

Expand Down Expand Up @@ -196,7 +196,7 @@ AJAX.registerOnload('server_privileges.js', function () {
'username' : username
};
$.get(href, params, function(data) {
if (data['user_exists']) {
if (data.user_exists) {
$warning.show();
} else {
$warning.hide();
Expand Down Expand Up @@ -405,7 +405,7 @@ AJAX.registerOnload('server_privileges.js', function () {

// If any option other than 'keep the old one'(option 4) is chosen, we need to remove
// the old one from the table.
var $row_to_remove = null;
var $row_to_remove;
if (curr_submit_name == 'change_copy'
&& $('input[name=mode]:checked', '#fieldset_mode').val() != '4') {
var old_username = $t.find('input[name="old_username"]').val();
Expand Down
4 changes: 2 additions & 2 deletions js/tbl_zoom_plot_jqplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
}
}
sql_query = sql_query.substring(0, sql_query.length - 2);
sql_query += ' WHERE ' + PMA_urldecode(searchedData[searchedDataKey]['where_clause']);
sql_query += ' WHERE ' + PMA_urldecode(searchedData[searchedDataKey].where_clause);

//Post SQL query to sql.php
$.post('sql.php', {
Expand Down Expand Up @@ -546,7 +546,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
// extra Y values
value[dataLabel], // for highlighter
// (may set an undefined value)
value['where_clause'], // for click on point
value.where_clause, // for click on point
key // key from searchedData
]);
});
Expand Down
35 changes: 25 additions & 10 deletions server_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,30 @@
*/
function getServerTrafficHtml($ServerStatusData)
{
//display the server state General Information
$retval = getServerStateGeneralInfoHtml($ServerStatusData);

//display the server state traffic
$retval .= getServerStateTrafficHtml($ServerStatusData);

//display the server state connection information
$retval .= getServerStateConnectionsHtml($ServerStatusData);

//display the Table Process List information
$retval .= getTableProcesslistHtml($ServerStatusData);

return $retval;
}

/**
* Prints server state General information
*
* @param Object $ServerStatusData An instance of the PMA_ServerStatusData class
*
* @return string
*/
function getServerStateGeneralInfoHtml($ServerStatusData)
{
$hour_factor = 3600 / $ServerStatusData->status['Uptime'];
$start_time = PMA_DBI_fetchValue(
'SELECT UNIX_TIMESTAMP() - ' . $ServerStatusData->status['Uptime']
Expand Down Expand Up @@ -127,16 +151,7 @@ function getServerTrafficHtml($ServerStatusData)
}
}
}

//display the server state traffic
$retval .= getServerStateTrafficHtml($ServerStatusData);

//display the server state connection information
$retval .= getServerStateConnectionsHtml($ServerStatusData);

//display the Table Process List information
$retval .= getTableProcesslistHtml($ServerStatusData);


return $retval;
}

Expand Down
171 changes: 99 additions & 72 deletions server_status_monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,78 +467,8 @@
*/
function getPrintMonitorHtml($ServerStatusData)
{
$retval = '<div class="tabLinks">';
$retval .= '<a href="#pauseCharts">';
$retval .= PMA_Util::getImage('play.png') . __('Start Monitor');
$retval .= '</a>';
$retval .= '<a href="#settingsPopup" class="popupLink">';
$retval .= PMA_Util::getImage('s_cog.png') . __('Settings');
$retval .= '</a>';
if (! PMA_DRIZZLE) {
$retval .= '<a href="#monitorInstructionsDialog">';
$retval .= PMA_Util::getImage('b_help.png') . __('Instructions/Setup');
}
$retval .= '<a href="#endChartEditMode" style="display:none;">';
$retval .= PMA_Util::getImage('s_okay.png');
$retval .= __('Done rearranging/editing charts');
$retval .= '</a>';
$retval .= '</div>';

$retval .= '<div class="popupContent settingsPopup">';
$retval .= '<a href="#addNewChart">';
$retval .= PMA_Util::getImage('b_chart.png') . __('Add chart');
$retval .= '</a>';
//$retval .= '<a href="#rearrangeCharts">';
//$retval .= PMA_Util::getImage('b_tblops.png') . __('Rearrange/edit charts');
//$retval .= '</a>';
$retval .= '<div class="clearfloat paddingtop"></div>';
$retval .= '<div class="floatleft">';
$retval .= __('Refresh rate') . '<br />';
$retval .= PMA_getRefreshList(
'gridChartRefresh',
5,
Array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200)
);
$retval .= '<br />';
$retval .= '</div>';
$retval .= '<div class="floatleft">';
$retval .= __('Chart columns');
$retval .= '<br />';
$retval .= '<select name="chartColumns">';
$retval .= '<option>1</option>';
$retval .= '<option>2</option>';
$retval .= '<option>3</option>';
$retval .= '<option>4</option>';
$retval .= '<option>5</option>';
$retval .= '<option>6</option>';
$retval .= '<option>7</option>';
$retval .= '<option>8</option>';
$retval .= '<option>9</option>';
$retval .= '<option>10</option>';
$retval .= '</select>';
$retval .= '</div>';
$retval .= '<div class="clearfloat paddingtop">';
$retval .= '<b>' . __('Chart arrangement') . '</b> ';
$retval .= PMA_Util::showHint(
__(
'The arrangement of the charts is stored to the browsers local storage. '
. 'You may want to export it if you have a complicated set up.'
)
);
$retval .= '<br/>';
$retval .= '<a class="ajax" href="#importMonitorConfig">';
$retval .= __('Import');
$retval .= '</a>';
$retval .= '&nbsp;&nbsp;';
$retval .= '<a class="disableAjax" href="#exportMonitorConfig">';
$retval .= __('Export');
$retval .= '</a>';
$retval .= '&nbsp;&nbsp;';
$retval .= '<a href="#clearMonitorConfig">';
$retval .= __('Reset to default');
$retval .= '</a>';
$retval .= '</div>';
$retval .= '</div>';
$retval = getTabLinksHtml();
$retval .= getPopContentHtml();

$retval .= '<div id="monitorInstructionsDialog" title="';
$retval .= __('Monitor Instructions') . '" style="display:none;">';
Expand Down Expand Up @@ -753,4 +683,101 @@ function PMA_getRefreshList($name,
return $return;
}

/**
* Prints html with Tab Links
*
* @param null
*
* @return string
*/
function getTabLinksHtml()
{
$retval = '<div class="tabLinks">';
$retval .= '<a href="#pauseCharts">';
$retval .= PMA_Util::getImage('play.png') . __('Start Monitor');
$retval .= '</a>';
$retval .= '<a href="#settingsPopup" class="popupLink">';
$retval .= PMA_Util::getImage('s_cog.png') . __('Settings');
$retval .= '</a>';
if (! PMA_DRIZZLE) {
$retval .= '<a href="#monitorInstructionsDialog">';
$retval .= PMA_Util::getImage('b_help.png') . __('Instructions/Setup');
}
$retval .= '<a href="#endChartEditMode" style="display:none;">';
$retval .= PMA_Util::getImage('s_okay.png');
$retval .= __('Done rearranging/editing charts');
$retval .= '</a>';
$retval .= '</div>';

return $retval;
}

/**
* Prints html with Pop Content
*
* @param null
*
* @return string
*/
function getPopContentHtml()
{
$retval = '<div class="popupContent settingsPopup">';
$retval .= '<a href="#addNewChart">';
$retval .= PMA_Util::getImage('b_chart.png') . __('Add chart');
$retval .= '</a>';
//$retval .= '<a href="#rearrangeCharts">';
//$retval .= PMA_Util::getImage('b_tblops.png') . __('Rearrange/edit charts');
//$retval .= '</a>';
$retval .= '<div class="clearfloat paddingtop"></div>';
$retval .= '<div class="floatleft">';
$retval .= __('Refresh rate') . '<br />';
$retval .= PMA_getRefreshList(
'gridChartRefresh',
5,
Array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200)
);
$retval .= '<br />';
$retval .= '</div>';
$retval .= '<div class="floatleft">';
$retval .= __('Chart columns');
$retval .= '<br />';
$retval .= '<select name="chartColumns">';
$retval .= '<option>1</option>';
$retval .= '<option>2</option>';
$retval .= '<option>3</option>';
$retval .= '<option>4</option>';
$retval .= '<option>5</option>';
$retval .= '<option>6</option>';
$retval .= '<option>7</option>';
$retval .= '<option>8</option>';
$retval .= '<option>9</option>';
$retval .= '<option>10</option>';
$retval .= '</select>';
$retval .= '</div>';
$retval .= '<div class="clearfloat paddingtop">';
$retval .= '<b>' . __('Chart arrangement') . '</b> ';
$retval .= PMA_Util::showHint(
__(
'The arrangement of the charts is stored to the browsers local storage. '
. 'You may want to export it if you have a complicated set up.'
)
);
$retval .= '<br/>';
$retval .= '<a class="ajax" href="#importMonitorConfig">';
$retval .= __('Import');
$retval .= '</a>';
$retval .= '&nbsp;&nbsp;';
$retval .= '<a class="disableAjax" href="#exportMonitorConfig">';
$retval .= __('Export');
$retval .= '</a>';
$retval .= '&nbsp;&nbsp;';
$retval .= '<a href="#clearMonitorConfig">';
$retval .= __('Reset to default');
$retval .= '</a>';
$retval .= '</div>';
$retval .= '</div>';

return $retval;
}

?>

0 comments on commit b493a89

Please sign in to comment.