1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 layout_params['page_title'] = "MyOps Node List"
4 from monitor.util import diff_time
5 from time import mktime
9 up=len([agg for agg in query if agg.node.status in ('online', 'good')])
11 return "%d (%d %%)" %(up,100*up/total)
12 def down_label (query):
13 down=len([agg for agg in query if agg.node.status not in ('online', 'good')])
15 return "%d (%d %%)" %(down,100*down/total)
18 <html py:layout="'sitemenu.kid'"
19 xmlns:py="http://purl.org/kid/ns#"
20 xmlns:mochi="http://www.mochi.org">
22 <div py:match="item.tag == 'content'">
24 <script type="text/javascript">
25 function nodelist_paginator(opts) { plekit_table_paginator(opts, "nodelist"); }
29 <b py:content="'UP: %s' % up_label(query) "></b> |
30 <b py:content="'DOWN: %s' % down_label(query) "></b><br/>
33 <table id="nodelist" cellpadding="0" border="0" class="plekit_table sortable-onload-2 colstyle-alt no-arrow paginationcallback-nodelist_paginator max-pages-10 paginate-999">
36 <tr class='pagesize_area'><td class='pagesize_area' colspan='10'>
37 <form class='pagesize' action='satisfy_xhtml_validator'><fieldset>
38 <input class='pagesize_input' type='text' id="nodelist_pagesize" value='999'
39 onkeyup='plekit_pagesize_set("nodelist","nodelist_pagesize", 25);'
40 size='3' maxlength='3' />
41 <label class='pagesize_label'> items/page </label>
42 <img class='reset' src="/planetlab/icons/clear.png" alt="reset visible size"
43 onmousedown='plekit_pagesize_reset("nodelist","nodelist_pagesize", 999);' />
44 </fieldset></form></td></tr>
46 <tr class='search_area'><td class='search_area' colspan='10'>
47 <div class='search'><fieldset>
48 <label class='search_label'> Refine List </label>
49 <input class='search_input' type='text' id='nodelist_search'
50 onkeyup='plekit_table_filter("nodelist","nodelist_search","nodelist_search_and");'
51 size='self.search_width' maxlength='256' />
53 <input id='nodelist_search_and' class='search_and'
54 type='checkbox' checked='checked'
55 onchange='plekit_table_filter("nodelist","nodelist_search","nodelist_search_and");' />
56 <img class='reset' src="/planetlab/icons/clear.png" alt="reset search"
57 onmousedown='plekit_table_filter_reset("nodelist","nodelist_search","nodelist_search_and");' />
58 </fieldset></div></td></tr>
61 <th class="sortable plekit_table">ID</th>
62 <th class="sortable plekit_table">Site</th>
63 <th class="sortable plekit_table">Hostname</th>
64 <th class="sortable plekit_table">Status</th>
65 <th class="sortable-sortLastContact plekit_table">Last Changed</th>
66 <th class="sortable plekit_table">Firewall</th>
70 <tr py:for="i,agg in enumerate(query)">
71 <td py:content="agg.node.plc_nodeid">node_id</td>
72 <td> <a href="${link('simpleview', loginbase=agg.loginbase)}">${agg.loginbase}</a> </td>
73 <td nowrap="true"> <a target="_top" href="${link('simpleview', hostname=agg.node.hostname)}" py:content="agg.node.hostname">your.host.org</a></td>
74 <td py:content="agg.node.status">boot</td>
75 <td id="node-${agg.node.status}" py:content="diff_time(mktime(agg.node.last_changed.timetuple()))"></td>
76 <td nowrap="true" py:content="agg.node.firewall"></td>