add a view for pcu history.
[monitor.git] / web / MonitorWeb / monitorweb / templates / sitelist.kid
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <?python
3 layout_params['page_title'] = "Monitor Site List"
4 from monitor.util import diff_time
5 from time import mktime
6 from links import *
7 ?>
8 <html py:layout="'sitemenu.kid'"
9       xmlns:py="http://purl.org/kid/ns#"
10           xmlns:mochi="http://www.mochi.org">
11
12   <div py:match="item.tag == 'content'">
13
14
15   <script type="text/javascript">
16     function sitelist_paginator(opts) { plekit_table_paginator(opts, "sitelist"); }
17   </script>
18
19 <table id="sitelist" cellpadding="0" border="0" class="plekit_table sortable-onload-0 colstyle-alt no-arrow paginationcallback-sitelist_paginator max-pages-10 paginate-25">
20   <thead>
21
22     <tr class='pagesize_area'><td class='pagesize_area' colspan='6'>
23         <form class='pagesize' action='satisfy_xhtml_validator'><fieldset>
24             <input class='pagesize_input' type='text' id="sitelist_pagesize" value='25'
25                    onkeyup='plekit_pagesize_set("sitelist","sitelist_pagesize", 25);' 
26                    size='3' maxlength='3' />                                                          
27             <label class='pagesize_label'> items/page </label>                                     
28             <img class='reset' src="/planetlab/icons/clear.png" alt="reset visible size"           
29                  onmousedown='plekit_pagesize_reset("sitelist","sitelist_pagesize", 999);' />
30     </fieldset></form></td></tr>                                                                        
31     
32     <tr class='search_area'><td class='search_area' colspan='6'>
33         <div class='search'><fieldset>
34             <label class='search_label'> Search </label>                 
35             <input class='search_input' type='text' id='sitelist_search' 
36                    onkeyup='plekit_table_filter("sitelist","sitelist_search","sitelist_search_and");'
37                    size='self.search_width' maxlength='256' />                                            
38             <label>and</label>                                                                        
39             <input id='sitelist_search_and' class='search_and'                                        
40                    type='checkbox' checked='checked'                                                      
41                    onchange='plekit_table_filter("sitelist","sitelist_search","sitelist_search_and");' />
42             <img class='reset' src="/planetlab/icons/clear.png" alt="reset search"
43                  onmousedown='plekit_table_filter_reset("sitelist","sitelist_search","sitelist_search_and");' />
44     </fieldset></div></td></tr>
45     
46     <tr>
47       <th class="sortable plekit_table">Site Name</th>        
48       <th class="sortable plekit_table">Enabled</th>         
49       <th class="sortable plekit_table">Penalty</th>    
50       <th class="sortable plekit_table">Slices/Max</th>      
51       <th class="sortable plekit_table">Nodes/Total</th>
52       <th class="sortable plekit_table">Last Change</th>
53     </tr>
54   </thead>
55   <tbody>
56     <tr py:for="i,site in enumerate(query)">
57       <td nowrap="true">
58         <div class='oneline'>
59           <a class='left' href="${link('pcuview', loginbase=site.loginbase)}">${site.loginbase}</a>
60           <a class='right' href="${plc_site_uri_id(site.plc_siteid)}">
61             <img style='display: inline' border='0' src="static/images/extlink.gif" align='right'/></a>
62         </div>
63       </td>
64       <td py:content="site.enabled"></td>
65       <td id="site-${site.penalty_level}">${site.penalty_level}</td>
66       <td>${site.slices_used}/${site.slices_total}</td>
67       <td>${site.nodes_up} / ${site.nodes_total}</td>
68       <td id="site-${site.status}" py:content="diff_time(mktime(site.last_changed.timetuple()))"></td>
69     </tr>
70   </tbody>  
71 </table>
72
73   </div>
74
75 </html>