[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r16795: {torstatus} (ticket:67) Adding RRD graphs into router details page, and (in torstatus/trunk/web: . css)



Author: kasimir
Date: 2008-09-07 22:59:28 -0400 (Sun, 07 Sep 2008)
New Revision: 16795

Modified:
   torstatus/trunk/web/column_set.php
   torstatus/trunk/web/config_template.php
   torstatus/trunk/web/css/main.css
   torstatus/trunk/web/header.php
   torstatus/trunk/web/index.php
   torstatus/trunk/web/network_detail.php
   torstatus/trunk/web/router_detail.php
   torstatus/trunk/web/tor_exit_query.php
   torstatus/trunk/web/whois.php
Log:
(ticket:67) Adding RRD graphs into router details page, and cleaning up XHTML to validate

Modified: torstatus/trunk/web/column_set.php
===================================================================
--- torstatus/trunk/web/column_set.php	2008-09-08 01:57:17 UTC (rev 16794)
+++ torstatus/trunk/web/column_set.php	2008-09-08 02:59:28 UTC (rev 16795)
@@ -323,6 +323,7 @@
 <td class='TRC'><?php echo $footerText; ?></td>
 </tr>
 </table>
+</div>
 </body>
 </html>
 

Modified: torstatus/trunk/web/config_template.php
===================================================================
--- torstatus/trunk/web/config_template.php	2008-09-08 01:57:17 UTC (rev 16794)
+++ torstatus/trunk/web/config_template.php	2008-09-08 02:59:28 UTC (rev 16795)
@@ -56,9 +56,11 @@
 
 // Comment the following line if you do not provide a WHOIS service
 define("WHOISPath","whois.php?ip=");
-// If you want to provide a bandwidth history, uncomment the following line
+// If you want to provide a bandwidth history, uncomment the two following lines
 //$BandwidthHistory = "true";
+//$BandwidthURL = "bandwidthgraph/";
 
+
 // }}}
 
 // ++++++++++ Mirrors ++++++++++ {{{

Modified: torstatus/trunk/web/css/main.css
===================================================================
--- torstatus/trunk/web/css/main.css	2008-09-08 01:57:17 UTC (rev 16794)
+++ torstatus/trunk/web/css/main.css	2008-09-08 02:59:28 UTC (rev 16795)
@@ -717,3 +717,13 @@
 {
 	text-decoration: underline;
 }
+
+table.bwhistory
+{
+	width: 100%;
+}
+table.bwhistory td
+{
+	width: 50%;
+	text-align: center;
+}

Modified: torstatus/trunk/web/header.php
===================================================================
--- torstatus/trunk/web/header.php	2008-09-08 01:57:17 UTC (rev 16794)
+++ torstatus/trunk/web/header.php	2008-09-08 02:59:28 UTC (rev 16795)
@@ -31,6 +31,12 @@
 $mirrorListRow = mysql_fetch_row($result_mirrors);
 $mirrorList = $mirrorListRow[0];
 
+// Find out if a search had been carried out, e.g. if the session CSInput holds
+// anything
+if (isset($_SESSION['CSInput']))
+{
+	$CSInput = $_SESSION['CSInput'];
+}
 
 ?><!DOCTYPE html 
      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -49,10 +55,10 @@
 <body>
 <div class="topbar" id="topbar"><br/>
 <table width="100%"><tr><td style="vertical-align: bottom;">
-<a href="/?CSInput=" class="logoimage"><img src="img/logo.png" alt="TorStatus" class="topbarlogo"/></a>
+<a href="/?clear=clear" class="logoimage"><img src="img/logo.png" alt="TorStatus" class="topbarlogo"/></a>
 <span class="logotext"><?php echo $TorNetworkStatus_Version; ?><?php if ($UsingSSL == 1) { ?> - Encrypted connection<?php } elseif ($AllowSSL) { ?> - <a href="<?php echo $SSLLink; echo substr($Self,-(strlen($Self)-1)); echo "?"; echo $_SERVER['QUERY_STRING'];  ?>" class="plain">Use an encrypted connection <b>(recommended)</b></a><?php } ?></span>
 </td><td style="vertical-align: bottom; text-align: right;">
-<form action="/index.php" method="post" name="search">
+<form action="/index.php" method="get" name="search">
 <input type="hidden" name="CSMod" value="Contains" />
 <input type="hidden" name="CSField" value="Name" />
 <input type="text" class="searchbox" value="<?php echo ($CSInput)?htmlspecialchars($CSInput, ENT_QUOTES):"";?>" onfocus="javascript:if(this.value=='search by name or fingerprint') { this.style.color = 'black';this.value=''; }" id="searchbox" name="CSInput"/><a href="javascript:submitSearch();" class="searchbox" id="searchbutton"></a><noscript><input type="submit" value="Name/Fingerprint Search"/></noscript>
@@ -60,11 +66,14 @@
 </td></tr></table>
 <?php if (!$CSInput) { ?>
 <script type="text/javascript">
+<!--
 	document.getElementById('searchbox').style.color = 'gray';
 	document.getElementById('searchbox').value = 'search by name or fingerprint';
+// -->
 </script>
 <?php } ?>
 <script type="text/javascript">
+<!--
 	document.getElementById('searchbutton').innerHTML = '<img class="searchbox" alt="Search" src="/img/blank.gif" />';
 	function submitSearch()
 	{
@@ -74,6 +83,7 @@
 		}
 		document.search.submit();
 	}
