Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed export of server status monitor settings

  • Loading branch information...
commit b2cbb2d779eb82de75697d93bd2a31aedfe21614 1 parent 5b4bf0c
@roccivic roccivic authored
Showing with 19 additions and 11 deletions.
  1. +3 −2 file_echo.php
  2. +16 −9 js/server_status_monitor.js
View
5 file_echo.php
@@ -7,6 +7,7 @@
* @package PhpMyAdmin
*/
+define('PMA_MINIMUM_COMMON', true);
require_once 'libraries/common.inc.php';
/* For chart exporting */
@@ -49,14 +50,14 @@
}
/* Send download header */
- PMA_download_header($filename, $_REQUEST['type'], strlen($data));
+ PMA_downloadHeader($filename, $_REQUEST['type'], strlen($data));
/* Send data */
echo $data;
} else if (isset($_REQUEST['monitorconfig'])) {
/* For monitor chart config export */
- PMA_download_header('monitor.cfg', 'application/force-download');
+ PMA_downloadHeader('monitor.cfg', 'application/force-download');
echo urldecode($_REQUEST['monitorconfig']);
} else if (isset($_REQUEST['import'])) {
View
25 js/server_status_monitor.js
@@ -572,25 +572,32 @@ AJAX.registerOnload('server_status_monitor.js', function() {
$('a[href="#exportMonitorConfig"]').click(function() {
var gridCopy = {};
-
$.each(runtime.charts, function(key, elem) {
gridCopy[key] = {};
gridCopy[key].nodes = elem.nodes;
gridCopy[key].settings = elem.settings;
gridCopy[key].title = elem.title;
});
-
var exportData = {
monitorCharts: gridCopy,
monitorSettings: monitorSettings
};
- var $form;
-
- $('body').append($form = $('<form method="post" action="file_echo.php?' + url_query + '&filename=1" style="display:none;"></form>'));
-
- $form.append('<input type="hidden" name="monitorconfig" value="' + encodeURI($.toJSON(exportData)) + '">');
- $form.submit();
- $form.remove();
+ $('<form />', {
+ "class": "disableAjax",
+ method: "post",
+ action: "file_echo.php?" + url_query + "&filename=1",
+ style: "display:none;"
+ })
+ .append(
+ $('<input />', {
+ type: "hidden",
+ name: "monitorconfig",
+ value: $.toJSON(exportData)
+ })
+ )
+ .appendTo('body')
+ .submit()
+ .remove();
});
$('a[href="#importMonitorConfig"]').click(function() {
Please sign in to comment.
Something went wrong with that request. Please try again.