aboutsummaryrefslogtreecommitdiffstats
path: root/gui/static
diff options
context:
space:
mode:
Diffstat (limited to 'gui/static')
-rw-r--r--gui/static/stats.js17
1 files changed, 17 insertions, 0 deletions
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
+ $("<p></p>")
+ .append(result[name]['inputstat']['num_underruns'])
+ .appendTo('#statdata');
+ });
+ });
+}
+
+// Handle clicks on the to change visiblity of panes
+setInterval(updatefunc, 1000);
+
+