set default pagesize on all views to 999
[monitor.git] / web / MonitorWeb / monitorweb / templates / nodelist.kid
index 669f02f..2c1ae70 100644 (file)
@@ -1,60 +1,66 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python
-layout_params['page_title'] = "Monitor Node List"
+layout_params['page_title'] = "MyOps Node List"
 from monitor.util import diff_time
 from time import mktime
 from links import *
+
 ?>
 <html py:layout="'sitemenu.kid'"
       xmlns:py="http://purl.org/kid/ns#"
          xmlns:mochi="http://www.mochi.org">
 
-  <div py:match="item.tag == 'content'">
-       <table width="100%">
-               <thead>
-                       <tr>
-                               <th><a href="${link('node', filter='BOOT')}">Production(${fc['BOOT']})</a></th>
-                               <th><a href="${link('node', filter='DEBUG')}">Debug(${fc['DEBUG']})</a></th>
-                               <th><a href="${link('node', filter='DOWN')}">Down(${fc['DOWN']})</a></th>
-                               <th><a href="${link('node', filter='neverboot')}">Never Booted(${fc['neverboot']})</a></th>
-                               <th><a href="${link('node', filter='pending')}">Pending Reply(${fc['pending']})</a></th>
-                               <th><a href="${link('node', filter='all')}">All</a></th>
-                       </tr>
-               </thead>
-               <tbody>
-               <tr>
-               <td colspan="5">
-               <table id="sortable_table" class="datagrid" border="1" width="100%">
-                       <thead>
-                               <tr>
-                                       <th mochi:format="int"></th>
-                                       <th mochi:format="str">Site</th>
-                                       <th>Hostname</th>
-                                       <th>ping</th>
-                                       <!--th>ssh</th-->
-                                       <th>pcu</th>
-                                       <th>status</th>
-                                       <th>kernel</th>
-                                       <th>last_contact</th>
-                               </tr>
-                       </thead>
-                       <tbody>
-                               <tr py:for="i,node in enumerate(query)" class="${i%2 and 'odd' or 'even'}" >
-                                       <td></td>
-                                       <td><a href="${link('siteview', loginbase=node.loginbase)}">${node.loginbase}</a></td>
-                                       <td nowrap="true"><a target="_top" href="${link('nodeview', hostname=node.hostname)}" py:content="node.hostname"></a></td>
-                                       <td py:content="node.ping_status"></td>
-                                       <td id="status-${node.pcu_short_status}" py:content="node.pcu_short_status"></td>
-                                       <td py:content="node.observed_status"></td>
-                                       <td nowrap="true" py:content="node.kernel"></td>
-                                       <td py:content="diff_time(node.plc_node_stats['last_contact'])"></td>
-                               </tr>
-                       </tbody>
-               </table>
-               </td>
-               </tr>
-               </tbody>
-       </table>
-  </div>
+<div py:match="item.tag == 'content'">
+
+  <script type="text/javascript">
+    function nodelist_paginator(opts) { plekit_table_paginator(opts, "nodelist"); }
+  </script>
+
+  <center>
+  <!-- NOTE: agg.node is a FindbadNodeRecord not a HistoryNodeRecord, so there is not 'status' attribute -->
+  <!--b py:content="'UP: %d' % len([agg for agg in query if agg.node.status in ('online', 'good')])"></b> | 
+  <b py:content="'DOWN: %d' % len([agg for agg in query if agg.node.status not in ('online', 'good')])"></b><br/-->
+  </center>
+
+<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">
+  <thead>
+
+    <tr class='pagesize_area'><td class='pagesize_area' colspan='10'>
+        <form class='pagesize' action='satisfy_xhtml_validator'><fieldset>
+            <input class='pagesize_input' type='text' id="nodelist_pagesize" value='25'
+                   onkeyup='plekit_pagesize_set("nodelist","nodelist_pagesize", 25);' 
+                   size='3' maxlength='3' />                                                          
+            <label class='pagesize_label'> items/page </label>                                     
+            <img class='reset' src="/planetlab/icons/clear.png" alt="reset visible size"           
+                 onmousedown='plekit_pagesize_reset("nodelist","nodelist_pagesize", 999);' />
+    </fieldset></form></td></tr>                                                                        
+    
+    <tr class='search_area'><td class='search_area' colspan='10'>
+        <div class='search'><fieldset>
+            <label class='search_label'> Refine List</label>                 
+            <input class='search_input' type='text' id='nodelist_search' 
+                   onkeyup='plekit_table_filter("nodelist","nodelist_search","nodelist_search_and");'
+                   size='self.search_width' maxlength='256' />                                            
+            <label>and</label>                                                                        
+            <input id='nodelist_search_and' class='search_and'                                        
+                   type='checkbox' checked='checked'                                                      
+                   onchange='plekit_table_filter("nodelist","nodelist_search","nodelist_search_and");' />
+            <img class='reset' src="/planetlab/icons/clear.png" alt="reset search"
+                 onmousedown='plekit_table_filter_reset("nodelist","nodelist_search","nodelist_search_and");' />
+    </fieldset></div></td></tr>
+    
+    <tr>
+      ${nodewidget.display(node=None, header=True)}
+  </tr>
+  </thead>
+  <tbody>
+    <tr py:for="i,node in enumerate(query)">
+      ${nodewidget.display(node=node, header=None)}
+    </tr>
+
+  </tbody>  
+</table>
+
+</div>
 
 </html>