--- db2gantt.cgi 2002/09/16 15:09:19 1.20 +++ db2gantt.cgi 2002/09/16 15:29:00 1.21 @@ -20,6 +20,7 @@ 'In Progress/Failures' => '192,64,192', 'In Progress/Errors' => '255,128,128', 'Queuing' => '255,255,0', + 'Queuing/Errors' => '255,192,64', 'Aborted' => '255,0,0', 'Failed' => '255,0,0', 'Completed' => '64,255,64', @@ -59,16 +60,18 @@ # keep count of each status my %count; -if (param('pic')) { - print "Content-type: image/png\nCache-Control: max-age=3600, must-revalidate\n\n"; +if (path_info()) { + print "Content-type: image/png\nCache-Control: max-age=86400, must-revalidate\nExpires: ",scalar localtime(time()+24*60*60),"\nLast-Modified: ",scalar localtime(0),"\n"; # create picture using GD use GD; my $im = new GD::Image(1,$height); my $back = $im->colorAllocate(255,255,255); $im->transparent($back); - my ($r,$g,$b) = split(/,/,param('pic')); + my $col = path_info(); $col =~ s,/,,g; + my ($r,$g,$b) = split(/,/,$col); my $col = $im->colorAllocate($r,$g,$b); $im->fill(0,0,$col); + print "Content-Length: ",length($im->png),"\n\n"; binmode STDOUT; print $im->png; exit; @@ -80,7 +83,7 @@ OmniBack Gantt: $from - $to -"; +"; if ($use_js) { print ' @@ -204,7 +207,7 @@ print STDERR "bar[$col] len:$l s scale:",($len_t/$width)," size:$size px
alt:$alt\n" if ($debug); - my $html = "url(-relative=>1)."?pic=$col\" width=\"$size\" height=\"$h\""; + my $html = "url(-relative=>1)."/$col\" width=\"$size\" height=\"$h\""; if ($use_js && $alt) { $html .= " onmouseover=\"T('$alt')\" onmouseout=\"T()\""; @@ -254,14 +257,14 @@ $len++; } else { my $h = $last_var / $max_use * $height; - my $c = 255 - 255 * $last_var / $max_use; + my $c = 255 - int (255 * $last_var / $max_use); print color_bar($len,"$c,$c,$c","$last_var concurrent jobs",1,$h+1); $len = 0; $last_var = $v; } } my $h = $last_var / $max_use * $height; - my $c = 255 - 255 * $last_var / $max_use; + my $c = 255 - int (255 * $last_var / $max_use); print color_bar($len,"$c,$c,$c","$last_var concurrent jobs",1,$h+1) if ($len); print ""; }