[or-cvs] r17853: {torstatus} (ticket:116) Adding support for custom time graphs (torstatus/trunk/cgi-bin/perlgraph)

kasimir at seul.org kasimir at seul.org
Sat Jan 3 04:01:53 UTC 2009


Author: kasimir
Date: 2009-01-02 23:01:53 -0500 (Fri, 02 Jan 2009)
New Revision: 17853

Modified:
   torstatus/trunk/cgi-bin/perlgraph/bandwidthgraph.pl
Log:
(ticket:116) Adding support for custom time graphs

Modified: torstatus/trunk/cgi-bin/perlgraph/bandwidthgraph.pl
===================================================================
--- torstatus/trunk/cgi-bin/perlgraph/bandwidthgraph.pl	2009-01-03 04:01:23 UTC (rev 17852)
+++ torstatus/trunk/cgi-bin/perlgraph/bandwidthgraph.pl	2009-01-03 04:01:53 UTC (rev 17853)
@@ -44,7 +44,7 @@
 	exit;
 }
 # Make sure that the date is an allowed one
-unless ($time eq "day" || $time eq "week" || $time eq "month" || $time eq "3months" || $time eq "year")
+unless ($time eq "day" || $time eq "week" || $time eq "month" || $time eq "3months" || $time eq "year" || $time eq "custom")
 {
 	print "Content-type: text/html\n\n";
 	print "Unknown time period.";
@@ -105,6 +105,15 @@
 	"--title=Past Year's Bandwidth for $name",
 	"--start=end-1y";
 }
+elsif ($time eq "custom")
+{
+	my $starttime = $cgi->param('start');
+	my $endtime = $cgi->param('end');
+	push @timeargs,
+	"--title=Bandwidth from $starttime to $endtime for $name",
+	"--start=$starttime",
+	"--end=$endtime";
+}
 
 
 # Output the graph



More information about the tor-commits mailing list