Skip to content

Commit

Permalink
added warning display to graphs page
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestv committed Oct 27, 2012
1 parent 29f85c1 commit 0ade627
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web-static/graphs.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ <h1><a href="/static/">P2Pool</a> &gt; Graphs</h1>

<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>

Expand Down Expand Up @@ -409,6 +411,12 @@ <h2>Traffic rate</h2>
});
}

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 })
Expand Down

0 comments on commit 0ade627

Please sign in to comment.