add sorting tables to the pcu view.
[monitor.git] / web / MonitorWeb / monitorweb / templates / pculist.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 PCU View"
4 from pcucontrol.reboot import pcu_name, model_to_object
5 from monitor import config
6
7 def plc_site_link(pcu):
8         return "https://" + config.PLC_WEB_HOSTNAME + "/db/sites/index.php?id=" + str(pcu['site_id'])
9
10 def pcu_link(pcu):
11         return "https://" + config.PLC_WEB_HOSTNAME + "/db/sites/pcu.php?id=" + str(pcu['pcu_id'])
12
13 ?>
14 <html py:layout="'sitemenu.kid'"
15       xmlns:py="http://purl.org/kid/ns#"
16           xmlns:mochi="http://www.mochi.org">
17
18   <div py:match="item.tag == 'content'">
19         <table id="sub-table" width="100%">
20                 <thead>
21                         <tr>
22                                 <th><a href="${tg.url('pcu', filter='ok')}">Ok(${fc['ok']})</a></th>
23                                 <th><a href="${tg.url('pcu', filter='Not_Run')}">Misconfigured(${fc['Not_Run']})</a></th>
24                                 <th><a href="${tg.url('pcu', filter='NetDown')}">Offline(${fc['NetDown']})</a></th>
25                                 <th><a href="${tg.url('pcu', filter='pending')}">Runtime Error(${fc['pending']})</a></th>
26                                 <th><a href="${tg.url('pcu', filter='all')}">All</a></th>
27                         </tr>
28                 </thead>
29                 <tbody>
30                 <tr>
31                 <td colspan="5">
32                 <table id="sortable_table" class="datagrid" border="1" width="100%">
33                         <thead>
34                                 <tr>
35                                         <th mochi:format="int"></th>
36                                         <th mochi:format="str">Site</th>
37                                         <th>PCU Name</th>
38                                         <th>Missing Fields</th>
39                                         <th>DNS Status</th>
40                                         <th>Port Status</th>
41                                         <th width="80%">Test Results</th>
42                                         <th>Model</th>
43                                         <th>Nodes</th>
44                                 </tr>
45                         </thead>
46                         <tbody>
47                                 <tr py:for="i,node in enumerate(query)" class="${i%2 and 'odd' or 'even'}" >
48                                         <td></td>
49                                         <td><a href="${plc_site_link(node.plc_pcu_stats)}">${node.loginbase}</a></td>
50                                         <td nowrap="true" >
51                                                 <a href="${pcu_link(node.plc_pcu_stats)}">${pcu_name(node.plc_pcu_stats)}</a></td>
52                                         <td py:content="node.entry_complete"></td>
53                                         <td id="dns-${node.dns_status}" py:content="node.dns_status"></td>
54                                         <td>
55                                                 <span py:for="port,state in node.ports" 
56                                                 id="port${state}" py:content="'%s, ' % port">80</span>
57                                         </td>
58                                         <td width="40" id="status-${node.status}" py:content="node.reboot_trial_status"></td>
59                                         <td py:content="node.plc_pcu_stats['model']"></td>
60                                         <td py:content="len(node.plc_pcu_stats['node_ids'])"></td>
61                                 </tr>
62                         </tbody>
63                 </table>
64                 </td>
65                 </tr>
66                 </tbody>
67         </table>
68   </div>
69
70 </html>