[or-cvs] r17733: {torstatus} More patches from Martin Mulazzani (in torstatus/trunk: . web)

kasimir at seul.org kasimir at seul.org
Mon Dec 22 16:57:59 UTC 2008


Author: kasimir
Date: 2008-12-22 11:57:59 -0500 (Mon, 22 Dec 2008)
New Revision: 17733

Modified:
   torstatus/trunk/README
   torstatus/trunk/tns_update.pl
   torstatus/trunk/web/network_history.php
Log:
More patches from Martin Mulazzani

Modified: torstatus/trunk/README
===================================================================
--- torstatus/trunk/README	2008-12-22 16:51:27 UTC (rev 17732)
+++ torstatus/trunk/README	2008-12-22 16:57:59 UTC (rev 17733)
@@ -191,7 +191,9 @@
 -- $TorNetworkStatus_Version: A version string which displays at the bottom 
 of each page.
 
-7) Setup a way for scheduled local-cache (database) refreshes to take place. 
+7) If you want to use TOR History, make sure that the user running tns_update.pl has write access to web/history/, e.g. by executing "chown username web/history". Otherwise the graphs of TOR History used in network_history.php will not get created.
+
+8) Setup a way for scheduled local-cache (database) refreshes to take place. 
 You have two options here. Number one is to simply run the "tns_agent.php" 
 file using stand-alone PHP, and allow it to continue running in the 
 background. On Unix type systems, you'll probably want to start this as a 
@@ -203,14 +205,14 @@
 will have no bearing. It will be up to you to setup your task scheduling 
 mechanism at the interval you want.
 
-8) Set up the cgi-bin directory to be an actual cgi-bin directory with your
+9) Set up the cgi-bin directory to be an actual cgi-bin directory with your
 webserver.  TorStatus will point to /cgi-bin/perlgraph/plot.pl to create Perl
 based graphs.
 
-9) You're done! Load the site in a browser, and if all is well, it should 
+10) You're done! Load the site in a browser, and if all is well, it should 
 work. 
 
-10) Optionally, it may make you feel better to delete the "sql" subdirectory. 
+11) Optionally, it may make you feel better to delete the "sql" subdirectory. 
 Everything else is required.
 
 

