diff --git a/html/includes/front/top_ports.inc.php b/html/includes/front/top_ports.inc.php index e86e768f1..cdcd887e1 100644 --- a/html/includes/front/top_ports.inc.php +++ b/html/includes/front/top_ports.inc.php @@ -36,194 +36,4 @@ foreach (dbFetchRows($query) as $result) { } echo(''); -/* -// FIXME: Change to port_rrd_exists($device, $port) -if (file_exists($config['rrd_dir'] . "/" . $device['hostname'] . "/port-". $port['ifIndex'] . ".rrd")) -{ - $iid = $id; - echo("
Interface Traffic
"); - $graph_type = "port_bits"; - - include("includes/print-interface-graphs.inc.php"); - - echo("
Interface Packets
"); - $graph_type = "port_upkts"; - - include("includes/print-interface-graphs.inc.php"); - - echo("
Interface Non Unicast
"); - $graph_type = "port_nupkts"; - - include("includes/print-interface-graphs.inc.php"); - - echo("
Interface Errors
"); - $graph_type = "port_errors"; - - include("includes/print-interface-graphs.inc.php"); - - if (is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . $port['ifIndex'] . "-dot3.rrd")) - { - echo("
Ethernet Errors
"); - $graph_type = "port_etherlike"; - - include("includes/print-interface-graphs.inc.php"); - } -} -*/ - -/* from html/includes/print-interface.inc.php: - -generate_port_link($port, $port['ifIndex'] . ". ".$port['label']) - -*/ - -/* from html/includes/functions.inc.php: - -function generate_port_link($port, $text = NULL, $type = NULL) -{ - global $config; - - $port = ifNameDescr($port); - if (!$text) { $text = fixIfName($port['label']); } - if ($type) { $port['graph_type'] = $type; } - if (!isset($port['graph_type'])) { $port['graph_type'] = 'port_bits'; } - - $class = ifclass($port['ifOperStatus'], $port['ifAdminStatus']); - - if (!isset($port['hostname'])) { $port = array_merge($port, device_by_id_cache($port['device_id'])); } - - $content = "
".$port['hostname']." - " . fixifName($port['label']) . "
"; - if ($port['ifAlias']) { $content .= $port['ifAlias']."
"; } - $content .= "
"; - $graph_array['type'] = $port['graph_type']; - $graph_array['legend'] = "yes"; - $graph_array['height'] = "100"; - $graph_array['width'] = "340"; - $graph_array['to'] = $config['time']['now']; - $graph_array['from'] = $config['time']['day']; - $graph_array['id'] = $port['port_id']; - $content .= generate_graph_tag($graph_array); - $graph_array['from'] = $config['time']['week']; - $content .= generate_graph_tag($graph_array); - $graph_array['from'] = $config['time']['month']; - $content .= generate_graph_tag($graph_array); - $graph_array['from'] = $config['time']['year']; - $content .= generate_graph_tag($graph_array); - $content .= "
"; - - $url = generate_port_url($port); - - if (port_permitted($port['port_id'], $port['device_id'])) { - return overlib_link($url, $text, $content, $class); - } else { - return fixifName($text); - } -} -*/ - -/* includes/print-interface-graphs.inc.php: - -global $config; - -$graph_array['height'] = "100"; -$graph_array['width'] = "215"; -$graph_array['to'] = $config['time']['now']; -$graph_array['id'] = $port['port_id']; -$graph_array['type'] = $graph_type; - -include("includes/print-graphrow.inc.php"); - -*/ - -/* html/includes/print-graphrow.inc.php: -global $config; - -if($_SESSION['widescreen']) -{ - if (!$graph_array['height']) { $graph_array['height'] = "110"; } - if (!$graph_array['width']) { $graph_array['width'] = "215"; } - $periods = array('sixhour', 'day', 'week', 'month', 'year', 'twoyear'); -} else { - if (!$graph_array['height']) { $graph_array['height'] = "100"; } - if (!$graph_array['width']) { $graph_array['width'] = "215"; } - $periods = array('day', 'week', 'month', 'year'); -} - -$graph_array['to'] = $config['time']['now']; - -foreach ($periods as $period) -{ - $graph_array['from'] = $config['time'][$period]; - $graph_array_zoom = $graph_array; - $graph_array_zoom['height'] = "150"; - $graph_array_zoom['width'] = "400"; - - $link_array = $graph_array; - $link_array['page'] = "graphs"; - unset($link_array['height'], $link_array['width']); - $link = generate_url($link_array); - - echo(overlib_link($link, generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL)); -} - -function overlib_link($url, $text, $contents, $class) -{ - global $config; - - $contents = str_replace("\"", "\'", $contents); - $output = '"; - $output .= $text.""; - - return $output; -} - -function print_graph_tag($args) -{ - echo(generate_graph_tag($args)); -} - -function generate_graph_tag($args) -{ - - foreach ($args as $key => $arg) - { - $urlargs[] = $key."=".$arg; - } - - return ''; -} - -function generate_port_url($port, $vars=array()) -{ - return generate_url(array('page' => 'device', 'device' => $port['device_id'], 'tab' => 'port', 'port' => $port['port_id']), $vars); -} - -function generate_link($text, $vars, $new_vars = array()) -{ - return ''.$text.''; -} - -function generate_url($vars, $new_vars = array()) -{ - - $vars = array_merge($vars, $new_vars); - - $url = $vars['page']."/"; - unset($vars['page']); - - foreach ($vars as $var => $value) - { - if ($value == "0" || $value != "" && strstr($var, "opt") === FALSE && is_numeric($var) === FALSE) - { - $url .= $var ."=".$value."/"; - } - } - - return($url); - -} - -*/ - ?>