allow customisable filtering of interfaces from device_bits graph (also usable on theoretical device_pkts and device_errors)

git-svn-id: http://www.observium.org/svn/observer/trunk@1068 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-04-20 15:46:17 +00:00
parent caa5d5e4a0
commit 38a33e5661
8 changed files with 188 additions and 81 deletions

View File

@@ -2,6 +2,19 @@
## Common Functions
function device_by_id_cache($device_id)
{
global $device_cache;
if (is_array($device_cache[$device_id]))
{
$device = $device_cache[$device_id];
} else {
$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE `device_id` = '".$device_id."'"));
$device_cache[$device_id] = $device;
}
return $device;
}
function truncate($substring, $max = 50, $rep = '...'){
if(strlen($substring) < 1){ $string = $rep; } else { $string = $substring; }
$leave = $max - strlen ($rep);