add plc_nodeid and plc_siteid to history records so that the web templates can
[monitor.git] / web / MonitorWeb / monitorweb / templates / nodeview.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 Node View"
4 from monitor.util import diff_time
5 from time import mktime
6 from pcucontrol.reboot import pcu_name, model_to_object
7 from links import *
8 ?>
9 <html   py:layout="'sitemenu.kid'"
10         xmlns:py="http://purl.org/kid/ns#"
11         xmlns:mochi="http://www.mochi.org">
12
13   <div py:match="item.tag == 'content'">
14     <h3>Node Status</h3>
15                 <table id="sortable_table" class="datagrid" border="1" width="100%">
16                         <thead>
17                                 <tr>
18                                         <th mochi:format="int"></th>
19                                         <th mochi:format="str">Site</th>
20                                         <th>Hostname</th>
21                                         <th>ping</th>
22                                         <!--th>ssh</th-->
23                                         <th>kernel</th>
24                                         <th>last_change</th>
25                                         <th>last_contact</th>
26                                 </tr>
27                         </thead>
28                         <tbody>
29                                 <tr py:for="i,node in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
30                                         <td></td>
31                                         <td><a class="ext-link" href="${plc_site_uri_id(node.plc_node_stats['site_id'])}">
32                                                         <span class="icon">${node.loginbase}</span></a>
33                                         </td>
34                                         <td id="node-${node.observed_status}" nowrap="true" >
35                                                 <a class="ext-link" href="${plc_node_uri_id(node.plc_nodeid)}">
36                                                         <span class="icon">${node.hostname}</span></a>
37                                         </td>
38                                         <td py:content="node.ping_status"></td>
39                                         <td nowrap="true" py:content="node.kernel"></td>
40                                         <td py:content="diff_time(mktime(node.history.last_changed.timetuple()))"></td>
41                                         <td py:content="diff_time(node.plc_node_stats['last_contact'])"></td>
42                                 </tr>
43                         </tbody>
44                 </table>
45     <h3 py:if="node.pcu is not None">Controlling PCU</h3>
46                 <table py:if="node.pcu is not None" id="sortable_table" class="datagrid" border="1" width="100%">
47                         <thead>
48                                 <tr>
49                                         <th mochi:format="int"></th>
50                                         <th>PCU Name</th>
51                                         <th>Model</th>
52                                         <th width="80%">Test Results</th>
53                                 </tr>
54                         </thead>
55                         <tbody>
56                                 <?python pcu = node.pcu ?>
57                                 <tr>
58                                         <td></td>
59                                         <td nowrap="true" >
60                                                 <a class="ext-link" href="${plc_pcu_uri_id(pcu.plc_pcu_stats['pcu_id'])}">
61                                                         <span class="icon">${pcu_name(pcu.plc_pcu_stats)}</span>
62                                                 </a>
63                                         </td>
64                                         <td py:content="pcu.plc_pcu_stats['model']"></td>
65                                         <td width="20%" nowrap='true' align='center' id="status-${node.pcu_short_status}">
66                                                 <div id="links">
67                                                         <a class="info" py:if="'error' in node.pcu_short_status" 
68                                                                 href="${link('pcuview', pcuid=node.plc_pcuid)}">
69                                                                 Error<span><pre>${node.pcu.reboot_trial_status}</pre></span></a>
70                                                         <a py:if="'error' not in node.pcu_short_status and 'none' not in node.pcu_short_status" 
71                                                                 href="${link('pcuview', pcuid=node.plc_pcuid)}"
72                                                                 py:content="node.pcu_short_status">Reboot Status</a>
73                                                         <span py:if="'none' in node.pcu_short_status" 
74                                                                 py:content="node.pcu_short_status">Reboot Status</span>
75                                                 </div>
76                                         </td>
77                                 </tr>
78                         </tbody>
79                 </table>
80     <h3>Actions Taken</h3>
81   </div>
82
83 </html>