From a42c178799a1b4f7f05915e221d792fbbe5ba782 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Mon, 26 Sep 2011 14:06:48 +0000 Subject: [PATCH] migrate pseudowires to new format git-svn-id: http://www.observium.org/svn/observer/trunk@2576 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/functions.inc.php | 4 ++-- html/pages/pseudowires.inc.php | 31 ++++++++++++++++++++----------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 29fd63b6e5..ef51fb5e47 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -413,8 +413,8 @@ function generate_port_url($port, $vars=array()) function generate_port_thumbnail($args) { - if (!$args['bg']) { $args['bg'] = "FFFFF"; } - $args['content'] = ""; + if (!$args['bg']) { $args['bg'] = "FFFFFF"; } + $args['content'] = ""; echo(generate_port_link($args, $args['content'])); } diff --git a/html/pages/pseudowires.inc.php b/html/pages/pseudowires.inc.php index fdee743430..362a0d3759 100644 --- a/html/pages/pseudowires.inc.php +++ b/html/pages/pseudowires.inc.php @@ -1,15 +1,25 @@ 'pseudowires'); + print_optionbar_start(); -echo("Details | Graphs : -Mini -"); +echo('Pseudowires » '); + +if ($vars['view'] == "detail") { echo(''); } +echo(generate_link("Details",$link_array,array('view'=> 'detail'))); +if ($vars['view'] == "detail") { echo(''); } + +echo(" | "); + +if ($vars['view'] == "minigraphs") { echo(''); } +echo(generate_link("Mini Graphs",$link_array,array('view' => "minigraphs"))); +if ($vars['view'] == "minigraphs") { echo(''); } print_optionbar_end(); -list($opta, $optb, $optc, $optd, $opte) = explode("/", $_GET['opta']); - echo(""); foreach (dbFetchRows("SELECT * FROM pseudowires AS P, ports AS I, devices AS D WHERE P.interface_id = I.interface_id AND I.device_id = D.device_id ORDER BY D.hostname,I.ifDescr") as $pw_a) @@ -38,10 +48,9 @@ foreach (dbFetchRows("SELECT * FROM pseudowires AS P, ports AS I, devices AS D W "); echo(""); - if ($opta == "graphs") + if ($vars['view'] == "minigraphs") { echo("
".generate_device_link($pw_b)."".generate_port_link($pw_b)."
".$pw_a['ifAlias']."".$pw_b['ifAlias']."
"); - if (!$optb) { $optb = "mini"; } if ($pw_a) { @@ -50,10 +59,10 @@ foreach (dbFetchRows("SELECT * FROM pseudowires AS P, ports AS I, devices AS D W $pw_a['from'] = $day; $pw_a['to'] = $now; $pw_a['bg'] = $bg; - $types = array('bits','pkts','errors'); + $types = array('bits','upkts','errors'); foreach ($types as $graph_type) { - $pw_a['graph_type'] = $graph_type; + $pw_a['graph_type'] = "port_".$graph_type; generate_port_thumbnail($pw_a); } } @@ -66,10 +75,10 @@ foreach (dbFetchRows("SELECT * FROM pseudowires AS P, ports AS I, devices AS D W $pw_b['from'] = $day; $pw_b['to'] = $now; $pw_b['bg'] = $bg; - $types = array('bits','pkts','errors'); + $types = array('bits','upkts','errors'); foreach ($types as $graph_type) { - $pw_b['graph_type'] = $graph_type; + $pw_b['graph_type'] = "port_".$graph_type; generate_port_thumbnail($pw_b); } }