Fixed export of server status monitor settings
This commit is contained in:
parent
5b4bf0cf78
commit
b2cbb2d779
@ -7,6 +7,7 @@
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
define('PMA_MINIMUM_COMMON', true);
|
||||
require_once 'libraries/common.inc.php';
|
||||
|
||||
/* For chart exporting */
|
||||
@ -49,14 +50,14 @@ if (isset($_REQUEST['filename']) && isset($_REQUEST['image'])) {
|
||||
}
|
||||
|
||||
/* 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'])) {
|
||||
|
||||
@ -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() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user