[A-Za-z0-9]+)_(?P.+)/', $vars['type'], $graphtype); $type = $graphtype['type']; $subtype = $graphtype['subtype']; $id = $vars['id']; if(is_numeric($vars['device'])) { $device = device_by_id_cache($vars['device']); } elseif(!empty($vars['device'])) { $device = device_by_name($vars['device']); } if (is_file("includes/graphs/".$type."/auth.inc.php")) { include("includes/graphs/".$type."/auth.inc.php"); } if (!$auth) { include("includes/error-no-perm.inc.php"); } else { if (isset($config['graph_types'][$type][$subtype]['descr'])) { $title .= " :: ".$config['graph_types'][$type][$subtype]['descr']; } else { $title .= " :: ".ucfirst($subtype); } $graph_array = $vars; $graph_array['height'] = "60"; $graph_array['width'] = $thumb_width; $graph_array['legend'] = "no"; $graph_array['to'] = $config['time']['now']; print_optionbar_start(); echo($title); echo('
'); ?>
'); print_optionbar_end(); print_optionbar_start(); $thumb_array = array('sixhour' => '6 Hours', 'day' => '24 Hours', 'twoday' => '48 Hours', 'week' => 'One Week', 'twoweek' => 'Two Weeks', 'month' => 'One Month', 'twomonth' => 'Two Months','year' => 'One Year', 'twoyear' => 'Two Years'); echo(''); foreach ($thumb_array as $period => $text) { $graph_array['from'] = $config['time'][$period]; $link_array = $vars; $link_array['from'] = $graph_array['from']; $link_array['to'] = $graph_array['to']; $link_array['page'] = "graphs"; $link = generate_url($link_array); echo(''); } echo('
'); echo(''.$text.'
'); echo(''); echo(generate_graph_tag($graph_array)); echo(''); echo('
'); $graph_array = $vars; $graph_array['height'] = "300"; $graph_array['width'] = $graph_width; echo("
"); // datetime range picker ?> "); echo('
'); echo("
"); if ($vars['legend'] == "no") { echo(generate_link("Show Legend",$vars, array('page' => "graphs", 'legend' => NULL))); } else { echo(generate_link("Hide Legend",$vars, array('page' => "graphs", 'legend' => "no"))); } // FIXME : do this properly # if ($type == "port" && $subtype == "bits") # { echo(' | '); if ($vars['previous'] == "yes") { echo(generate_link("Hide Previous",$vars, array('page' => "graphs", 'previous' => NULL))); } else { echo(generate_link("Show Previous",$vars, array('page' => "graphs", 'previous' => "yes"))); } # } echo('
'); if ($vars['showcommand'] == "yes") { echo(generate_link("Hide RRD Command",$vars, array('page' => "graphs", 'showcommand' => NULL))); } else { echo(generate_link("Show RRD Command",$vars, array('page' => "graphs", 'showcommand' => "yes"))); } echo('
'); print_optionbar_end(); echo generate_graph_js_state($graph_array); echo('
'); echo(generate_graph_tag($graph_array)); echo("
"); if (isset($config['graph_descr'][$vars['type']])) { print_optionbar_start(); echo('
'); echo($config['graph_descr'][$vars['type']]); print_optionbar_end(); } if ($vars['showcommand']) { $_GET = $graph_array; $command_only = 1; include("includes/graphs/graph.inc.php"); } } ?>