mirror of https://github.com/mikaku/Monitorix.git
fixed to show correctly the graphs where there are less ports defined than the value of 'port->max'
This commit is contained in:
parent
b372c8e66f
commit
14b8def4e6
|
@ -381,7 +381,7 @@ sub port_cgi {
|
||||||
$u = "";
|
$u = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $max = max($port->{max}, scalar(my @pl = split(',', $port->{list})));
|
my $max = min($port->{max}, scalar(my @pl = split(',', $port->{list})));
|
||||||
for($n = 0; $n < $max; $n++) {
|
for($n = 0; $n < $max; $n++) {
|
||||||
$pl[$n] = trim($pl[$n]);
|
$pl[$n] = trim($pl[$n]);
|
||||||
my $pc = trim((split(',', $port->{desc}->{$pl[$n]}))[2]);
|
my $pc = trim((split(',', $port->{desc}->{$pl[$n]}))[2]);
|
||||||
|
@ -400,6 +400,7 @@ sub port_cgi {
|
||||||
$n = $n3 = 0;
|
$n = $n3 = 0;
|
||||||
$n2 = 1;
|
$n2 = 1;
|
||||||
while($n < $max) {
|
while($n < $max) {
|
||||||
|
next unless $pl[$n];
|
||||||
if($title) {
|
if($title) {
|
||||||
if($n == 0) {
|
if($n == 0) {
|
||||||
main::graph_header($title, $port->{graphs_per_row});
|
main::graph_header($title, $port->{graphs_per_row});
|
||||||
|
|
Loading…
Reference in New Issue