Author: justi9
Date: 2007-11-02 15:54:14 -0400 (Fri, 02 Nov 2007)
New Revision: 1220
Modified:
mgmt/cumin/python/cumin/brokercluster.py
mgmt/cumin/python/cumin/brokercluster.strings
mgmt/cumin/python/cumin/brokergroup.py
mgmt/cumin/python/cumin/brokergroup.strings
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/model.py
Log:
Makes all the status boxes use CuminStatus.
Modified: mgmt/cumin/python/cumin/brokercluster.py
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.py 2007-11-02 19:11:41 UTC (rev 1219)
+++ mgmt/cumin/python/cumin/brokercluster.py 2007-11-02 19:54:14 UTC (rev 1220)
@@ -39,9 +39,6 @@
return writer.to_string()
- def render_broker_status(self, session, broker):
- return random() < 0.25 and "red" or "green"
-
class BrokerClusterFrame(CuminFrame):
def __init__(self, app, name):
super(BrokerClusterFrame, self).__init__(app, name)
@@ -64,10 +61,16 @@
def render_title(self, session, cluster):
return "Broker Cluster '%s'" % cluster.name
+class BrokerClusterStatus(CuminStatus):
+ pass
+
class BrokerClusterView(Widget):
def __init__(self, app, name):
super(BrokerClusterView, self).__init__(app, name)
+ self.status = BrokerClusterStatus(app, "status")
+ self.add_child(self.status)
+
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
Modified: mgmt/cumin/python/cumin/brokercluster.strings
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.strings 2007-11-02 19:11:41 UTC (rev 1219)
+++ mgmt/cumin/python/cumin/brokercluster.strings 2007-11-02 19:54:14 UTC (rev 1220)
@@ -38,12 +38,8 @@
<div class="brokerlight {broker_status}"></div>
[BrokerClusterView.html]
-<div class="mstatus green" id="{id}">
- <h2>Broker Cluster Status</h2>
+{status}
- <div>0 errors, 0 warnings</div>
-</div>
-
<h1>{title}</h1>
<table class="props">
Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py 2007-11-02 19:11:41 UTC (rev 1219)
+++ mgmt/cumin/python/cumin/brokergroup.py 2007-11-02 19:54:14 UTC (rev 1220)
@@ -60,10 +60,16 @@
def render_title(self, session, group):
return "Broker Group '%s'" % group.name
+class BrokerGroupStatus(CuminStatus):
+ pass
+
class BrokerGroupView(Widget):
def __init__(self, app, name):
super(BrokerGroupView, self).__init__(app, name)
+ self.status = BrokerGroupStatus(app, "status")
+ self.add_child(self.status)
+
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
Modified: mgmt/cumin/python/cumin/brokergroup.strings
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.strings 2007-11-02 19:11:41 UTC (rev 1219)
+++ mgmt/cumin/python/cumin/brokergroup.strings 2007-11-02 19:54:14 UTC (rev 1220)
@@ -29,12 +29,8 @@
</tr>
[BrokerGroupView.html]
-<div class="mstatus green" id="{id}">
- <h2>Broker Group Status</h2>
+{status}
- <div>0 errors, 0 warnings</div>
-</div>
-
<h1>{title}</h1>
<table class="props">
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-02 19:11:41 UTC (rev 1219)
+++ mgmt/cumin/python/cumin/client.py 2007-11-02 19:54:14 UTC (rev 1220)
@@ -49,10 +49,16 @@
def render_title(self, session, client):
return "Client %s" % client.address
+class ClientStatus(CuminStatus):
+ pass
+
class ClientView(Widget):
def __init__(self, app, name):
super(ClientView, self).__init__(app, name)
+ self.status = ClientStatus(app, "status")
+ self.add_child(self.status)
+
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-02 19:11:41 UTC (rev 1219)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-02 19:54:14 UTC (rev 1220)
@@ -33,12 +33,8 @@
</tr>
[ClientView.html]
-<div class="mstatus green" id="{id}">
- <h2>Client Status</h2>
+{status}
- <div>0 errors, 0 warnings</div>
-</div>
-
<h1>{title}</h1>
<table class="props">
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-02 19:11:41 UTC (rev 1219)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-02 19:54:14 UTC (rev 1220)
@@ -91,10 +91,16 @@
def render_title(self, session, exchange):
return "Exchange '%s'" % exchange.name
+class ExchangeStatus(CuminStatus):
+ pass
+
class ExchangeView(Widget):
def __init__(self, app, name):
super(ExchangeView, self).__init__(app, name)
+ self.status = ExchangeStatus(app, "status")
+ self.add_child(self.status)
+
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-11-02 19:11:41 UTC (rev 1219)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-11-02 19:54:14 UTC (rev 1220)
@@ -84,23 +84,17 @@
</script>
[ExchangeView.html]
-<div class="ExchangeView oblock">
- <div class="mstatus green" id="{id}">
- <h2>Exchange Status</h2>
+{status}
- <div>0 errors, 0 warnings</div>
- </div>
+<h1><img src="resource?name=exchange-36.png"> {title}</h1>
- <h1><img src="resource?name=exchange-36.png"> {title}</h1>
+<dl class="properties">
+ <dt>Name</dt><dd>{exchange_name}</dd>
+ <dt>Type</dt><dd>{type}</dd>
+</dl>
- <dl class="properties">
- <dt>Name</dt><dd>{exchange_name}</dd>
- <dt>Type</dt><dd>{type}</dd>
- </dl>
+{tabs}
- {tabs}
-</div>
-
[ExchangeBindingSet.html]
<table class="ExchangeBindingSet mobjects">
<tr>
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-02 19:11:41 UTC (rev 1219)
+++ mgmt/cumin/python/cumin/model.py 2007-11-02 19:54:14 UTC (rev 1220)
@@ -192,6 +192,9 @@
self.name = None
+ self.errors = list()
+ self.warnings = list()
+
class Broker(ModelObject):
def __init__(self, model):
super(Broker, self).__init__(model, model.broker)
@@ -219,6 +222,9 @@
self.name = None
+ self.errors = list()
+ self.warnings = list()
+
class ConfigProperty(ModelObject):
def __init__(self, model):
super(ConfigProperty, self).__init__(model, model.config_property)
@@ -234,6 +240,9 @@
self.name = None
+ self.errors = list()
+ self.warnings = list()
+
class BrokerGroupType(ModelObject):
def __init__(self, model):
super(BrokerGroupType, self).__init__(model, model.broker_group_type)
@@ -727,6 +736,9 @@
self.address = None
+ self.errors = list()
+ self.warnings = list()
+
measure = Measurement("msgsProduced", "int")
measure.title = "Messages produced"
measure.categories = ("message", "general")