summaryrefslogtreecommitdiffstats
path: root/gui/static/stats.js
blob: 7b07099867baf87f9fe23d63abbe874e424e943d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var updatefunc = function(event) {
    $('#statdata p').remove();
    $.getJSON('/stats.json', function(result) {
        $.each(result, function(name) {
            // TODO: use a hidden template inside the DOM instead
            // of building the HTML here
            $("<p></p>")
                .append(result[name]['inputstat']['num_underruns'])
                .appendTo('#statdata');
        });
    });
}

// Handle clicks on the to change visiblity of panes
setInterval(updatefunc, 1000);