mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-30 16:14:21 +02:00
updates to mac accounting drawing, adding mini-graphs to interface details pages
git-svn-id: http://www.observium.org/svn/observer/trunk@472 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+42
-23
@@ -20,37 +20,56 @@
|
||||
$query = mysql_query("SELECT *, (M.bps_in + M.bps_out) as bps FROM `mac_accounting` AS M, `interfaces` AS I, `devices` AS D WHERE M.interface_id = '".$interface['interface_id']."' AND I.interface_id = M.interface_id AND I.device_id = D.device_id ORDER BY bps DESC");
|
||||
echo("<div style='clear: both;'>");
|
||||
|
||||
|
||||
if($_GET['optd'] == "top10") {
|
||||
if($_GET['opte']) {
|
||||
$from = "-" . $_GET['opte'];
|
||||
} else { $from = "-1day"; }
|
||||
echo("<div style='margin: auto; width: 831px;';>
|
||||
<img src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&type=mac_acc_total&from=$from&to=now&width=750&height=245' />
|
||||
<div style='width: 200; float: left;'>
|
||||
<span class=device-head style='line-height: 30px;'>Day</span>
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/top10/1day/'>
|
||||
<img src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&type=mac_acc_total&from=-1day&to=now&width=150&height=50' />
|
||||
if($_GET['optc']) {
|
||||
$stat = $_GET['optc'];
|
||||
} else { $stat = "bits"; }
|
||||
|
||||
echo("<div style=' margin:0px; float: left;';>
|
||||
<div style='margin: 0px 10px 20px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Day</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1day/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&stat=$stat&type=mac_acc_total&from=-1day&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='width: 200; float: left;'>
|
||||
<span class=device-head style='line-height: 30px;'>Week</span>
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/top10/1week/'>
|
||||
<img src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&type=mac_acc_total&from=-1week&to=now&width=150&height=50' />
|
||||
</div>
|
||||
<div style='margin: 0px 10px 20px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Week</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1week/'>
|
||||
<img valign=middle src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&type=mac_acc_total&stat=$stat&from=-1week&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='width: 200; float: left;'>
|
||||
<span class=device-head style='line-height: 30px;'>Month</span>
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/top10/1month/'>
|
||||
<img src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&type=mac_acc_total&from=-1month&to=now&width=150&height=50' />
|
||||
</div>
|
||||
<div style='margin: 0px 10px 20px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Month</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1month/'>
|
||||
<img valign=middle src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&type=mac_acc_total&stat=$stat&from=-1month&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='width: 200; float: left;'>
|
||||
<span class=device-head style='line-height: 30px;'>Year</span>
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/top10/1year/'>
|
||||
<img src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&type=mac_acc_total&from=-1year&to=now&width=150&height=50' />
|
||||
</div>
|
||||
<div style='margin: 0px 10px 20px 0px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Year</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/$stat/top10/1year/'>
|
||||
<img valign=middle src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&type=mac_acc_total&stat=$stat&from=-1year&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style='float: left;'>
|
||||
<img src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&type=mac_acc_total&stat=$stat&from=$from&to=now&width=750&height=245' />
|
||||
</div>
|
||||
<div style=' margin:0px; float: left;';>
|
||||
<div style='margin: 0px 0px 20px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Traffic</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/bits/top10/1day/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&stat=bits&type=mac_acc_total&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
<div style='margin: 0px 0px 20px 10px; padding:5px; background: #e5e5e5;'>
|
||||
<span class=device-head>Packets</span><br />
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/interface/".$interface['interface_id']."/macaccounting/pkts/top10/1day/'>
|
||||
<img style='border: #5e5e5e 2px;' valign=middle src='".$config['base_url']."/graph.php?if=".$interface['interface_id']."&stat=pkts&type=mac_acc_total&from=$from&to=now&width=150&height=50' />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
");
|
||||
Reference in New Issue
Block a user