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