/[omni_gantt]/db2gantt.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /db2gantt.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by dpavlin, Mon Dec 2 17:14:48 2002 UTC revision 1.28 by dpavlin, Thu Jun 26 20:36:48 2003 UTC
# Line 10  use POSIX qw(strftime); Line 10  use POSIX qw(strftime);
10    
11  my $debug = 0;  my $debug = 0;
12    
13    # comment out following field if you don't want links to omni reports
14    # or haven't installed repgen.pl
15    my $repgen_url="/omni/"; # URL to pages with rptgen.pl
16    
17  my $width = 600;        # width of bar  my $width = 600;        # width of bar
18  my $height = 15;        # height of bar  my $height = 15;        # height of bar
19  my $use_js = 1;         # use JavaScript pop-up  my $use_js = 1;         # use JavaScript pop-up
# Line 232  sub color_bar { Line 236  sub color_bar {
236    
237          print STDERR "bar[$col] len:$l s scale:",($len_t/$width)," size:$size px<br> alt:$alt\n" if ($debug);          print STDERR "bar[$col] len:$l s scale:",($len_t/$width)," size:$size px<br> alt:$alt\n" if ($debug);
238    
239          my $html = "<img src=\"".$q->url(-relative=>1)."/$col\" width=\"$size\" height=\"$h\"";          my $html;
240    
241            my ($html_end, $img_end) = ("","");
242            if ($repgen_url && $alt =~ m#(\d\d\d\d)/(\d\d)/(\d\d)-(\d+)#) {
243                    $html .= "<a href=\"$repgen_url/$1-$2-$3-$4.html\">";
244                    $html_end .= "</a>";
245                    $img_end .= " border=0";
246            }
247    
248            $html .= "<img src=\"".$q->url(-relative=>1)."/$col\" width=\"$size\" height=\"$h\"";
249    
250          if ($use_js && $alt) {          if ($use_js && $alt) {
251                  $html .= " onmouseover=\"T('$alt')\" onmouseout=\"T()\"";                  $html .= " onmouseover=\"T('$alt')\" onmouseout=\"T()\"";
252          } elsif ($alt) {          } elsif ($alt) {
253                  $html .= " alt=\"$alt\"";                  $html .= " alt=\"$alt\"";
254          }          }
255          $html .= ">";          $html .= "$img_end>$html_end";
256    
257          return($html);          return($html);
258  }  }
# Line 289  sub sum_bar { Line 302  sub sum_bar {
302                          $last_var = $v;                          $last_var = $v;
303                  }                  }
304          }          }
305            # fix division by zero
306            $max_use++ if ($max_use == 0);
307          my $h = $last_var / $max_use * $height;          my $h = $last_var / $max_use * $height;
308          my $c = 255 - int (255 * $last_var / $max_use);          my $c = 255 - int (255 * $last_var / $max_use);
309          print color_bar($len,"$c,$c,$c","$last_var concurrent jobs",1,$h+1) if ($len);          print color_bar($len,"$c,$c,$c","$last_var concurrent jobs",1,$h+1) if ($len);

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.26