Add README Copyright and License notices, pus minor tidying.
[buildfarm-server.git] / templates / dashboard.tt.ttc
1 #------------------------------------------------------------------------
2 # Compiled template generated by the Template Toolkit version 2.14
3 #------------------------------------------------------------------------
4
5 Template::Document->new({
6     METADATA => {
7         'modtime' => '1127835909',
8         'name' => 'dashboard.tt',
9     },
10     BLOCK => sub {
11         my $context = shift || die "template sub called without context\n";
12         my $stash   = $context->stash;
13         my $output  = '';
14         my $error;
15         
16         eval { BLOCK: {
17     #line 1 "/home/community/pgbuildfarm/templates/dashboard.tt"
18     $stash->set('flag_imgs', { 'perl' => '/img/camel.png', 'python' => '/img/python.png', 'debug' => '/img/bug.png', 'pam' => '/img/pam.png', 'cassert' => '/img/cassert.png', 'openssl' => '/img/ssl_icon.gif', 'nls' => '/img/translateicon.gif', 'krb5' => '/img/krb.gif', 'tcl' => '/img/tcl.png', 'thread-safety' => '/img/threads.gif', 'integer-datetimes' => '/img/days.png'  });
19     
20     
21     $output .=  "\n<div id=\"main\">\n    <h1>PostgreSQL BuildFarm Status</h1>\n    <p>\n      Shown here is the latest status of each farm member \n      for each branch it has reported on in the last 30 days.\n    </p>\n    <p>\n       Use the farm member link for history of that member \n       on the relevant branch.\n    </p>\n<table><tr><th class=\"head\" rowspan=\"2\">Legend</th>\n";
22     #line 45 "/home/community/pgbuildfarm/templates/dashboard.tt"
23     
24     # FOREACH 
25     do {
26         my ($value, $error, $oldloop);
27         my $list = $stash->get('flag_imgs');
28         
29         unless (UNIVERSAL::isa($list, 'Template::Iterator')) {
30             $list = Template::Config->iterator($list)
31                 || die $Template::Config::ERROR, "\n"; 
32         }
33     
34         ($value, $error) = $list->get_first();
35         eval { $oldloop = $stash->get('loop') };
36         $stash->set('loop', $list);
37         eval {
38     LOOP:   while (! $error) {
39                 $stash->{'flagset'} = $value;
40     $output .=  "\n<td><img src=\"";
41     #line 43 "/home/community/pgbuildfarm/templates/dashboard.tt"
42     $output .=  $stash->get(['flagset', 0, 'value', 0]);
43     $output .=  "\" title=\"";
44     #line 43 "/home/community/pgbuildfarm/templates/dashboard.tt"
45     $output .=  $stash->get(['flagset', 0, 'key', 0]);
46     $output .=  "\" alt=\"";
47     #line 43 "/home/community/pgbuildfarm/templates/dashboard.tt"
48     $output .=  $stash->get(['flagset', 0, 'key', 0]);
49     $output .=  "\" height=\"16\" width=\"16\" class=\"inline\"  align=\"center\"/> =  ";
50     #line 43 "/home/community/pgbuildfarm/templates/dashboard.tt"
51     $output .=  $stash->get(['flagset', 0, 'key', 0]);
52     $output .=  "</td>\n";
53     #line 44 "/home/community/pgbuildfarm/templates/dashboard.tt"
54     if ($stash->get(['loop', 0, 'count', 0]) eq 5) {
55     $output .=  "</tr><tr>";
56     }
57     
58     $output .=  "\n";;
59                 ($value, $error) = $list->get_next();
60             }
61         };
62         $stash->set('loop', $oldloop);
63         die $@ if $@;
64         $error = 0 if $error && $error eq Template::Constants::STATUS_DONE;
65         die $error if $error;
66     };
67     
68     $output .=  "\n</tr></table>\n<br />\n    <table cellspacing=\"0\">\n";
69     #line 49 "/home/community/pgbuildfarm/templates/dashboard.tt"
70     $stash->set('brch', '');
71     $output .=  "\n";
72     #line 81 "/home/community/pgbuildfarm/templates/dashboard.tt"
73     
74     # FOREACH 
75     do {
76         my ($value, $error, $oldloop);
77         my $list = $stash->get('statrows');
78         
79         unless (UNIVERSAL::isa($list, 'Template::Iterator')) {
80             $list = Template::Config->iterator($list)
81                 || die $Template::Config::ERROR, "\n"; 
82         }
83     
84         ($value, $error) = $list->get_first();
85         eval { $oldloop = $stash->get('loop') };
86         $stash->set('loop', $list);
87         eval {
88     LOOP:   while (! $error) {
89                 $stash->{'row'} = $value;
90     $output .=  "\n";
91     #line 54 "/home/community/pgbuildfarm/templates/dashboard.tt"
92     if ($stash->get(['row', 0, 'branch', 0]) ne $stash->get('brch')) {
93     #line 51 "/home/community/pgbuildfarm/templates/dashboard.tt"
94     $stash->set('brch', $stash->get(['row', 0, 'branch', 0]));
95     $output .=  "\n<tr><th class=\"head\" colspan=\"4\">Branch: ";
96     #line 52 "/home/community/pgbuildfarm/templates/dashboard.tt"
97     $output .=  $stash->get('brch');
98     $output .=  "</th></tr>\n<tr><th>Alias</th><th>System</th><th>Status</th><th>Flags</th></tr>\n";
99     }
100     
101     $output .=  "\n<tr ";
102     #line 55 "/home/community/pgbuildfarm/templates/dashboard.tt"
103     $output .=  $context->process('cl', { 'bgfor' => $stash->get(['row', 0, 'stage', 0]) });
104     $output .=  ">\n    <td><a \n    href=\"show_history.pl?nm=";
105     #line 57 "/home/community/pgbuildfarm/templates/dashboard.tt"
106     $output .=  $stash->get(['row', 0, 'sysname', 0]);
107     $output .=  "&amp;br=";
108     #line 57 "/home/community/pgbuildfarm/templates/dashboard.tt"
109     $output .=  $stash->get(['row', 0, 'branch', 0]);
110     $output .=  "\"\n    title=\"History\"\n    >";
111     #line 59 "/home/community/pgbuildfarm/templates/dashboard.tt"
112     $output .=  $stash->get(['row', 0, 'sysname', 0]);
113     $output .=  "</a></td>\n    <td><span class=\"opsys\">";
114     #line 60 "/home/community/pgbuildfarm/templates/dashboard.tt"
115     $output .=  $stash->get(['row', 0, 'operating_system', 0]);
116     $output .=  "\n            ";
117     #line 61 "/home/community/pgbuildfarm/templates/dashboard.tt"
118     $output .=  $stash->get(['row', 0, 'os_version', 0]);
119     $output .=  "</span> <span class=\"compiler\">";
120     #line 63 "/home/community/pgbuildfarm/templates/dashboard.tt"
121     $output .=  $stash->get(['row', 0, 'compiler', 0]);
122     $output .=  "\n            ";
123     #line 64 "/home/community/pgbuildfarm/templates/dashboard.tt"
124     $output .=  $stash->get(['row', 0, 'compiler_version', 0]);
125     $output .=  "</span> <span class=\"arch\">";
126     #line 66 "/home/community/pgbuildfarm/templates/dashboard.tt"
127     $output .=  $stash->get(['row', 0, 'architecture', 0]);
128     $output .=  "</span></td>\n    <td class=\"status\">";
129     #line 69 "/home/community/pgbuildfarm/templates/dashboard.tt"
130     
131     # FILTER
132     $output .=  do {
133         my $output = '';
134         my $filter = $context->filter('replace', [ '\s', '&nbsp;' ])
135                   || $context->throw($context->error);
136     
137     $output .=  $stash->get(['row', 0, 'when_ago', 0]);
138         
139         &$filter($output);
140     };
141     
142     $output .=  "&nbsp;ago&nbsp;\n            ";
143     #line 70 "/home/community/pgbuildfarm/templates/dashboard.tt"
144     $output .=  $stash->get(['row', 0, 'stage', 0]);
145     $output .=  "            <a href=\"show_log.pl?nm=";
146     #line 73 "/home/community/pgbuildfarm/templates/dashboard.tt"
147     $output .=  $stash->get(['row', 0, 'sysname', 0]);
148     $output .=  "&amp;dt=";
149     #line 75 "/home/community/pgbuildfarm/templates/dashboard.tt"
150     
151     # FILTER
152     $output .=  do {
153         my $output = '';
154         my $filter = $context->filter('uri')
155                   || $context->throw($context->error);
156     
157     $output .=  $stash->get(['row', 0, 'snapshot', 0]);
158         
159         &$filter($output);
160     };
161     
162     $output .=  "\">";
163     #line 77 "/home/community/pgbuildfarm/templates/dashboard.tt"
164     if ($stash->get(['row', 0, 'stage', 0]) ne 'OK') {
165     $output .=  "Details";
166     }
167     else {
168     $output .=  "Config";
169     }
170     
171     $output .=  "</a></td>\n\n    <td class=\"flags\">";
172     #line 79 "/home/community/pgbuildfarm/templates/dashboard.tt"
173     
174     # FOREACH 
175     do {
176         my ($value, $error, $oldloop);
177         my $list = $stash->get(['row', 0, 'build_flags', 0, 'split', 0, 'sort', 0]);
178         
179         unless (UNIVERSAL::isa($list, 'Template::Iterator')) {
180             $list = Template::Config->iterator($list)
181                 || die $Template::Config::ERROR, "\n"; 
182         }
183     
184         ($value, $error) = $list->get_first();
185         eval { $oldloop = $stash->get('loop') };
186         $stash->set('loop', $list);
187         eval {
188     LOOP:   while (! $error) {
189                 $stash->{'flag'} = $value;
190     #line 79 "/home/community/pgbuildfarm/templates/dashboard.tt"
191     $output .=  $context->process('img');;
192                 ($value, $error) = $list->get_next();
193             }
194         };
195         $stash->set('loop', $oldloop);
196         die $@ if $@;
197         $error = 0 if $error && $error eq Template::Constants::STATUS_DONE;
198         die $error if $error;
199     };
200     
201     $output .=  "</td>\n</tr>\n";;
202                 ($value, $error) = $list->get_next();
203             }
204         };
205         $stash->set('loop', $oldloop);
206         die $@ if $@;
207         $error = 0 if $error && $error eq Template::Constants::STATUS_DONE;
208         die $error if $error;
209     };
210     
211     $output .=  "\n    </table>\n</div>\n\n";
212         } };
213         if ($@) {
214             $error = $context->catch($@, \$output);
215             die $error unless $error->type eq 'return';
216         }
217     
218         return $output;
219     },
220     DEFBLOCKS => {
221         'cl' => sub {
222             my $context = shift || die "template sub called without context\n";
223             my $stash   = $context->stash;
224             my $output  = '';
225             my $error;
226             
227             eval { BLOCK: {
228         $output .=  " class=\"";
229         #line 27 "/home/community/pgbuildfarm/templates/dashboard.tt"
230         
231         # SWITCH
232         do {
233             my $result = $stash->get('bgfor');
234             my $match;
235             SWITCH: {
236         $match = 'OK';
237         $match = [ $match ] unless ref $match eq 'ARRAY';
238         if (grep(/^$result$/, @$match)) {
239         $output .=  "pass";
240             last SWITCH;
241         }
242         $match = 'ContribCheck';
243         $match = [ $match ] unless ref $match eq 'ARRAY';
244         if (grep(/^$result$/, @$match)) {
245         $output .=  "warn";
246             last SWITCH;
247         }
248         $match = [ 'Check', 'InstallCheck' ];
249         $match = [ $match ] unless ref $match eq 'ARRAY';
250         if (grep(/^$result$/, @$match)) {
251         $output .=  "warnx";
252             last SWITCH;
253         }
254         $output .=  "fail";
255             }
256         };
257         
258         $output .=  "\"";
259             } };
260             if ($@) {
261                 $error = $context->catch($@, \$output);
262                 die $error unless $error->type eq 'return';
263             }
264         
265             return $output;
266         },
267         'img' => sub {
268             my $context = shift || die "template sub called without context\n";
269             my $stash   = $context->stash;
270             my $output  = '';
271             my $error;
272             
273             eval { BLOCK: {
274         #line 22 "/home/community/pgbuildfarm/templates/dashboard.tt"
275         if ($stash->get('flag') eq 'depend' || $stash->get('flag') eq 'gnu-ld') {
276         
277         }
278         elsif ($stash->get(['flag_imgs', 0, $stash->get('flag'), 0])) {
279         #line 22 "/home/community/pgbuildfarm/templates/dashboard.tt"
280         
281         # FILTER
282         $output .=  do {
283             my $output = '';
284             my $filter = $context->filter('collapse')
285                       || $context->throw($context->error);
286         
287         $output .=  "<img src=\"";
288         #line 19 "/home/community/pgbuildfarm/templates/dashboard.tt"
289         $output .=  $stash->get(['flag_imgs', 0, $stash->get('flag'), 0]);
290         $output .=  "\" \n                              title=\"";
291         #line 20 "/home/community/pgbuildfarm/templates/dashboard.tt"
292         $output .=  $stash->get('flag');
293         $output .=  "\" alt=\"";
294         #line 20 "/home/community/pgbuildfarm/templates/dashboard.tt"
295         $output .=  $stash->get('flag');
296         $output .=  "\" \n                              height=\"16\" width=\"16\" class=\"inline\" align=\"bottom\" />  \n     ";
297             
298             &$filter($output);
299         };
300         
301         }
302         
303             } };
304             if ($@) {
305                 $error = $context->catch($@, \$output);
306                 die $error unless $error->type eq 'return';
307             }
308         
309             return $output;
310         },
311     },
312 });