added warning display to graphs page
authorForrest Voight <forrest@forre.st>
Sat, 27 Oct 2012 03:46:19 +0000 (23:46 -0400)
committerForrest Voight <forrest@forre.st>
Sat, 27 Oct 2012 04:11:18 +0000 (00:11 -0400)
web-static/graphs.html

index 8315d11..f7d38f3 100644 (file)
@@ -30,6 +30,8 @@
         
         <p>Periods: <span id="period_chooser"></span> Current: <span id="period_current"></span></p>
         
+        <div id="warnings"></div>
+        
         <h2>Local rate</h2>
         <svg id="local"></svg>
         
                 });
             }
             
+            d3.json('/local_stats', function(local_stats) {
+                d3.select('#warnings').selectAll().data(local_stats.warnings).enter().append('p')
+                    .text(function(w){ return 'Warning: ' + w })
+                    .attr('style', 'color:red;border:1px solid red;padding:5px');
+            })
+            
             periods = ["Hour", "Day", "Week", "Month", "Year"];
             d3.select("#period_chooser").selectAll().data(periods).enter().append("a")
                 .text(function(period) { return period })