tweaked the header of the node page to display the 'UP' and 'DOWN'
[monitor.git] / web / MonitorWeb / monitorweb / templates / nodefast.kid
index 97072d2..2052b85 100644 (file)
@@ -5,6 +5,15 @@ from monitor.util import diff_time
 from time import mktime
 from links import *
 
+def up_label (query):
+   up=len([agg for agg in query if agg.node.status in ('online', 'good')])
+   total=len(query)
+   return "%d (%d %%)" %(up,100*up/total)
+def down_label (query):
+   down=len([agg for agg in query if agg.node.status not in ('online', 'good')])
+   total=len(query)
+   return "%d (%d %%)" %(down,100*down/total)
+
 ?>
 <html py:layout="'sitemenu.kid'"
       xmlns:py="http://purl.org/kid/ns#"
@@ -17,16 +26,16 @@ from links import *
   </script>
 
   <center>
-  <b py:content="'BOOT: %d' % len([agg for agg in query if agg.node.status == 'good'])"></b> | 
-  <b py:content="'DOWN: %d' % len([agg for agg in query if agg.node.status == 'down'])"></b><br/>
+  <b py:content="'UP: %s' % up_label(query) "></b> | 
+  <b py:content="'DOWN: %s' % down_label(query) "></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-25">
+<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'
+            <input class='pagesize_input' type='text' id="nodelist_pagesize" value='999'
                    onkeyup='plekit_pagesize_set("nodelist","nodelist_pagesize", 25);' 
                    size='3' maxlength='3' />                                                          
             <label class='pagesize_label'> items/page </label>