mirror of
https://github.com/manuelkasper/AS-Stats.git
synced 2025-02-20 11:44:12 +08:00
add peeras
This commit is contained in:
parent
e3a1174d5d
commit
01ed21a7da
@ -23,8 +23,13 @@ $v6_el = "";
|
||||
if (@$_GET['v'] == 6)
|
||||
$v6_el = "v6_";
|
||||
|
||||
if(isset($_GET['peerusage']) && $_GET['peerusage'] == '1')
|
||||
$peerusage = 1;
|
||||
else
|
||||
$peerusage = 0;
|
||||
|
||||
$knownlinks = getknownlinks();
|
||||
$rrdfile = getRRDFileForAS($as);
|
||||
$rrdfile = getRRDFileForAS($as, $peerusage);
|
||||
|
||||
if ($compat_rrdtool12) {
|
||||
/* cannot use full-size-mode - must estimate height/width */
|
||||
|
@ -13,7 +13,12 @@ $as = str_replace('as','',str_replace(' ','',strtolower($_GET['as'])));
|
||||
if ($as)
|
||||
$asinfo = getASInfo($as);
|
||||
|
||||
$rrdfile = getRRDFileForAS($as);
|
||||
if(isset($_GET['peerusage']) && $_GET['peerusage'] == '1')
|
||||
$peerusage = 1;
|
||||
else
|
||||
$peerusage = 0;
|
||||
|
||||
$rrdfile = getRRDFileForAS($as, $peerusage);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
@ -31,7 +36,7 @@ $rrdfile = getRRDFileForAS($as);
|
||||
<div id="nav"><?php include('headermenu.inc'); ?></div>
|
||||
|
||||
<?php if ($as): ?>
|
||||
<div class="pgtitle">History for AS<?php echo $as; ?>: <?php echo $asinfo['descr']; ?>
|
||||
<div class="pgtitle">History for <?php if($peerusage == 1) echo "peer "; ?>AS<?php echo $as; ?>: <?php echo $asinfo['descr']; ?>
|
||||
<?php if (!empty($customlinks)): ?>
|
||||
<div class="customlinks">
|
||||
<?php
|
||||
@ -51,37 +56,37 @@ $rrdfile = getRRDFileForAS($as);
|
||||
<?php else: ?>
|
||||
<div class="title">4 Hourly</div>
|
||||
<?php
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 4 * 3600, time(), 'hourly graph', 'detailgraph', true);
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 4 * 3600, time(), $peerusage, 'hourly graph', 'detailgraph', true);
|
||||
if ($showv6)
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 4 * 3600, time(), 'hourly graph', 'detailgraph2', true);
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 4 * 3600, time(), $peerusage, 'hourly graph', 'detailgraph2', true);
|
||||
?>
|
||||
|
||||
<div class="title">Daily</div>
|
||||
<?php
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 24 * 3600, time(), 'daily graph', 'detailgraph', true);
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 24 * 3600, time(), $peerusage, 'daily graph', 'detailgraph', true);
|
||||
if ($showv6)
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 24 * 3600, time(), 'daily graph', 'detailgraph2', true);
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 24 * 3600, time(), $peerusage, 'daily graph', 'detailgraph2', true);
|
||||
?>
|
||||
|
||||
<div class="title">Weekly</div>
|
||||
<?php
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 7 * 86400, time(), 'weekly graph', 'detailgraph', true);
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 7 * 86400, time(), $peerusage, 'weekly graph', 'detailgraph', true);
|
||||
if ($showv6)
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 7 * 86400, time(), 'weekly graph', 'detailgraph2', true);
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 7 * 86400, time(), $peerusage, 'weekly graph', 'detailgraph2', true);
|
||||
?>
|
||||
|
||||
<div class="title">Monthly</div>
|
||||
<?php
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 30 * 86400, time(), 'monthly graph', 'detailgraph', true);
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 30 * 86400, time(), $peerusage, 'monthly graph', 'detailgraph', true);
|
||||
if ($showv6)
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 30 * 86400, time(), 'monthly graph', 'detailgraph2', true);
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 30 * 86400, time(), $peerusage, 'monthly graph', 'detailgraph2', true);
|
||||
?>
|
||||
|
||||
<div class="title">Yearly</div>
|
||||
<?php
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 365 * 86400, time(), 'yearly graph', 'detailgraph', true);
|
||||
echo getHTMLImg($as, 4, $asinfo['descr'], time() - 365 * 86400, time(), $peerusage, 'yearly graph', 'detailgraph', true);
|
||||
if ($showv6)
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 365 * 86400, time(), 'yearly graph', 'detailgraph2', true);
|
||||
echo getHTMLImg($as, 6, $asinfo['descr'], time() - 365 * 86400, time(), $peerusage, 'yearly graph', 'detailgraph2', true);
|
||||
?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
13
www/top.php
13
www/top.php
@ -7,12 +7,15 @@
|
||||
|
||||
require_once('func.inc');
|
||||
|
||||
if(!isset($peerusage))
|
||||
$peerusage = 0;
|
||||
|
||||
if (isset($_GET['n']))
|
||||
$ntop = (int)$_GET['n'];
|
||||
if ($ntop > 200)
|
||||
$ntop = 200;
|
||||
|
||||
$topas = getasstats_top($ntop);
|
||||
$topas = getasstats_top($ntop, $peerusage);
|
||||
|
||||
if (@$_GET['numhours']) {
|
||||
$start = time() - $_GET['numhours']*3600;
|
||||
@ -29,7 +32,7 @@ if (@$_GET['numhours']) {
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Refresh" content="300" />
|
||||
<title>Top <?php echo $ntop; ?> AS</title>
|
||||
<title>Top <?php echo $ntop; ?> AS<?php if($peerusage) echo " peer"; ?></title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
</head>
|
||||
|
||||
@ -43,7 +46,7 @@ Number of AS:
|
||||
<?php include('headermenu.inc'); ?>
|
||||
</form>
|
||||
</div>
|
||||
<div class="pgtitle">Top <?php echo $ntop; ?> AS</div>
|
||||
<div class="pgtitle">Top <?php echo $ntop; ?> AS<?php if($peerusage) echo " peer"; ?></div>
|
||||
|
||||
<table class="astable">
|
||||
|
||||
@ -89,9 +92,9 @@ echo join(" | ", $htmllinks);
|
||||
</th>
|
||||
<td>
|
||||
<?php
|
||||
echo getHTMLUrl($as, 4, $asinfo['descr'], $start, $end);
|
||||
echo getHTMLUrl($as, 4, $asinfo['descr'], $start, $end, $peerusage);
|
||||
if ($showv6)
|
||||
echo getHTMLUrl($as, 6, $asinfo['descr'], $start, $end);
|
||||
echo getHTMLUrl($as, 6, $asinfo['descr'], $start, $end, $peerusage);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user