+// -->
 </script>
 </div>
 <div class="separator"></div>

Modified: torstatus/trunk/web/index.php
===================================================================
--- torstatus/trunk/web/index.php	2008-09-08 01:57:17 UTC (rev 16794)
+++ torstatus/trunk/web/index.php	2008-09-08 02:59:28 UTC (rev 16795)
@@ -947,6 +947,7 @@
 }
 
 
+
 // POST
 if ($_SERVER['REQUEST_METHOD'] == 'POST')
 {
@@ -1002,18 +1003,6 @@
 	{
 		$FHSDir = $_POST["FHSDir"];
 	}
-	if (isset($_POST["CSField"]))
-	{
-		$CSField = $_POST["CSField"];
-	}
-	if (isset($_POST["CSMod"]))
-	{
-		$CSMod = $_POST["CSMod"];
-	}
-	if (isset($_POST["CSInput"]))
-	{
-		$CSInput = $_POST["CSInput"];
-	}
 }
 
 // SESSION
@@ -1089,15 +1078,28 @@
 	}
 }
 
+if (isset($_REQUEST["CSField"]))
+{
+	$CSField = $_REQUEST["CSField"];
+}
+if (isset($_REQUEST["CSMod"]))
+{
+	$CSMod = $_REQUEST["CSMod"];
+}
+if (isset($_REQUEST["CSInput"]))
+{
+	$CSInput = $_REQUEST["CSInput"];
+}
+
 // Read ColumnList_ACTIVE and ColumnList_INACTIVE variables -- These come from SESSION
-	if (isset($_SESSION["ColumnList_ACTIVE"]))
-	{
-		$ColumnList_ACTIVE = $_SESSION["ColumnList_ACTIVE"];
-	}
-	if (isset($_SESSION["ColumnList_INACTIVE"]))
-	{
-		$ColumnList_INACTIVE = $_SESSION["ColumnList_INACTIVE"];
-	}
+if (isset($_SESSION["ColumnList_ACTIVE"]))
+{
+	$ColumnList_ACTIVE = $_SESSION["ColumnList_ACTIVE"];
+}
+if (isset($_SESSION["ColumnList_INACTIVE"]))
+{
+	$ColumnList_INACTIVE = $_SESSION["ColumnList_INACTIVE"];
+}
 
 // VARIABLE SCRUB / DEFAULT VALUES HANDLING
 if (!(isset($_SESSION['ColumnSetVisited'])) && !(isset($_SESSION['IndexVisited'])))
