From 752fa808e3f148f45b689a026f0e703c83b83d92 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 15 Mar 2015 19:23:39 +0100 Subject: Add a statistics page to gui --- gui/static/stats.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 gui/static/stats.js (limited to 'gui/static') diff --git a/gui/static/stats.js b/gui/static/stats.js new file mode 100644 index 0000000..7b07099 --- /dev/null +++ b/gui/static/stats.js @@ -0,0 +1,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 + $("

") + .append(result[name]['inputstat']['num_underruns']) + .appendTo('#statdata'); + }); + }); +} + +// Handle clicks on the to change visiblity of panes +setInterval(updatefunc, 1000); + + -- cgit v1.2.3