diff --git a/html/includes/graphs/port/auth.inc.php b/html/includes/graphs/port/auth.inc.php index a8b35d003..38f126b0b 100644 --- a/html/includes/graphs/port/auth.inc.php +++ b/html/includes/graphs/port/auth.inc.php @@ -7,7 +7,7 @@ if (is_numeric($id) && ($config['allow_unauth_graphs'] || port_permitted($id))) $title = generate_device_link($device); $title .= " :: Port ".generate_port_link($port); - $graph_title = $device['hostname'] . "::" . $port['ifDescr']; + $graph_title = shorthost($device['hostname']) . "::" . strtolower(makeshortif($port['ifDescr'])); $auth = TRUE; diff --git a/html/pages/device/overview/generic/sensor.inc.php b/html/pages/device/overview/generic/sensor.inc.php index d24197f60..4a94120d6 100644 --- a/html/pages/device/overview/generic/sensor.inc.php +++ b/html/pages/device/overview/generic/sensor.inc.php @@ -6,7 +6,7 @@ if (count($sensors)) { echo('
'); echo('

' . $sensor_type . '

'); - $i = '1'; + $i = '0'; echo(''); foreach ($sensors as $sensor) { @@ -45,7 +45,7 @@ if (count($sensors)) $sensor['sensor_descr'] = truncate($sensor['sensor_descr'], 25, ''); echo(" - + "); diff --git a/includes/common.php b/includes/common.php index ec849c8d1..bb51a1a60 100644 --- a/includes/common.php +++ b/includes/common.php @@ -2,6 +2,19 @@ ## Common Functions +function shorthost($hostname, $len=12) +{ + $parts = explode(".", $hostname); + $shorthost = $parts[0]; + $i = 1; + while ($i < count($parts) && strlen($shorthost.'.'.$parts[$i]) < $len) + { + $shorthost = $shorthost.'.'.$parts[$i]; + $i++; + } + return ($shorthost); +} + function isCli() { if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) { diff --git a/includes/functions.php b/includes/functions.php index bb233c659..12fca48aa 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -56,19 +56,6 @@ function logfile($string) fclose($fd); } -function shorthost($hostname, $len=16) -{ - $parts = explode(".", $hostname); - $shorthost = $parts[0]; - $i = 1; - while ($i < count($parts) && strlen($shorthost.'.'.$parts[$i]) < $len) - { - $shorthost = $shorthost.'.'.$parts[$i]; - $i++; - } - return ($shorthost); -} - function getHostOS($device) { global $config, $debug; @@ -669,4 +656,4 @@ function is_port_valid($port, $device) return $valid; } -?> \ No newline at end of file +?>
".overlib_link($link, $sensor['sensor_descr'], $overlib_content)."".overlib_link($link, $sensor['sensor_descr'], $overlib_content)." ".overlib_link($link, $sensor_minigraph, $overlib_content)." ".overlib_link($link, " $sensor['sensor_limit'] ? "style='color: red'" : '') . '>' . $sensor['sensor_current'] . $sensor_unit . "", $overlib_content)."