From: Forrest Voight Date: Fri, 19 Oct 2012 04:51:06 +0000 (-0400) Subject: prevent requests for null period of graph data, which causes lots of spam on console X-Git-Tag: 9.0~45 X-Git-Url: https://git.novaco.in/?p=p2pool.git;a=commitdiff_plain;h=e02b9939b82f0f4271427dd353c568158dce91f6 prevent requests for null period of graph data, which causes lots of spam on console --- diff --git a/web-static/graphs.html b/web-static/graphs.html index dc08915..de0bbf9 100644 --- a/web-static/graphs.html +++ b/web-static/graphs.html @@ -404,12 +404,13 @@ .attr('href', function(period){ return "?" + period }) .attr("style", function(d, i) { return (i == 0 ? "" : "margin-left:.4em;") + "color:blue;text-decoration:underline;cursor:pointer" }); period = window.location.search.substr(1); - if(period == "") { + if(period.length < 3) { window.location.search = "Day"; + } else { + d3.json('/web/currency_info', function(currency_info) { + change_period(period, currency_info); + }); } - d3.json('/web/currency_info', function(currency_info) { - change_period(period, currency_info); - });