Revision 87ca9250
Added by Hamish Coleman over 17 years ago
- ID 87ca9250466431bb50a729b4824768685ca98f86
| mrtg.cgi | ||
|---|---|---|
|
#
|
||
|
# Requires the CGI package (in mandriva this is perl-CGI)
|
||
|
|
||
|
our $VERSION=5;
|
||
|
our $VERSION=0.5;
|
||
|
|
||
|
use strict;
|
||
|
use warnings;
|
||
| ... | ... | |
|
# TODO - parse the Target setting and create trees
|
||
|
# TODO - parse magic comments and create trees here
|
||
|
}
|
||
|
|
||
|
# TODO - look for nodes that have only one child and that child is
|
||
|
# childless and prune the child
|
||
|
}
|
||
|
|
||
|
# FIXME - global
|
||
| ... | ... | |
|
$ysize = $target->{ysize};
|
||
|
$xsize = $target->{xsize};
|
||
|
|
||
|
my $target_url;
|
||
|
if ($graph eq 'test') {
|
||
|
$target_url = 'gnuplot1.cgi?'.
|
||
|
'log='.$target->{_target}.'.log';
|
||
|
if (defined $target->{ylegend}) {
|
||
|
$target_url .= '&ylabel='.$target->{ylegend};
|
||
|
}
|
||
|
if (defined $target->{legendi}) {
|
||
|
$target_url .= '&li='.$target->{legendi};
|
||
|
}
|
||
|
if (defined $target->{legendo}) {
|
||
|
$target_url .= '&lo='.$target->{legendo};
|
||
|
}
|
||
|
} else {
|
||
|
$target_url = $target->{_target}."-$graph.".$target->{_imagetype};
|
||
|
}
|
||
|
|
||
|
# TODO - use workpath and other info to point to other directories
|
||
|
print a({-href=>$target->{_target}.".html"},
|
||
|
img{
|
||
|
-src=>$target->{_target}."-$graph.".$target->{_imagetype},
|
||
|
-src=>$target_url,
|
||
|
-height=>"$ysize",
|
||
|
-width=>"$xsize"
|
||
|
}
|
||
| ... | ... | |
|
print a({-href=>$selfurl.'&graph=year',-target=>'_self'}, 'Yearly')
|
||
|
}
|
||
|
print ' ';
|
||
|
if ($this_graph_period eq 'test') {
|
||
|
print 'Test';
|
||
|
} else {
|
||
|
print a({-href=>$selfurl.'&graph=test',-target=>'_self'}, 'Test')
|
||
|
}
|
||
|
print ' ';
|
||
|
|
||
|
print '(This List is ',$path,")\n";
|
||
|
}
|
||
Also available in: Unified diff
Add a test rendering mode for activating the new gnuplot output