@@ -2179,7 +2181,7 @@
 <a href="/?clear=clear" class="logoimage"><img src="img/logo.png" alt="TorStatus" class="topbarlogo"/></a>
 <span class="logotext"><?php echo $TorNetworkStatus_Version; ?><?php if ($UsingSSL == 1) { ?> - Encrypted connection<?php } elseif ($AllowSSL) { ?> - <a href="<?php echo $SSLLink  ?>" class="plain">Use an encrypted connection <b>(recommended)</b></a><?php } ?></span>
 </td><td style="vertical-align: bottom; text-align: right;">
-<form action="<?php echo $Self; ?>" method="post" name="search">
+<form action="<?php echo $Self; ?>" method="get" name="search">
 <input type="hidden" name="CSMod" value="Contains" />
 <input type="hidden" name="CSField" value="Name" />
 <input type="text" class="searchbox" value="<?php echo ($CSInput)?htmlspecialchars($CSInput, ENT_QUOTES):"";?>" onfocus="javascript:if(this.value=='search by name or fingerprint') { this.style.color = 'black';this.value=''; }" id="searchbox" name="CSInput"/><a href="javascript:submitSearch();" class="searchbox" id="searchbutton"></a><noscript><input type="submit" value="Name/Fingerprint Search"/></noscript>
@@ -2187,11 +2189,14 @@
 </td></tr></table>
 <?php if (!$CSInput) { ?>
 <script type="text/javascript">
+<!--
 	document.getElementById('searchbox').style.color = 'gray';
 	document.getElementById('searchbox').value = 'search by name or fingerprint';
+// -->
 </script>
 <?php } ?>
 <script type="text/javascript">
+<!--
 	document.getElementById('searchbutton').innerHTML = '<img class="searchbox" alt="Search" src="img/blank.gif" />';
 	function submitSearch()
 	{
@@ -2201,6 +2206,7 @@
 		}
 		document.search.submit();
 	}
+// -->
 </script>
 </div>
 <div class="separator"></div>
@@ -2311,7 +2317,7 @@
 	include("../geoip/geoip.inc");
 	$gi = geoip_open("../geoip/GeoIP.dat",GEOIP_STANDARD);
 	$cc = geoip_country_code_by_addr($gi, $RemoteIP);
