Author: eallen
Date: 2008-12-02 15:44:34 -0500 (Tue, 02 Dec 2008)
New Revision: 2907
Modified:
mgmt/trunk/cumin/python/cumin/pool.py
mgmt/trunk/cumin/python/cumin/pool.strings
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Switch from radio buttons to a button/link for Slot visualization.
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2008-12-02 19:06:47 UTC (rev 2906)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2008-12-02 20:44:34 UTC (rev 2907)
@@ -307,7 +307,7 @@
self.machine_param = Parameter(app, "machine_param")
self.add_parameter(self.machine_param)
- self.show_all_slots = self.SlotSwitch(app, "show_all_slots")
+ self.show_all_slots = self.ShowAllSlots(app, "show_all_slots")
self.add_child(self.show_all_slots)
def process(self, session):
@@ -430,19 +430,27 @@
action = self.app.model.pool.machines
return action.get_field_tuples(session)
- class SlotSwitch(StateSwitch):
+ class ShowAllSlots(StateSwitch):
def __init__(self, app, name):
- super(PoolStats.SlotSwitch, self).__init__(app, name)
+ super(PoolStats.ShowAllSlots, self).__init__(app, name)
- self.add_state("a", "All Slots in Pool", hover="Show
all slots in this pool")
- self.add_state("m", "Slots for This Machine",
hover="Show slots in this machine only")
+ self.add_state("a", "All")
+ self.add_state("m", "Machine")
self.param.default = "m"
- def render(self, session):
- if self.parent.slot_grid.get_machine(session):
- if self.parent.all_fits.get(session):
- return super(PoolStats.SlotSwitch, self).render(session)
-
+ def render_href(self, session):
+ state = self.get(session)
+ if state == "m":
+ branch = session.branch()
+ self.set(branch, "a")
+ return branch.marshal()
+ else:
+ return "#"
+
+ def render_class(self, session):
+ state = self.get(session)
+ return state == "a" and "disabled" or
"enabled"
+
class PoolStatSet(StatSet):
def render_rate_text(self, session, args):
return "Percentage"
Modified: mgmt/trunk/cumin/python/cumin/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.strings 2008-12-02 19:06:47 UTC (rev 2906)
+++ mgmt/trunk/cumin/python/cumin/pool.strings 2008-12-02 20:44:34 UTC (rev 2907)
@@ -47,7 +47,7 @@
div.vistats ul.radiotabs {
margin: 1em 0 0 1em;
}
-div.machine_help {
+.machine_help {
color: #444;
font-size: 0.8em;
}
@@ -77,11 +77,10 @@
</script>
[ShowAllSlots.html]
- <ul class="actions" style="margin: 1em;">
+ <ul class="actions {class}" style="margin: 1em;">
<li><a class="nav" href="{href}">Show All
Slots</a></li>
</ul>
-
[MachineVisualization.javascript]
function got_machine_grid(obj, id) {
for (var cell in obj.machines.machine) {
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-12-02 19:06:47 UTC (rev 2906)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-12-02 20:44:34 UTC (rev 2907)
@@ -76,7 +76,16 @@
ul.actions li {
display: inline;
}
+ul.actions.disabled a {
+ color: #666666;
+}
+ul.actions.disabled li a.nav:before {
+ color: #666666;
+}
+ul.actions.disabled a:hover {
+ background-color: #f7f7f7;
+}
a.nav:before {
content: "\00BB \0020";
font-weight: bold;
Show replies by date