1ca6e36c299e9752f3a7cc1a8788efada5403014
[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.MONITOR_HOSTNAME + "/db/sites/index.php?id=" + str(pcu['site_id'])
9
10 def pcu_link(pcu):
11         return "https://" + config.MONITOR_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
17   <div py:match="item.tag == 'content'">
18         <table id="sub-table" width="100%">
19                 <thead>
20                         <tr>
21                                 <th><a href="${tg.url('pcu', filter='ok')}">Ok(${fc['ok']})</a></th>
22                                 <th><a href="${tg.url('pcu', filter='Not_Run')}">Misconfigured(${fc['Not_Run']})</a></th>
23                                 <th><a href="${tg.url('pcu', filter='NetDown')}">Offline(${fc['NetDown']})</a></th>
24                                 <th><a href="${tg.url('pcu', filter='pending')}">Runtime Error(${fc['pending']})</a></th>
25                                 <th><a href="${tg.url('pcu', filter='all')}">All</a></th>
26                         </tr>
27                 </thead>
28                 <tbody>
29                 <tr>
30                 <td colspan="5">
31                 <table border="1" width="100%">
32                         <thead>
33                                 <tr>
34                                         <th>Site</th>
35                                         <th>PCU Name</th>
36                                         <th>Missing Fields</th>
37                                         <th>DNS Status</th>
38                                         <th>Port Status</th>
39                                         <th width="80%">Test Results</th>
40                                         <th>Model</th>
41                                         <th>Nodes</th>
42                                 </tr>
43                         </thead>
44                         <tbody>
45                                 <tr py:for="i,node in enumerate(query)" class="${i%2 and 'odd' or 'even'}" >
46                                         <td><a href="${plc_site_link(node.plc_pcu_stats)}">sitename</a></td>
47                                         <td nowrap="true" >
48                                                 <a href="${pcu_link(node.plc_pcu_stats)}">${pcu_name(node.plc_pcu_stats)}</a></td>
49                                         <td py:content="node.entry_complete"></td>
50                                         <td id="dns-${node.dns_status}" py:content="node.dns_status"></td>
51                                         <td>
52                                                 <span py:for="port,state in node.ports" 
53                                                 id="port${state}" py:content="'%s, ' % port">80</span>
54                                         </td>
55                                         <td width="40" id="status-${node.status}" py:content="node.reboot_trial_status"></td>
56                                         <td py:content="node.plc_pcu_stats['model']"></td>
57                                         <td py:content="len(node.plc_pcu_stats['node_ids'])"></td>
58                                 </tr>
59                         </tbody>
60                 </table>
61                 </td>
62                 </tr>
63                 </tbody>
64         </table>
65   </div>
66
67 </html>