-	echo "<img src=\"img/flags/".strtolower($cc).".gif\" class=\"flag\" title=\"".$country_codes[strtolower($cc)]."\" />";
+	echo "<img src=\"img/flags/".strtolower($cc).".gif\" class=\"flag\" title=\"".$country_codes[strtolower($cc)]."\" alt=\"".$country_codes[strtolower($cc)]."\" />";
 	
 	if (defined("WHOISPath"))
 	{
@@ -2437,7 +2443,7 @@
 	{
 		if ($Fast == 1)
 		{
-			echo "<td class=\"truncated\" colspan=\"6\"><a href=\"?Fast=0\">The listing is truncated for low bandwidth connections.  See the full listing by clicking here.</a></td>";
+			echo "<tr><td class=\"truncated\" colspan=\"6\"><a href=\"?Fast=0\">The listing is truncated for low bandwidth connections.  See the full listing by clicking here.</a></td></tr>";
 			break;
 		}
 		// Display header row

Modified: torstatus/trunk/web/network_detail.php
===================================================================
--- torstatus/trunk/web/network_detail.php	2008-09-08 01:57:17 UTC (rev 16794)
+++ torstatus/trunk/web/network_detail.php	2008-09-08 02:59:28 UTC (rev 16795)
@@ -608,6 +608,7 @@
 <td class='TRC'><?php echo $footerText; ?></td>
 </tr>
 </table>
+</div>
 </body>
 </html>
 

Modified: torstatus/trunk/web/router_detail.php
===================================================================
--- torstatus/trunk/web/router_detail.php	2008-09-08 01:57:17 UTC (rev 16794)
+++ torstatus/trunk/web/router_detail.php	2008-09-08 02:59:28 UTC (rev 16795)
@@ -215,6 +215,7 @@
 <td class='HRN' colspan='2'>Router Information</td>
 <td class='HRN' style='border-left-color: #000072; border-left-style: solid; border-left-width: 1px;'>Router Flags</td>
 </tr>
+<tr>
 <td class="TRS" colspan='2' style="vertical-align: top;">
 <table>
 <?php
@@ -496,7 +497,7 @@
 }
 else
 {
-	?><a href="?FP=<?php echo $Fingerprint; ?>&showbandwidth=true">(show bandwidth values)</a><?php
+	?><a href="?FP=<?php echo $Fingerprint; ?>&amp;showbandwidth=true">(show bandwidth values)</a><?php
 }
 ?>
 </div>
@@ -550,15 +551,46 @@
 </tr>
 
 <tr>
-<td class='HRN' colspan='3'>Router Keys</td>
+<td class='HRN' colspan='3'><? if ($BandwidthHistory == "true") { echo "Bandwidth History / "; } ?>Router Keys</td>
 </tr>
 <tr>
 <td class='TRS' colspan='3'>
 <?php
 	
 	echo "<br/>\n";
+	if ($BandwidthHistory == "true")
+	?>
+	<table class="bwhistory">
+		<tr>
+			<td>
+			<img src="<?php echo $BandwidthURL . strtoupper($Fingerprint) . "_d.png"; ?>" alt="Past Day's Bandwidth"/>
+			</td>
+			<td>
+			<img src="<?php echo $BandwidthURL . strtoupper($Fingerprint) . "_w.png"; ?>" alt="Past Week's Bandwidth"/>
+			</td>
+		</tr>
+		<tr>
+			<td>
+			<img src="<?php echo $BandwidthURL . strtoupper($Fingerprint) . "_m.png"; ?>" alt="Past Month's Bandwidth"/>
+			</td>
+			<td>
+			<img src="<?php echo $BandwidthURL . strtoupper($Fingerprint) . "_3m.png"; ?>" alt="Past Three Month's Bandwidth"/>
+			</td>
+		</tr>
+		<tr>
+			<td>
+			<img src="<?php echo $BandwidthURL . strtoupper($Fingerprint) . "_y.png"; ?>" alt="Past Year's Bandwidth"/>
+			</td>
+			<td>
+			</td>
+		</tr>
+	</table>
+	<br/>
+	<?php
+	echo "<b>Signing Key:</b><pre>" . $SigningKey . "</pre>";
 	echo "<b>Onion Key:</b><pre>" . $OnionKey . "</pre>\n";
-	echo "<b>Signing Key:</b><pre>" . $SigningKey . "</pre><br/>\n";
+	echo "<br/>\n";
+
 ?>
 </td>
 </tr>
@@ -576,6 +608,7 @@
 <td class='TRC'><?php echo $footerText; ?></td>
 </tr>
 </table>
+</div>
 </body>
 </html>
 

Modified: torstatus/trunk/web/tor_exit_query.php
===================================================================
--- torstatus/trunk/web/tor_exit_query.php	2008-09-08 01:57:17 UTC (rev 16794)
+++ torstatus/trunk/web/tor_exit_query.php	2008-09-08 02:59:28 UTC (rev 16795)
@@ -421,6 +421,7 @@
 <td class='TRC'><?php echo $footerText; ?></td>
 </tr>
 </table>
+</div>
 </body>
 </html>
 

Modified: torstatus/trunk/web/whois.php
===================================================================
--- torstatus/trunk/web/whois.php	2008-09-08 01:57:17 UTC (rev 16794)
+++ torstatus/trunk/web/whois.php	2008-09-08 02:59:28 UTC (rev 16795)
@@ -52,6 +52,7 @@
 <td class='TRC'><?php echo $footerText; ?></td>
 </tr>
 </table>
+</div>
 </body>
 </html>