Author: justi9
Date: 2007-10-27 10:02:55 -0400 (Sat, 27 Oct 2007)
New Revision: 1173
Modified:
mgmt/cumin/python/cumin/brokergroup.py
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/queue.py
Log:
More uniform styling of actions.
Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py 2007-10-27 14:02:31 UTC (rev 1172)
+++ mgmt/cumin/python/cumin/brokergroup.py 2007-10-27 14:02:55 UTC (rev 1173)
@@ -22,16 +22,22 @@
return sorted_by(model.get_broker_groups())
def render_item_link(self, session, group):
- href = self.page().broker_group_href(session, group)
- return mlink(href, "BrokerGroup", group.name)
+ branch = session.branch()
+ self.page().show_broker_group(branch, group).show_view(branch)
+ return mlink(branch.marshal(), "BrokerGroup", group.name)
def render_item_config(self, session, group):
count = len(group.broker_items())
- return "%i broker%s" % (count, count == 1 and "" or
"s")
+ return "%i broker%s" % (count, ess(count))
def render_item_status(self, session, group):
- return status(len(group.errors), len(group.warnings))
+ writer = Writer()
+
+ for broker in sorted_by(group.broker_items()):
+ writer.write(status(len(broker.errors), len(broker.warnings)))
+ return writer.to_string()
+
def render_none(self, session, group):
return none()
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-10-27 14:02:31 UTC (rev 1172)
+++ mgmt/cumin/python/cumin/exchange.py 2007-10-27 14:02:55 UTC (rev 1173)
@@ -45,10 +45,10 @@
def render_item_config(self, session, exchange):
count = len(exchange.binding_items())
- return "%i %s" % (count, count == 1 and "binding" or
"bindings")
+ return "%i binding%s" % (count, ess(count))
def render_item_status(self, session, exchange):
- return "2 errors"
+ return status(len(exchange.errors), len(exchange.warnings))
def render_item_messages_received(self, session, exchange):
return exchange.get_measurement("msgReceives").get_value()
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-27 14:02:31 UTC (rev 1172)
+++ mgmt/cumin/python/cumin/model.py 2007-10-27 14:02:55 UTC (rev 1173)
@@ -233,8 +233,6 @@
super(BrokerGroup, self).__init__(model, model.broker_group)
self.name = None
- self.errors = list()
- self.warnings = list()
class BrokerGroupType(ModelObject):
def __init__(self, model):
@@ -368,6 +366,9 @@
self.error_count = 0
self.warning_count = 0
+ self.errors = list()
+ self.warnings = list()
+
# General
measure = Measurement("msgDepth", "int")
@@ -575,6 +576,9 @@
self.is_auto_delete = False
self.is_internal = False
+ self.errors = list()
+ self.warnings = list()
+
measure = Measurement("bindings", "int")
measure.title = "Bindings"
measure.categories = ("general")
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-10-27 14:02:31 UTC (rev 1172)
+++ mgmt/cumin/python/cumin/page.py 2007-10-27 14:02:55 UTC (rev 1173)
@@ -126,11 +126,6 @@
frame = frame.show_client(session, client)
return self.set_current_frame(session, frame)
- def broker_group_href(self, session, group):
- branch = session.branch()
- self.show_broker_group(branch, group).show_view(branch)
- return branch.marshal()
-
def render_class(self, session, object):
return self.modal.get(session) and "modal"
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-10-27 14:02:31 UTC (rev 1172)
+++ mgmt/cumin/python/cumin/page.strings 2007-10-27 14:02:55 UTC (rev 1173)
@@ -155,7 +155,7 @@
div.sactions {
margin: 0;
- padding: 0.5em 0.75em;
+ padding: 0.35em 0.75em;
background-color: #e7e7f7;
}
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-10-27 14:02:31 UTC (rev 1172)
+++ mgmt/cumin/python/cumin/queue.py 2007-10-27 14:02:55 UTC (rev 1173)
@@ -49,9 +49,7 @@
return "%i binding%s" % (count, ess(count))
def render_item_status(self, session, queue):
- return "%i error%s, %i warning%s" \
- % (queue.error_count, ess(queue.error_count),
- queue.warning_count, ess(queue.warning_count))
+ return status(len(queue.errors), len(queue.warnings))
def render_item_message_depth(self, session, queue):
return queue.get_measurement("msgDepth").get_value()