summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-08-24 14:34:49 +0200
committerTobi Oetiker <tobi@oetiker.ch>2007-08-24 14:34:49 +0200
commite6124dcdd53763c601f6c2f6186abae59c45237c (patch)
tree325efccff81040d8fbac2abec5191135a8b3a524
parent3f641e37b99d5aa18ecf2f58364696ac17f859d2 (diff)
downloadsmokeping-e6124dcdd53763c601f6c2f6186abae59c45237c.tar.gz
smokeping-e6124dcdd53763c601f6c2f6186abae59c45237c.tar.xz
fixed unknonwn variables
-rw-r--r--etc/basepage.html.dist2
-rw-r--r--htdocs/cropper/smokeping-zoom.js (renamed from htdocs/cropper/smokeping-cropper.js)7
-rw-r--r--lib/Smokeping.pm10
3 files changed, 10 insertions, 9 deletions
diff --git a/etc/basepage.html.dist b/etc/basepage.html.dist
index 45e8f30..6334061 100644
--- a/etc/basepage.html.dist
+++ b/etc/basepage.html.dist
@@ -46,7 +46,7 @@ a.menulink:hover {
<script src="cropper/lib/prototype.js" type="text/javascript"></script>
<script src="cropper/lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
<script src="cropper/cropper.js" type="text/javascript"></script>
-<script src="cropper/smokeping_cropper.js" type="text/javascript"></script>
+<script src="cropper/smokeping-zoom.js" type="text/javascript"></script>
diff --git a/htdocs/cropper/smokeping-cropper.js b/htdocs/cropper/smokeping-zoom.js
index 572357c..8129801 100644
--- a/htdocs/cropper/smokeping-cropper.js
+++ b/htdocs/cropper/smokeping-zoom.js
@@ -64,6 +64,7 @@ function JSToISODate(mydate) {
// example with minimum dimensions
var myCropper;
+
// will be started by modified iSelect (StopApply Function)
var StartDateString = 0;
var EndDateString = 0;
@@ -87,12 +88,12 @@ function changeRRDImage(coords,dimensions){
var myRawTarget = myURLObj.getUrlParameterValue("target");
var myParsedStartDate = ISODateToJS(myRawStartDate);
- var myParsedStartEpoch = Math.floor(myParsedStartDate.getTime()/1000.0);
+ myParsedStartEpoch = Math.floor(myParsedStartDate.getTime()/1000.0);
var myParsedStopDate = ISODateToJS(myRawStopDate);
- var myParsedStopEpoch = Math.floor(myParsedStopDate.getTime()/1000.0);
+ myParsedStopEpoch = Math.floor(myParsedStopDate.getTime()/1000.0);
- var myParsedDivEpoch = myParsedStopEpoch - myParsedStartEpoch;
+ myParsedDivEpoch = myParsedStopEpoch - myParsedStartEpoch;
var mySerialDate = new Date();
var mySerial = mySerialDate.getTime();
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 28e1288..e76d269 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -872,7 +872,7 @@ sub get_detail ($$$$;$){
$imghref = $cfg->{General}{imgurl}."/".(join "/", @dirs)."/${file}";
@tasks = @{$cfg->{Presentation}{detail}{_table}};
for my $slave (@slaves){
- my $s = "~$slave" if $slave;
+ my $s = $slave ? "~$slave" : "";
if (open (HG,"<${imgbase}.maxheight$s")){
while (<HG>){
chomp;
@@ -883,7 +883,7 @@ sub get_detail ($$$$;$){
}
$max->{$s} = findmax $cfg, $base_rrd.$s.".rrd";
if (open (HG,">${imgbase}.maxheight$s")){
- foreach my $size (keys %{$max}){
+ foreach my $size (keys %{$max->{$s}}){
print HG "$s $max->{$s}{$size}\n";
}
close HG;
@@ -1016,7 +1016,7 @@ sub get_detail ($$$$;$){
my ($desc,$start,$end) = @{$_};
my %xs;
my %ys;
- my $sigtime = $end =~ /^\d+$/ ? $end : time;
+ my $sigtime = ($end and $end =~ /^\d+$/) ? $end : time;
my $date = $cfg->{Presentation}{detail}{strftime} ?
POSIX::strftime($cfg->{Presentation}{detail}{strftime}, localtime($sigtime)) : scalar localtime($sigtime);
if ( $RRDs::VERSION >= 1.199908 ){
@@ -1316,7 +1316,7 @@ sub display_webpage($$){
my $step = $cfg->{__probes}{$targets->{probe}}->step();
# lets see if the charts are opened
my $charts = 0;
- $charts = 1 if defined $cfg->{Presentation}{charts} and $open->[0] eq '__charts';
+ $charts = 1 if defined $cfg->{Presentation}{charts} and $open->[0] and $open->[0] eq '__charts';
if ($charts and ( not defined $cfg->{__sortercache}
or $cfg->{__sortercachekeeptime} < time )){
# die "ERROR: Chart $open->[1] does not exit.\n"
@@ -3414,7 +3414,7 @@ sub cgi ($) {
print $q->header; # no HTML output on success
}
} else {
- if ($q->param('displaymode') ne 'a'){ #in ayax mode we do not issue a header YET
+ if (not $q->param('displaymode') or $q->param('displaymode') ne 'a'){ #in ayax mode we do not issue a header YET
print $q->header(-type=>'text/html',
-expires=>'+'.($cfg->{Database}{step}).'s',
-charset=> ( $cfg->{Presentation}{charset} || 'iso-8859-15')