server_status_queries.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* vim: set expandtab sw=4 ts=4 sts=4: */
  2. /**
  3. */
  4. /**
  5. * Unbind all event handlers before tearing down a page
  6. */
  7. AJAX.registerTeardown('server_status_queries.js', function () {
  8. if (document.getElementById('serverstatusquerieschart') !== null) {
  9. var queryPieChart = $('#serverstatusquerieschart').data('queryPieChart');
  10. if (queryPieChart) {
  11. queryPieChart.destroy();
  12. }
  13. }
  14. });
  15. AJAX.registerOnload('server_status_queries.js', function () {
  16. // Build query statistics chart
  17. var cdata = [];
  18. try {
  19. if (document.getElementById('serverstatusquerieschart') !== null) {
  20. $.each($('#serverstatusquerieschart').data('chart'), function (key, value) {
  21. cdata.push([key, parseInt(value, 10)]);
  22. });
  23. $('#serverstatusquerieschart').data(
  24. 'queryPieChart',
  25. PMA_createProfilingChart(
  26. 'serverstatusquerieschart',
  27. cdata
  28. )
  29. );
  30. }
  31. } catch (exception) {
  32. // Could not load chart, no big deal...
  33. }
  34. initTableSorter('statustabs_queries');
  35. });