17 |
# status colors |
# status colors |
18 |
my %cols = ( |
my %cols = ( |
19 |
'In Progress' => '0,255,0', |
'In Progress' => '0,255,0', |
20 |
'In Progress/Failure' => '255,64,255', |
'In Progress/Failures' => '255,64,255', |
21 |
'In Progress/Errors' => '255,64,0', |
'In Progress/Errors' => '255,64,0', |
22 |
'Queuing' => '255,255,0', |
'Queuing' => '255,255,0', |
23 |
'Aborted' => '255,0,0', |
'Aborted' => '255,0,0', |
75 |
} |
} |
76 |
|
|
77 |
print "Content-type: text/html |
print "Content-type: text/html |
78 |
|
Cache-Control: max-age=60, must-revalidate |
79 |
|
|
80 |
<html> |
<html> |
81 |
<head> |
<head> |
82 |
<title>OmniBack Gantt: $from - $to</title>"; |
<title>OmniBack Gantt: $from - $to</title> |
83 |
|
<meta HTTP-EQUIV=\"Refresh\" CONTENT=60>"; |
84 |
if ($use_js) { |
if ($use_js) { |
85 |
print ' |
print ' |
86 |
<script type="text/javascript" language="javascript" src="1k.js"></script> |
<script type="text/javascript" language="javascript" src="1k.js"></script> |
127 |
print "<tr><td align=right><small>hour grid</small></td><td colspan=2>"; |
print "<tr><td align=right><small>hour grid</small></td><td colspan=2>"; |
128 |
my @c = ("255,255,128","255,192,128"); |
my @c = ("255,255,128","255,192,128"); |
129 |
my $hr=strftime("%H",localtime ($from_t)); |
my $hr=strftime("%H",localtime ($from_t)); |
130 |
my $min_l=1; |
sub hour_bar { |
131 |
print color_bar(3600 - $from_t % 3600,$c[0],sprintf("%02d",$hr++ % 24)); |
my ($t,$c,$hr) = @_; |
132 |
|
my $clock_hr = $hr % 24; |
133 |
|
my $alt = sprintf("%02d:00",$clock_hr); |
134 |
|
if ($clock_hr == 0) { |
135 |
|
my $pix_hr = int(1 / $width); |
136 |
|
print color_bar($pix_hr,"0,0,0",strftime("%Y-%m-%d", localtime($from_t + $hr*3600))); |
137 |
|
print color_bar($t-$pix_hr,$c,$alt); |
138 |
|
} else { |
139 |
|
print color_bar($t,$c,$alt); |
140 |
|
} |
141 |
|
} |
142 |
|
hour_bar(3600 - $from_t % 3600,$c[0],$hr++); |
143 |
for (my $i=1; $i<int(($to_t-$from_t)/3600); $i++) { |
for (my $i=1; $i<int(($to_t-$from_t)/3600); $i++) { |
144 |
print color_bar(3600,$c[1],sprintf("%02d",$hr++ % 24)); |
hour_bar(3600,$c[1],$hr++); |
145 |
push @c, shift @c; |
push @c, shift @c; |
146 |
} |
} |
147 |
print color_bar($from_t % 3600,$c[1],sprintf("%02d",$hr % 24)); |
hour_bar($from_t % 3600,$c[1],$hr); |
148 |
print "</td></tr>\n"; |
print "</td></tr>\n"; |
149 |
} |
} |
150 |
|
|
259 |
print STDERR "[middle filler $curr_t:$t]" if ($debug); |
print STDERR "[middle filler $curr_t:$t]" if ($debug); |
260 |
print bar($t); |
print bar($t); |
261 |
$curr_t = $start_t; |
$curr_t = $start_t; |
262 |
|
} else { |
263 |
|
# prepend too few seconds to next event |
264 |
|
$start_t = $curr_t; |
265 |
} |
} |
266 |
|
|
267 |
my $len = $fin_t - $start_t; |
my $len = $fin_t - $start_t; |
328 |
# it will first evaluate bar sub (thus increasing number by one) and |
# it will first evaluate bar sub (thus increasing number by one) and |
329 |
# then display number (wrongly). |
# then display number (wrongly). |
330 |
} |
} |
331 |
print "</table>\n<p>Reload <a href=\"",$q->url(-relative=>1),"\">current</a>.</p></body></html>"; |
print "</table>\n<p>Reload <a href=\"",$q->url(-relative=>1),"\">current</a> or see <a href=\"db2gantt_help.html\">help</a>.</p></body></html>"; |
332 |
|
|