remove stripes as plekit table provides the same functionality.
[monitor.git] / web / MonitorWeb / monitorweb / templates / siteview.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 View"
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     <h3>Site Status</h3>
14                 <table id="sub-table" border="1" width="100%">
15                         <thead>
16                                 <tr>
17                                         <th>Site name</th>
18                                         <th>Enabled</th>
19                                         <th>Penalty</th>
20                                         <th>Slices/Max</th>
21                                         <th>Nodes/Total</th>
22                                         <th>Status</th>
23                                 </tr>
24                         </thead>
25                         <tbody>
26                                 <tr py:for="i,site in enumerate(sitequery)">
27                                         <td nowrap="true"><a class="ext-link" href="${plc_site_uri(site.loginbase)}">
28                                                         <span class="icon">${site.loginbase}</span></a>
29                                         </td>
30                                         <td py:content="site.enabled"></td>
31                                         <td>n/a</td>
32                                         <td>${site.slices_used}/${site.slices_total}</td>
33                                         <td>${site.nodes_up} / ${site.nodes_total}</td>
34                                         <td id="site-${site.status}" py:content="diff_time(mktime(site.last_changed.timetuple()))"></td>
35                                 </tr>
36                         </tbody>
37                 </table>
38     <h3>Node List</h3>
39                 <p py:if="len(nodequery) == 0">
40                         There are no registered nodes for this PCU.
41                 </p>
42                 <table py:if="len(nodequery) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
43                         <thead>
44                                 <tr>
45                                         <th mochi:format="int"></th>
46                                         <th>Hostname</th>
47                                         <th>ping</th>
48                                         <!--th>ssh</th-->
49                                         <th>pcu</th>
50                                         <th>kernel</th>
51                                         <th>last_contact</th>
52                                 </tr>
53                         </thead>
54                         <tbody>
55                                 <tr py:for="i,node in enumerate(nodequery)">
56                                         <td></td>
57                                         <td id="node-${node.observed_status}" nowrap="true">
58                                                 <a href="${link('pcuview', hostname=node.hostname)}" py:content="node.hostname">your.host.org</a></td>
59                                         <td py:content="node.ping_status"></td>
60                                         <td py:if="node.pcu_short_status != 'none'" id="status-${node.pcu_short_status}">
61                                                 <a href="${link('pcuview', pcuid=node.plc_node_stats['pcu_ids'])}">${node.pcu_short_status}</a></td>
62                                         <td py:if="node.pcu_short_status == 'none'" id="status-${node.pcu_short_status}">
63                                                 ${node.pcu_short_status}</td>
64                                         <td nowrap="true" py:content="node.kernel"></td>
65                                         <td py:content="diff_time(node.plc_node_stats['last_contact'])"></td>
66                                 </tr>
67                         </tbody>
68                 </table>
69   </div>
70
71 </html>