123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- $(function() {
- setInterval(function() {
- $.getJSON('/monitor/api/status/memory',function(data) {
- console.log("Response: " + data);
- if(data.mem != undefined) {
- $('.mem-rss').html(data.mem.rss);
- $('.mem-heap').html(data.mem.heapUsed + " / " + data.mem.heapTotal);
- }
- });
- },2000);
- $.getJSON('/monitor/api/bundles',function(data) {
- $thead = $('table.bundle-list thead');
- $thead.html('');
- var add = '';
- add+= '<tr>';
- Object.keys(data[0]).forEach(function(v) {
- add+='<th>' + v + '</th>';
- });
- add +='</tr>'
- console.log("Adding: " + add);
- $thead.html(add);
- $tbody = $('table.bundle-list tbody');
- $tbody.html('');
- data.forEach(function(v) {
- add='<tr>'
- Object.keys(v).forEach(function(e) {
- add+='<td> ' + v[e] + '</td>';
- });
- add+='</tr>';
- $tbody.append(add);
- });
- });
- });
|