2010-07-18 11:38:38 +00:00
|
|
|
<?php
|
|
|
|
|
2011-05-01 17:26:06 +00:00
|
|
|
# This file prints a table row for each interface
|
2011-03-16 18:28:52 +00:00
|
|
|
|
2011-09-18 13:11:04 +00:00
|
|
|
$port['device_id'] = $device['device_id'];
|
|
|
|
$port['hostname'] = $device['hostname'];
|
2010-07-18 11:38:38 +00:00
|
|
|
|
2012-05-16 13:25:50 +00:00
|
|
|
$if_id = $port['port_id'];
|
2010-07-18 11:38:38 +00:00
|
|
|
|
2011-09-18 13:11:04 +00:00
|
|
|
$port = ifLabel($port);
|
2010-07-18 11:38:38 +00:00
|
|
|
|
2011-03-28 10:39:55 +00:00
|
|
|
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
2010-07-18 11:38:38 +00:00
|
|
|
|
2011-09-18 13:11:04 +00:00
|
|
|
if ($port['ifInErrors_delta'] > 0 || $port['ifOutErrors_delta'] > 0)
|
2011-03-28 10:39:55 +00:00
|
|
|
{
|
2011-09-18 13:11:04 +00:00
|
|
|
$error_img = generate_port_link($port,"<img src='images/16/chart_curve_error.png' alt='Interface Errors' border=0>","port_errors");
|
2011-05-01 17:26:06 +00:00
|
|
|
} else {
|
|
|
|
$error_img = "";
|
|
|
|
}
|
2010-07-18 11:38:38 +00:00
|
|
|
|
2011-03-28 10:39:55 +00:00
|
|
|
echo("<tr style=\"background-color: $row_colour; padding: 5px;\" valign=top onmouseover=\"this.style.backgroundColor='$list_highlight';\" onmouseout=\"this.style.backgroundColor='$row_colour';\"
|
2012-05-16 13:25:50 +00:00
|
|
|
onclick=\"location.href='device/".$device['device_id']."/port/".$port['port_id']."/'\" style='cursor: pointer;'>
|
2011-03-28 10:39:55 +00:00
|
|
|
<td valign=top width=350>");
|
|
|
|
echo(" <span class=list-large>
|
2011-09-18 13:11:04 +00:00
|
|
|
" . generate_port_link($port, $port['ifIndex'] . ". ".$port['label']) . "
|
|
|
|
</span><br /><span class=interface-desc>".$port['ifAlias']."</span>");
|
2010-07-18 11:38:38 +00:00
|
|
|
|
2011-09-18 13:11:04 +00:00
|
|
|
if ($port['ifAlias']) { echo("<br />"); }
|
2010-07-18 11:38:38 +00:00
|
|
|
|
2011-03-28 10:39:55 +00:00
|
|
|
unset ($break);
|
|
|
|
if ($port_details)
|
|
|
|
{
|
2012-05-16 13:25:50 +00:00
|
|
|
foreach (dbFetchRows("SELECT * FROM `ipv4_addresses` WHERE `port_id` = ?", array($port['port_id'])) as $ip)
|
2011-03-28 10:39:55 +00:00
|
|
|
{
|
2011-05-01 17:26:06 +00:00
|
|
|
echo("$break <a class=interface-desc href=\"javascript:popUp('netcmd.php?cmd=whois&query=".$ip['ipv4_address']."')\">".$ip['ipv4_address']."/".$ip['ipv4_prefixlen']."</a>");
|
2011-03-28 10:39:55 +00:00
|
|
|
$break = ",";
|
2010-07-18 11:38:38 +00:00
|
|
|
}
|
2012-05-16 13:25:50 +00:00
|
|
|
foreach (dbFetchRows("SELECT * FROM `ipv6_addresses` WHERE `port_id` = ?", array($port['port_id'])) as $ip6);
|
2011-03-28 10:39:55 +00:00
|
|
|
{
|
2011-05-01 17:26:06 +00:00
|
|
|
echo("$break <a class=interface-desc href=\"javascript:popUp('netcmd.php?cmd=whois&query=".$ip6['ipv6_address']."')\">".Net_IPv6::compress($ip6['ipv6_address'])."/".$ip6['ipv6_prefixlen']."</a>");
|
2011-03-28 10:39:55 +00:00
|
|
|
$break = ",";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
echo("</span>");
|
|
|
|
|
2011-05-17 19:21:20 +00:00
|
|
|
$width="120"; $height="40"; $from = $config['time']['day'];
|
2011-03-28 10:39:55 +00:00
|
|
|
|
|
|
|
echo("</td><td width=135>");
|
2011-09-18 13:11:04 +00:00
|
|
|
echo(formatRates($port['ifInOctets_rate'] * 8)." <img class='optionicon' src='images/icons/arrow_updown.png' /> ".formatRates($port['ifOutOctets_rate'] * 8));
|
2011-03-28 10:39:55 +00:00
|
|
|
echo("<br />");
|
2011-09-18 13:11:04 +00:00
|
|
|
$port['graph_type'] = "port_bits";
|
2012-05-16 13:25:50 +00:00
|
|
|
echo(generate_port_link($port, "<img src='graph.php?type=".$port['graph_type']."&id=".$port['port_id']."&from=".$from."&to=".$config['time']['now']."&width=".$width."&height=".$height."&legend=no&bg=".
|
2011-09-18 13:11:04 +00:00
|
|
|
str_replace("#","", $row_colour)."'>", $port['graph_type']));
|
2011-03-28 10:39:55 +00:00
|
|
|
|
|
|
|
echo("</td><td width=135>");
|
2011-09-18 13:11:04 +00:00
|
|
|
echo("".formatRates($port['adslAturChanCurrTxRate']) . "/". formatRates($port['adslAtucChanCurrTxRate']));
|
2011-03-28 10:39:55 +00:00
|
|
|
echo("<br />");
|
2011-09-18 13:11:04 +00:00
|
|
|
$port['graph_type'] = "port_adsl_speed";
|
2012-05-16 13:25:50 +00:00
|
|
|
echo(generate_port_link($port, "<img src='graph.php?type=".$port['graph_type']."&id=".$port['port_id']."&from=".$from."&to=".$config['time']['now']."&width=".$width."&height=".$height."&legend=no&bg=".
|
2011-09-18 13:11:04 +00:00
|
|
|
str_replace("#","", $row_colour)."'>", $port['graph_type']));
|
2011-03-28 10:39:55 +00:00
|
|
|
|
|
|
|
echo("</td><td width=135>");
|
2011-09-18 13:11:04 +00:00
|
|
|
echo("".formatRates($port['adslAturCurrAttainableRate']) . "/". formatRates($port['adslAtucCurrAttainableRate']));
|
2011-03-28 10:39:55 +00:00
|
|
|
echo("<br />");
|
2011-09-18 13:11:04 +00:00
|
|
|
$port['graph_type'] = "port_adsl_attainable";
|
2012-05-16 13:25:50 +00:00
|
|
|
echo(generate_port_link($port, "<img src='graph.php?type=".$port['graph_type']."&id=".$port['port_id']."&from=".$from."&to=".$config['time']['now']."&width=".$width."&height=".$height."&legend=no&bg=".
|
2011-09-18 13:11:04 +00:00
|
|
|
str_replace("#","", $row_colour)."'>", $port['graph_type']));
|
2011-03-28 10:39:55 +00:00
|
|
|
|
|
|
|
echo("</td><td width=135>");
|
2011-09-18 13:11:04 +00:00
|
|
|
echo("".$port['adslAturCurrAtn'] . "dB/". $port['adslAtucCurrAtn'] . "dB");
|
2011-03-28 10:39:55 +00:00
|
|
|
echo("<br />");
|
2011-09-18 13:11:04 +00:00
|
|
|
$port['graph_type'] = "port_adsl_attenuation";
|
2012-05-16 13:25:50 +00:00
|
|
|
echo(generate_port_link($port, "<img src='graph.php?type=".$port['graph_type']."&id=".$port['port_id']."&from=".$from."&to=".$config['time']['now']."&width=".$width."&height=".$height."&legend=no&bg=".
|
2011-09-18 13:11:04 +00:00
|
|
|
str_replace("#","", $row_colour)."'>", $port['graph_type']));
|
2011-03-28 10:39:55 +00:00
|
|
|
|
|
|
|
echo("</td><td width=135>");
|
2011-09-18 13:11:04 +00:00
|
|
|
echo("".$port['adslAturCurrSnrMgn'] . "dB/". $port['adslAtucCurrSnrMgn'] . "dB");
|
2011-03-28 10:39:55 +00:00
|
|
|
echo("<br />");
|
2011-09-18 13:11:04 +00:00
|
|
|
$port['graph_type'] = "port_adsl_snr";
|
2012-05-16 13:25:50 +00:00
|
|
|
echo(generate_port_link($port, "<img src='graph.php?type=".$port['graph_type']."&id=".$port['port_id']."&from=".$from."&to=".$config['time']['now']."&width=".$width."&height=".$height."&legend=no&bg=".
|
2011-09-18 13:11:04 +00:00
|
|
|
str_replace("#","", $row_colour)."'>", $port['graph_type']));
|
2011-03-28 10:39:55 +00:00
|
|
|
|
|
|
|
echo("</td><td width=135>");
|
2011-09-18 13:11:04 +00:00
|
|
|
echo("".$port['adslAturCurrOutputPwr'] . "dBm/". $port['adslAtucCurrOutputPwr'] . "dBm");
|
2011-03-28 10:39:55 +00:00
|
|
|
echo("<br />");
|
2011-09-18 13:11:04 +00:00
|
|
|
$port['graph_type'] = "port_adsl_power";
|
2012-05-16 13:25:50 +00:00
|
|
|
echo(generate_port_link($port, "<img src='graph.php?type=".$port['graph_type']."&id=".$port['port_id']."&from=".$from."&to=".$config['time']['now']."&width=".$width."&height=".$height."&legend=no&bg=".
|
2011-09-18 13:11:04 +00:00
|
|
|
str_replace("#","", $row_colour)."'>", $port['graph_type']));
|
2010-07-18 11:38:38 +00:00
|
|
|
|
2011-09-18 13:11:04 +00:00
|
|
|
# if ($port[ifDuplex] != unknown) { echo("<span class=box-desc>Duplex " . $port['ifDuplex'] . "</span>"); } else { echo("-"); }
|
2010-07-18 11:38:38 +00:00
|
|
|
|
|
|
|
# echo("</td><td width=150>");
|
|
|
|
# echo($port_adsl['adslLineCoding']."/".$port_adsl['adslLineType']);
|
|
|
|
# echo("<br />");
|
|
|
|
# echo("Sync:".formatRates($port_adsl['adslAtucChanCurrTxRate']) . "/". formatRates($port_adsl['adslAturChanCurrTxRate']));
|
|
|
|
# echo("<br />");
|
|
|
|
# echo("Max:".formatRates($port_adsl['adslAtucCurrAttainableRate']) . "/". formatRates($port_adsl['adslAturCurrAttainableRate']));
|
|
|
|
# echo("</td><td width=150>");
|
|
|
|
# echo("Atten:".$port_adsl['adslAtucCurrAtn'] . "dB/". $port_adsl['adslAturCurrAtn'] . "dB");
|
|
|
|
# echo("<br />");
|
|
|
|
# echo("SNR:".$port_adsl['adslAtucCurrSnrMgn'] . "dB/". $port_adsl['adslAturCurrSnrMgn']. "dB");
|
|
|
|
|
|
|
|
echo("</td>");
|
|
|
|
|
2011-05-12 22:14:56 +00:00
|
|
|
?>
|