Author: justi9
Date: 2008-04-17 14:37:02 -0400 (Thu, 17 Apr 2008)
New Revision: 1935
Modified:
mgmt/cumin/python/cumin/stat.py
mgmt/cumin/python/cumin/stat.strings
Log:
Prettify stat tables
Modified: mgmt/cumin/python/cumin/stat.py
===================================================================
--- mgmt/cumin/python/cumin/stat.py 2008-04-17 18:36:35 UTC (rev 1934)
+++ mgmt/cumin/python/cumin/stat.py 2008-04-17 18:37:02 UTC (rev 1935)
@@ -55,7 +55,7 @@
return stat.value_html(object)
- def render_item_extra(self, session, args):
+ def render_item_rate(self, session, args):
stat, object = args
#if False and stat.highlow: #XXX
Modified: mgmt/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/cumin/python/cumin/stat.strings 2008-04-17 18:36:35 UTC (rev 1934)
+++ mgmt/cumin/python/cumin/stat.strings 2008-04-17 18:37:02 UTC (rev 1935)
@@ -43,46 +43,56 @@
[StatSet.css]
table.StatSet {
- width: 25em;
+ width: 100%;
border-collapse: collapse;
margin: 0.5em 0.5em 1em 0.5em;
}
table.StatSet tr {
border-top: 1px dotted #ccc;
- vertical-align: top;
}
-table.StatSet td {
+table.StatSet td, table.StatSet th {
padding: 0.35em 0.5em;
+ font-weight: normal;
}
table.StatSet th {
- padding: 0.35em 0.5em;
- text-align: left;
- font-weight: normal;
- background-color: #f7f7f7;
+ color: #444;
}
+table.StatSet thead th {
+ font-style: italic;
+ font-size: 0.9em;
+ text-align: right;
+}
+
+table.StatSet td {
+ text-align: right;
+}
+
[StatSet.html]
<table id="{id}" class="StatSet">
- <tr>
- <th style="width: 45%;">Statistic</th>
- <th style="width: 20%;" class="ralign">Current</th>
- <th style="width: 35%;" class="ralign">Rate</th>
- </tr>
-
- {items}
+ <thead>
+ <tr>
+ <th style="width: 50%; text-align: left;">Statistic</th>
+ <th style="width: 25%;">Value</th>
+ <th style="width: 25%;">Per Second</th>
+ </tr>
+ </thead>
+ <tbody>
+ {items}
+ </tbody>
</table>
<script>
cumin.objectListeners["{id}"] = updateStats;
</script>
[StatSet.item_html]
-<tr stat="{item_name}">
+<tr stat="{item_name}" class="item">
<th>{item_title}</th>
<td class="ralign"> {item_value}</td>
- <td class="ralign"> {item_extra}</td>
+ <td class="ralign"> {item_rate}</td>
</tr>
[StatValueChart.javascript]