fix some errors on linkusage page

This commit is contained in:
Nicolas Debrigode 2018-01-02 17:08:25 +01:00
parent 902d6263d6
commit f37a9352e7
3 changed files with 13 additions and 3 deletions

View File

@ -17,6 +17,8 @@ $show95th = true;
$ntop = 20;
$showv6 = true;
$showtitledetail = true;
$hidelinkusagename = false;
$vertical_label = true; # vertical IN/OUT label in graph
$brighten_negative = true; # brighten the "negative" part of graphs

View File

@ -54,6 +54,13 @@ $cmd = "$rrdtool graph - " .
if (!$compat_rrdtool12)
$cmd .= "--full-size-mode ";
if ($vertical_label) {
if($outispositive)
$cmd .= "--vertical-label '<- IN | OUT ->' ";
else
$cmd .= "--vertical-label '<- OUT | IN ->' ";
}
if($showtitledetail && @$_GET['dname'] != "")
$cmd .= "--title " . escapeshellarg($_GET['dname']) . " ";
else

View File

@ -1,6 +1,7 @@
<?php include("func.inc"); ?>
<?php
$selected_links = array();
$knownlinks = getknownlinks();
$hours = 24;
if (@$_GET['numhours'])
@ -10,10 +11,10 @@ $i = 0;
foreach ($knownlinks as $link) {
$class = (($i % 2) == 0) ? "" : "even";
if ($showv6) {
$list_img[$link['tag']] = '<img alt="link graph" src="linkgraph.php?link='.$link['tag'].'&numhours='.$hours.'&width='.$linkusage_graph_width.'&height='.$linkusage_graph_height.'&dname='.rawurlencode($link['descr'] . " - IPv4").'" width="'.$linkusage_graph_width.'" height="'.$linkusage_graph_height.'" border="0" />';
$list_img_v6[$link['tag']] = '<img alt="link graph" src="linkgraph.php?link='.$link['tag'].'&numhours='.$hours.'&width='.$linkusage_graph_width.'&height='.$linkusage_graph_height.'&dname='.rawurlencode($link['descr'] . " - IPv6").'&v=6" width="'.$linkusage_graph_width.'" height="'.$linkusage_graph_height.'" border="0" />';
$list_img[$link['tag']] = '<img alt="link graph" src="linkgraph.php?link='.$link['tag'].'&numhours='.$hours.'&width='.$default_graph_width.'&height='.$default_graph_height.'&dname='.rawurlencode($link['descr'] . " - IPv4").'&v=4" width="'.$default_graph_width.'" height="'.$default_graph_height.'" border="0" />';
$list_img_v6[$link['tag']] = '<img alt="link graph" src="linkgraph.php?link='.$link['tag'].'&numhours='.$hours.'&width='.$default_graph_width.'&height='.$default_graph_height.'&dname='.rawurlencode($link['descr'] . " - IPv6").'&v=6" width="'.$default_graph_width.'" height="'.$default_graph_height.'" border="0" />';
} else {
$list_img[$link['tag']] = '<img alt="link graph" src="linkgraph.php?link='.$link['tag'].'&numhours='.$hours.'&width='.$linkusage_graph_width.'&height='.$linkusage_graph_height.'&dname='.rawurlencode($link['descr']).'" width="'.$linkusage_graph_width.'" height="'.$linkusage_graph_height.'" border="0" />';
$list_img[$link['tag']] = '<img alt="link graph" src="linkgraph.php?link='.$link['tag'].'&numhours='.$hours.'&width='.$default_graph_width.'&height='.$default_graph_height.'&dname='.rawurlencode($link['descr']).'&v=4" width="'.$default_graph_width.'" height="'.$default_graph_height.'" border="0" />';
}
if ( ($showtitledetail && !$hidelinkusagename) || (!$showtitledetail) ) {
$txt_title[$link['tag']] = $link['descr'];