slitaz-dev-tools rev 23
mirror-tools: Updated mirror-info theme of graphs.php to be like the one on tank.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sun Feb 27 04:41:02 2011 +0000 (2011-02-27) |
parents | ab09a13f7cac |
children | da3f5c898394 |
files | mirror-tools/mirror-info/graphs.php mirror-tools/mirror-info/pics/website/header.png |
line diff
1.1 --- a/mirror-tools/mirror-info/graphs.php Sat Feb 26 18:44:00 2011 +0000 1.2 +++ b/mirror-tools/mirror-info/graphs.php Sun Feb 27 04:41:02 2011 +0000 1.3 @@ -10,58 +10,91 @@ 1.4 <link rel="shortcut icon" href="favicon.ico" /> 1.5 <link rel="stylesheet" type="text/css" href="slitaz.css" /> 1.6 </head> 1.7 +<body> 1.8 1.9 -<body bgcolor="#ffffff"> 1.10 <!-- Header --> 1.11 <div id="header"> 1.12 - <a name="top"></a> 1.13 - <a href="http://mirror.slitaz.org/"><img id="logo" 1.14 - src="pics/website/logo.png" title="mirror.slitaz.org" alt="mirror.slitaz.org" 1.15 - style="border: 0px solid ; width: 200px; height: 74px;" /></a> 1.16 - <p id="titre">#!/project/mirror</p> 1.17 -</div> 1.18 -<!-- Navigation menu --> 1.19 -<div id="nav"> 1.20 - 1.21 -<div class="nav_box"> 1.22 -<h4>About Mirror</h4> 1.23 -<p> 1.24 -This is the SliTaz GNU/Linux main mirror. The server runs naturally SliTaz 1.25 -(stable) in an lguest virtual machine provided by 1.26 -<a href="http://www.ads-lu.com/">ADS</a>. 1.27 -</p> 1.28 - 1.29 -</div> 1.30 - 1.31 -<div class="nav_box"> 1.32 -<h4>SliTaz Network</h4> 1.33 -<ul> 1.34 - <li><a href="http://www.slitaz.org/">Main Website</a></li> 1.35 - <li><a href="http://forum.slitaz.org/">Community Forum</a></li> 1.36 - <li><a href="http://community.slitaz.org/">Community Platform</a></li> 1.37 - <li><a href="http://labs.slitaz.org/">SliTaz Laboratories</a></li> 1.38 - <li><a href="http://pkgs.slitaz.org/">Packages Database</a></li> 1.39 - <li><a href="http://boot.slitaz.org/">SliTaz Web Boot</a></li> 1.40 - <li><a href="http://tank.slitaz.org/">SliTaz main server</a></li> 1.41 - <li><a href="http://twitter.com/slitaz">SliTaz on Twitter</a></li> 1.42 - <li><a href="http://www.distrowatch.com/slitaz">SliTaz on DistroWatch</a></li> 1.43 -</ul> 1.44 -</div> 1.45 - 1.46 -<!-- End navigation menu --> 1.47 -</div> 1.48 - 1.49 -<!-- Content top. --> 1.50 -<div id="content_top"> 1.51 -<div class="top_left"></div> 1.52 -<div class="top_right"></div> 1.53 + <a href="http://mirror.slitaz.org/info/"><img id="logo" 1.54 + src="pics/website/logo.png" 1.55 + title="mirror.slitaz.org/info/" alt="mirror.slitaz.org/info/" /></a> 1.56 + <p id="titre">#!/project/<?php echo preg_replace('/(\w+).*/i','$1',$_SERVER["HTTP_HOST"]); ?></p> 1.57 </div> 1.58 1.59 <!-- Content --> 1.60 -<div id="content"> 1.61 +<div id="content-full"> 1.62 1.63 -<h1><font color="#3E1220">Mirror RRD stats</font></h1> 1.64 -<h2><font color="#DF8F06">/usr/bin/rrdtool</font></h2> 1.65 +<!-- Block begin --> 1.66 +<div class="block"> 1.67 + <!-- Nav block begin --> 1.68 + <div id="block_nav"> 1.69 + <h4>SliTaz Network</h4> 1.70 + <ul> 1.71 + <li><a href="http://www.slitaz.org/">Main Website</a></li> 1.72 + <li><a href="http://doc.slitaz.org/">Documentation</a></li> 1.73 + <li><a href="http://forum.slitaz.org/">Community Forum</a></li> 1.74 + <li><a href="http://scn.slitaz.org/">Community Platform</a></li> 1.75 + <li><a href="http://labs.slitaz.org/">SliTaz Laboratories</a></li> 1.76 + <li><a href="http://pkgs.slitaz.org/">Packages Database</a></li> 1.77 + <li><a href="http://boot.slitaz.org/">SliTaz Web Boot</a></li> 1.78 + <li><a href="http://tank.slitaz.org/">SliTaz main server</a></li> 1.79 + <li><a href="http://bb.slitaz.org/">SliTaz Build Bot</a></li> 1.80 + <li><a href="http://hg.slitaz.org/">SliTaz Repositories</a></li> 1.81 + <li><a href="http://twitter.com/slitaz">SliTaz on Twitter</a></li> 1.82 + <li><a href="http://www.distrowatch.com/slitaz">SliTaz on DistroWatch</a></li> 1.83 + </ul> 1.84 + <!-- Nav block end --> 1.85 + </div> 1.86 + <!-- Top block begin --> 1.87 + <div id="block_top"> 1.88 + <h1>Mirror RRD stats</h1> 1.89 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 1.90 + <meta name="description" content="slitaz mirror rrdtool graphs" /> 1.91 + <meta name="robots" content="noindex" /> 1.92 + <meta name="author" content="SliTaz Contributors" /> 1.93 + <link rel="shortcut icon" href="/css/favicon.ico" /> 1.94 + <link rel="stylesheet" type="text/css" href="/css/slitaz.css" /> 1.95 + <style type="text/css"> 1.96 +#nav { 1.97 + right: 4%; 1.98 +} 1.99 + 1.100 +#content { 1.101 + padding: 0px 40px 60px 4%; 1.102 +} 1.103 + 1.104 +#copy { 1.105 + text-align: center; 1.106 +} 1.107 + 1.108 +#bottom { 1.109 + text-align: center; 1.110 +} 1.111 + 1.112 + </style> 1.113 + 1.114 + <p> 1.115 + This is the SliTaz GNU/Linux main mirror. The server runs naturally SliTaz 1.116 + (stable) in an lguest virtual machine provided by 1.117 + <a href="http://www.ads-lu.com/">Allied Data Sys. (ADS)</a>. 1.118 + </p> 1.119 + <p> 1.120 + Mirror CPU is a <?php system("sed -e '/^model name/!d;s/.*Intel(R) //;" . 1.121 + "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //' </proc/cpuinfo |" . 1.122 + " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" . 1.123 + "if (n == 4) printf \"quad \"; print s }' ")?> - 1.124 + <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ". 1.125 + "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ". 1.126 + "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?> - Located in France next to 1.127 + Roubaix. This page has real time statistics provided by PHP 1.128 + <code>system()</code> Mirror is also monitored by RRDtool which provides 1.129 + <a href="graphs.php">graphical stats</a>. 1.130 + </p> 1.131 + <!-- Top block end --> 1.132 + </div> 1.133 +<!-- Block end --> 1.134 +</div> 1.135 + 1.136 + 1.137 1.138 <?php 1.139 1.140 @@ -81,29 +114,27 @@ 1.141 echo "<a href=\"".$myurl."?stats=".$res."#".$res."\">\n"; 1.142 one_graphic($img."-day.png",$res." daily"); 1.143 echo "</a>"; 1.144 - if (isset($_GET['stats']) && $_GET['stats'] == $res) { 1.145 + if ($_GET['stats'] == $res) { 1.146 one_graphic($img."-week.png",$res." weekly"); 1.147 one_graphic($img."-month.png",$res." monthly"); 1.148 one_graphic($img."-year.png",$res." yearly"); 1.149 } 1.150 } 1.151 1.152 -echo "<h3>CPU</h3>\n"; 1.153 +echo "<h2>CPU</h2>\n"; 1.154 graphic("cpu"); 1.155 -echo "<h3>Memory</h3>\n"; 1.156 +echo "<h2>Memory</h2>\n"; 1.157 graphic("memory"); 1.158 -echo "<h3>Disk</h3>\n"; 1.159 +echo "<h2>Disk</h2>\n"; 1.160 graphic("disk"); 1.161 -echo "<h3>Network</h3>\n"; 1.162 -graphic("net","eth0"); 1.163 +echo "<h2>Network</h2>\n"; 1.164 +$eth = array(); 1.165 +exec("/sbin/route -n | awk '{ if (/^0.0.0.0/) print $8 }'", $eth); 1.166 +graphic("net",$eth[0]); 1.167 1.168 ?> 1.169 1.170 -<!-- End of content with round corner --> 1.171 -</div> 1.172 -<div id="content_bottom"> 1.173 -<div class="bottom_left"></div> 1.174 -<div class="bottom_right"></div> 1.175 +<!-- End of content --> 1.176 </div> 1.177 1.178 <!-- Start of footer and copy notice -->
2.1 Binary file mirror-tools/mirror-info/pics/website/header.png has changed