improve efficiency of devices/ports/, add some caching, fix db profiling.

git-svn-id: http://www.observium.org/svn/observer/trunk@2349 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-19 10:02:55 +00:00
parent 2978386af4
commit bf1d43ae65
6 changed files with 67 additions and 16 deletions

View File

@ -250,6 +250,7 @@ function generate_port_link($args, $text = NULL, $type = NULL)
if (!isset($args['graph_type'])) { $args['graph_type'] = 'port_bits'; }
$class = ifclass($args['ifOperStatus'], $args['ifAdminStatus']);
if (!isset($args['hostname'])) { $args = array_merge($args, device_by_id_cache($args['device_id'])); }
$content = "<div class=list-large>".$args['hostname']." - " . fixifName($args['label']) . "</div>";
@ -273,7 +274,7 @@ function generate_port_link($args, $text = NULL, $type = NULL)
$url = generate_port_url($args);
if (port_permitted($args['interface_id'])) {
if (port_permitted($args['interface_id'], $args['device_id'])) {
return overlib_link($url, $text, $content, $class);
} else {
return fixifName($text);