--- db2gantt.cgi 2002/09/18 14:00:18 1.22 +++ db2gantt.cgi 2002/12/02 17:14:48 1.26 @@ -28,6 +28,7 @@ 'Completed/Failure' => '128,0,128', 'Mount Request' => '128,128,255', 'Mount/Errors' => '255,64,128', + 'Mount/Failures' => '255,128,192', ); my $int_t = (12 * 60 * 60); # interval to display on one screen @@ -35,14 +36,25 @@ #--- no user servicable parts below this line -# time range - -$int_t = m_round($int_t); +my $q=new CGI; my ($from_t,$to_t) = (time()-$int_t,time()); -$to_t = param('to_t') if (param('to_t')); $from_t = param('from_t') if (param('from_t')); +$to_t = param('to_t') if (param('to_t')); + +if (param('f-1')) { + $from_t = $from_t - param('int_f-1') || $int_t; +} elsif (param('f+1')) { + $from_t = $from_t + param('int_f+1') || $int_t; +} elsif (param('t-1')) { + $to_t = $from_t - param('int_t-1') || $int_t; +} elsif (param('t+1')) { + $to_t = $from_t + $int_t; +} + +# time range +$int_t = m_round($int_t); # round to nearest minute sub m_round { @@ -69,7 +81,7 @@ $im->transparent($back); my $col = path_info(); $col =~ s,/,,g; my ($r,$g,$b) = split(/,/,$col); - my $col = $im->colorAllocate($r,$g,$b); + $col = $im->colorAllocate($r,$g,$b); $im->fill(0,0,$col); print "Content-Length: ",length($im->png),"\n\n"; binmode STDOUT; @@ -77,6 +89,9 @@ exit; } +# open DBI connection +my $dbh = DBI->connect("DBI:Pg:dbname=gantt","","") || die $DBI::errstr; + print "Content-type: text/html Cache-Control: max-age=60, must-revalidate @@ -97,33 +112,43 @@ '; } -print "
"; +print " +