templatize show_log
[buildfarm-server.git] / templates / dashboard.tt
1 [%
2  flag_imgs = {
3      perl = '/img/camel.png',
4      python = '/img/python.png',
5      debug = '/img/bug.png',
6      pam => '/img/pam.png',
7      cassert => '/img/cassert.png',
8      openssl => '/img/ssl_icon.gif',
9      nls => '/img/translateicon.gif',
10      krb5 => '/img/krb.gif',
11      tcl => '/img/tcl.png',
12      'thread-safety' => '/img/threads.gif',
13      'integer-datetimes' = '/img/days.png',
14      }
15 -%]
16 [%-  BLOCK img ; 
17         IF flag == 'depend' or flag == 'gnu-ld' ; ; 
18         ELSIF flag_imgs.$flag ; 
19            FILTER collapse %]<img src="[% flag_imgs.$flag %]" 
20                                 title="[% flag %]" alt="[% flag %]" 
21                                 height="16" width="16" class="inline" align="bottom" />  
22         [%  END ;
23         END; 
24      END 
25 -%]
26 [%- BLOCK cl %] class="[% SWITCH bgfor -%]
27   [%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
28 [%- END -%]
29
30 <div id="main">
31     <h1>PostgreSQL BuildFarm Status</h1>
32     <p>
33       Shown here is the latest status of each farm member 
34       for each branch it has reported on in the last 30 days.
35     </p>
36     <p>
37        Use the farm member link for history of that member 
38        on the relevant branch.
39     </p>
40 <table><tr><th class="head" rowspan="2">Legend</th>
41 [% FOREACH flagset IN flag_imgs %]
42 <td><img src="[% flagset.value %]" title="[% flagset.key %]" alt="[% flagset.key %]" height="16" width="16" class="inline"  align="center"/> =  [% flagset.key %]</td>
43 [% IF loop.count == 5 %]</tr><tr>[% END %]
44 [% END %]
45 </tr></table>
46 <br />
47     <table cellspacing="0">
48 [% brch = "" %]
49 [% FOREACH row IN statrows %]
50 [% IF row.branch != brch ; brch = row.branch %]
51 <tr><th class="head" colspan="4">Branch: [% brch %]</th></tr>
52 <tr><th>Alias</th><th>System</th><th>Status</th><th>Flags</th></tr>
53 [% END %]
54 <tr [% PROCESS cl bgfor=row.stage %]>
55     <td><a 
56     href="show_history.pl?nm=[% row.sysname %]&amp;br=[% row.branch %]"
57     title="History"
58     >[% row.sysname %]</a></td>
59     <td><span class="opsys">[% row.operating_system %]
60             [% row.os_version %]</span> <span class="compiler">
61             [%- row.compiler %]
62             [% row.compiler_version %]</span> <span class="arch">
63             [%- row.architecture %]</span></td>
64     <td class="status">
65             [%- row.when_ago | replace('\s','&nbsp;') %]&nbsp;ago&nbsp;
66             [% row.stage -%]
67             <a href="show_log.pl?nm=
68                [%- row.sysname %]&amp;dt=
69                [%- row.snapshot | uri %]">
70                 [%- IF row.stage != 'OK' %]Details[% ELSE %]Config[% END -%]</a></td>
71
72     <td class="flags">[% FOREACH flag IN row.build_flags.split().sort() ; PROCESS img ; END %]</td>
73 </tr>
74 [% END %]
75     </table>
76 </div>
77