Modified: torstatus/trunk/tns_update.pl
===================================================================
--- torstatus/trunk/tns_update.pl	2008-12-22 16:51:27 UTC (rev 17732)
+++ torstatus/trunk/tns_update.pl	2008-12-22 16:57:59 UTC (rev 17733)
@@ -1178,7 +1178,6 @@
         my $graphfile = $config{'TNS_Path'} . "web/history/";
 
 	if ($type eq 'Running') {
-		print "DEBUG: creatin $type graph, time = $time\n";
 		RRDs::graph(
 	           $graphfile . "running_" . $time . ".png",
         	   "--title=Running Servers in the last " . $timeExt,
@@ -1190,7 +1189,6 @@
         	);
 	} 
 	else {
-                print "DEBUG: creatin $type graph, time = $time\n";
 	        RRDs::graph(
         	    $graphfile . "run$type" . "_" . $time . ".png",
 	            "--title=Running $type Servers in the last " . $timeExt,

Modified: torstatus/trunk/web/network_history.php
===================================================================
--- torstatus/trunk/web/network_history.php	2008-12-22 16:51:27 UTC (rev 17732)
+++ torstatus/trunk/web/network_history.php	2008-12-22 16:57:59 UTC (rev 17733)
@@ -175,7 +175,117 @@
         </td>
 </tr>
 
+<!-- Country Selection -->
+<tr>
+	<td>
+		<table class="displayTable" width='100%' cellspacing='0' cellpadding='0' align='center'>
+		<tr>
+			<td class="HRN">Country Statistics</td>
+		<tr>
+			<td class='TRSCN'>
+			<br/>
+			<table class="bwhistory">
+			<tr>
+				<td>
+				<form action="<?php echo $Self; ?>" method="get" name="lookup">
+				Please select a country for further informations:
+				<select name="country" size="1">
+				<option value="none" selected>none</option>
+				<option value="US">USA</option>
+				<option value="DE">Germany</option>
+				<option value="CN">China</option>
+				<option value="FR">France</option>
+				<option value="SE">Sweden</option>
+				<option value="RU">Russia</option>
+				<option value="NL">Netherlands</option>
+				<option value="CA">Canada</option>
+				<option value="GB">Great Britain</option>
+				<option value="IT">Italy</option>
+				<option value="AT">Austria</option>
+				<option value="Other">OTHER</option>
+				</select>
+				<input name="submit" type="submit" value="Apply">
+				</form>
+				</td>
+			</tr>
+			</table>
+			<?php 
+			echo "<table class=\"bwhistory\">";
+			if  ( isset($_GET["country"]) ) {
+				$country = $_GET["country"];
+				if ($country != "none") {
+				echo "<br><br>";
+				echo "<h3>Running "; echo $country; echo " Servers</h3>";
+				echo "<tr>";
+					echo "<td>";
+					echo "<img src=\"history/countries/running_"; echo $country; echo "_6h.png\"; alt=\"Running Servers in the last 6 Hours\" />";
+					echo "</td>";
+	
+					echo "<td>";
+                	                echo "<img src=\"history/countries/running_"; echo $country; echo "_1d.png\"; alt=\"Running Servers in the last 24 Hours\" />";
+					echo "</td>";
+				echo "</tr>";
+				echo "<tr>";
+					echo "<td>";
+					echo "<img src=\"history/countries/running_"; echo $country; echo "_1w.png\"; alt=\"Running Servers in the last Week\" />";
+					echo "</td>";
+	
+	                                echo "<td>";
+        	                        echo "<img src=\"history/countries/running_"; echo $country; echo "_1m.png\"; alt=\"Running Servers in the last Months\" />";
+                	                echo "</td>";
+				echo "</tr>";
+                                	echo "<td>";
+	                                echo "<img src=\"history/countries/running_"; echo $country; echo "_3m.png\"; alt=\"Running Servers in the last 3 Months\" />";
+        	                        echo "</td>";
 
+                	                echo "<td>";
+                        	        echo "<img src=\"history/countries/running_"; echo $country; echo "_1y.png\"; alt=\"Running Servers in the last Year\" />";
+                                	echo "</td>";
+	                        echo "</tr>";
+				echo "</table>";
+				echo "<br><br>";
+				echo "<h3>Running "; echo $country; echo " Exit Servers</h3><br>";
+
+				echo "<table class=\"bwhistory\">";
+        	                echo "</tr>";
+                	                echo "<td>";
+                        	        echo "<img src=\"history/countries/runExit_"; echo $country; echo "_6h.png\"; alt=\"Running Exit Servers in the last 6 Hours\" />";
+                                	echo "</td>";
+
+	                                echo "<td>";
+        	                        echo "<img src=\"history/countries/runExit_"; echo $country; echo "_1d.png\"; alt=\"Running Exit Servers in the last 24 Hours\" />";
+                	                echo "</td>";
+                        	echo "</tr>";
+
+	                        echo "</tr>";
+        	                        echo "<td>";
+                	                echo "<img src=\"history/countries/runExit_"; echo $country; echo "_1w.png\"; alt=\"Running Exit Servers in the last Week\" />";
+                        	        echo "</td>";
+	
+	                                echo "<td>";
+        	                        echo "<img src=\"history/countries/runExit_"; echo $country; echo "_1m.png\"; alt=\"Running Exit Servers in the last Months\" />";
+                	                echo "</td>";
+                        	echo "</tr>";
+
+	                        echo "</tr>";
+        	                        echo "<td>";
+                	                echo "<img src=\"history/countries/runExit_"; echo $country; echo "_3m.png\"; alt=\"Running Exit Servers in the last 3 Months\" />";
+                        	        echo "</td>";
+
+	                                echo "<td>";
+        	                        echo "<img src=\"history/countries/runExit_"; echo $country; echo "_1y.png\"; alt=\"Running Exit Servers in the last Year\" />";
+                	                echo "</td>";
+                        	echo "</tr>";
+				}
+			}
+			?>				
+
+			</table>
+		</tr>
+		</table>
+	</td>
+</tr>
+
 <!-- Footer -->
 		<br/>
 		<table width='70%' cellspacing='2' cellpadding='2' border='0' align='center'>



More information about the tor-commits mailing list