55bcd30a4e9e3842c4abf6313af7e08f8cd4c19c
[monitor.git] / web / MonitorWeb / monitorweb / templates / query.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'] = "MyOps Detail View"
4 from monitor.util import diff_time
5 from monitor import config
6 from time import mktime
7 from pcucontrol.reboot import pcu_name, model_to_object
8 from links import *
9 ?>
10 <html py:layout="'sitemenu.kid'"
11       xmlns:py="http://purl.org/kid/ns#"
12           xmlns:mochi="http://www.mochi.org">
13
14   <div py:match="item.tag == 'content'">
15                 <h2>Functional, but Under Development...</h2>
16                 <table>
17                         <tr>
18                                 <td>${queryform.display(method="GET", value=data)}</td>
19                         </tr>
20                 </table>
21 <h4>Results</h4>
22         <table py:if="fields and len(fields.keys()) > 0" id="querylist" cellpadding="0" border="0" class="plekit_table sortable-onload-0 colstyle-alt no-arrow paginationcallback-querylist_paginator max-pages-10 paginate-50" width="100%">
23         <thead>
24         <tr class='pagesize_area'><td class='pagesize_area' colspan='5'>
25          <form class='pagesize' action='satisfy_xhtml_validator'><fieldset>
26             <input class='pagesize_input' type='text' id="querylist_pagesize" value='50'
27                    onkeyup='plekit_pagesize_set("querylist","querylist_pagesize", 50);' 
28                    size='3' maxlength='3' />                                                          
29             <label class='pagesize_label'> items/page </label>                                     
30             <img class='reset' src="/planetlab/icons/clear.png" alt="reset visible size"           
31                  onmousedown='plekit_pagesize_reset("querylist","querylist_pagesize", 999);' />
32         </fieldset></form></td></tr>                                                                        
33         <tr class='search_area'><td class='search_area' colspan='5'>
34         <div class='search'><fieldset>
35             <label class='search_label'> Search </label>                 
36             <input class='search_input' type='text' id='querylist_search' 
37                    onkeyup='plekit_table_filter("querylist","querylist_search","querylist_search_and");'
38                    size='self.search_width' maxlength='256' />                                            
39             <label>and</label>                                                                        
40             <input id='querylist_search_and' class='search_and'                                        
41                    type='checkbox' checked='checked'                                                      
42                    onchange='plekit_table_filter("querylist","querylist_search","querylist_search_and");' />
43             <img class='reset' src="/planetlab/icons/clear.png" alt="reset search"
44                  onmousedown='plekit_table_filter_reset("querylist","querylist_search","querylist_search_and");' />
45         </fieldset></div></td></tr>
46                 <!-- for keys show each th -->
47                 <tr>
48                         <span py:for="key in sorted(fields.keys())" >
49                                 <span py:if="key == 'uptime'">
50                                         <th class="sortable-numeric plekit_table">${key}</th>
51                                 </span>
52                                 <span py:if="key != 'uptime'">
53                                         <th class="sortable plekit_table">${key}</th>
54                                 </span>
55                         </span>
56                 </tr>
57         </thead>
58         <tbody>
59                 <!-- for keys show value -->
60                 <tr py:for="row in query"  >
61                         <span py:for="key in sorted(fields.keys())" >
62                                 <td>${row[key]}</td>
63                         </span>
64                 </tr>
65       </tbody>
66         </table>
67   </div>
68 </html>