mirror of https://github.com/mikaku/Monitorix.git
added new 'limit' functionality to 'ntp' graph
This commit is contained in:
parent
af3172c5fe
commit
1db83e9cfd
38
lib/ntp.pm
38
lib/ntp.pm
|
@ -191,8 +191,8 @@ sub ntp_cgi {
|
|||
my ($package, $config, $cgi) = @_;
|
||||
|
||||
my $ntp = $config->{ntp};
|
||||
my @rigid = split(',', $ntp->{rigid});
|
||||
my @limit = split(',', $ntp->{limit});
|
||||
my @rigid = split(',', ($ntp->{rigid} || ""));
|
||||
my @limit = split(',', ($ntp->{limit} || ""));
|
||||
my $tf = $cgi->{tf};
|
||||
my $colors = $cgi->{colors};
|
||||
my $graph = $cgi->{graph};
|
||||
|
@ -341,15 +341,7 @@ sub ntp_cgi {
|
|||
if($title) {
|
||||
main::graph_header($title, 2);
|
||||
}
|
||||
undef(@riglim);
|
||||
if(trim($rigid[0]) eq 1) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[0]));
|
||||
} else {
|
||||
if(trim($rigid[0]) eq 2) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[0]));
|
||||
push(@riglim, "--rigid");
|
||||
}
|
||||
}
|
||||
@riglim = @{setup_riglim($rigid[0], $limit[0])};
|
||||
undef(@tmp);
|
||||
undef(@tmpz);
|
||||
undef(@CDEF);
|
||||
|
@ -452,15 +444,7 @@ sub ntp_cgi {
|
|||
print(" </td>\n");
|
||||
print(" <td valign='top' bgcolor='" . $colors->{title_bg_color} . "'>\n");
|
||||
}
|
||||
undef(@riglim);
|
||||
if(trim($rigid[1]) eq 1) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[1]));
|
||||
} else {
|
||||
if(trim($rigid[1]) eq 2) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[1]));
|
||||
push(@riglim, "--rigid");
|
||||
}
|
||||
}
|
||||
@riglim = @{setup_riglim($rigid[1], $limit[1])};
|
||||
undef(@tmp);
|
||||
undef(@tmpz);
|
||||
undef(@CDEF);
|
||||
|
@ -486,7 +470,6 @@ sub ntp_cgi {
|
|||
"--width=$width",
|
||||
"--height=$height",
|
||||
@riglim,
|
||||
"--lower-limit=0",
|
||||
$zoom,
|
||||
@{$cgi->{version12}},
|
||||
@{$cgi->{version12_small}},
|
||||
|
@ -507,7 +490,6 @@ sub ntp_cgi {
|
|||
"--width=$width",
|
||||
"--height=$height",
|
||||
@riglim,
|
||||
"--lower-limit=0",
|
||||
@{$cgi->{version12}},
|
||||
@{$cgi->{version12_small}},
|
||||
@{$colors->{graph_colors}},
|
||||
|
@ -532,15 +514,7 @@ sub ntp_cgi {
|
|||
}
|
||||
}
|
||||
|
||||
undef(@riglim);
|
||||
if(trim($rigid[2]) eq 1) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[2]));
|
||||
} else {
|
||||
if(trim($rigid[2]) eq 2) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[2]));
|
||||
push(@riglim, "--rigid");
|
||||
}
|
||||
}
|
||||
@riglim = @{setup_riglim($rigid[2], $limit[2])};
|
||||
undef(@tmp);
|
||||
undef(@tmpz);
|
||||
undef(@CDEF);
|
||||
|
@ -575,7 +549,6 @@ sub ntp_cgi {
|
|||
"--width=$width",
|
||||
"--height=$height",
|
||||
@riglim,
|
||||
"--lower-limit=0",
|
||||
$zoom,
|
||||
@{$cgi->{version12}},
|
||||
@{$cgi->{version12_small}},
|
||||
|
@ -605,7 +578,6 @@ sub ntp_cgi {
|
|||
"--width=$width",
|
||||
"--height=$height",
|
||||
@riglim,
|
||||
"--lower-limit=0",
|
||||
@{$cgi->{version12}},
|
||||
@{$cgi->{version12_small}},
|
||||
@{$colors->{graph_colors}},
|
||||
|
|
Loading…
Reference in New Issue