Store query data in data attribute instead of HTML
Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
9b4642af62
commit
9503e0f6aa
@ -16,10 +16,9 @@ AJAX.registerOnload('server_status_queries.js', function () {
|
||||
// Build query statistics chart
|
||||
var cdata = [];
|
||||
try {
|
||||
$.each(JSON.parse($('#serverstatusquerieschart').text()), function (key, value) {
|
||||
$.each(JSON.parse($('#serverstatusquerieschart').data('chart'))), function (key, value) {
|
||||
cdata.push([key, parseInt(value, 10)]);
|
||||
});
|
||||
$('#serverstatusquerieschart').empty();
|
||||
$('#serverstatusquerieschart').data(
|
||||
'queryPieChart',
|
||||
PMA_createProfilingChart(
|
||||
|
||||
@ -134,13 +134,12 @@ function PMA_getHtmlForServerStatusQueriesDetails($ServerStatusData)
|
||||
$retval .= '</tbody>';
|
||||
$retval .= '</table>';
|
||||
|
||||
$retval .= '<div id="serverstatusquerieschart">';
|
||||
$retval .= '<div id="serverstatusquerieschart" data-chart="';
|
||||
if ($other_sum > 0) {
|
||||
$chart_json[__('Other')] = $other_sum;
|
||||
}
|
||||
$retval .= htmlspecialchars(json_encode($chart_json));
|
||||
$retval .= '</div>';
|
||||
$retval .= htmlspecialchars(json_encode($chart_json), ENT_QUOTES);
|
||||
$retval .= '"></div>';
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
@ -219,7 +219,7 @@ class PMA_ServerStatusQueries_Test extends PHPUnit_Framework_TestCase
|
||||
|
||||
//validate 3:serverstatusquerieschart
|
||||
$this->assertContains(
|
||||
'<div id="serverstatusquerieschart">',
|
||||
'<div id="serverstatusquerieschart" data-chart="',
|
||||
$html
|
||||
);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user