[rhmessaging-commits] rhmessaging commits: r1366 - mgmt/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Nov 26 22:07:49 EST 2007


Author: justi9
Date: 2007-11-26 22:07:49 -0500 (Mon, 26 Nov 2007)
New Revision: 1366

Modified:
   mgmt/cumin/python/cumin/exchange.strings
   mgmt/cumin/python/cumin/model.py
Log:
Adds a write_xml method to CuminExchange and makes the exchange ajax
work correctly.



Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings	2007-11-27 02:53:27 UTC (rev 1365)
+++ mgmt/cumin/python/cumin/exchange.strings	2007-11-27 03:07:49 UTC (rev 1366)
@@ -87,17 +87,17 @@
 function updateExchangeStatus(id, exchange) {
     updateStatus(id, exchange);
 
-    var m = exchange.measurement;
-    var mdata = {
+    var s = exchange.stat;
+    var sdata = {
         "tr": [
             null,
-            {"td": [m.msgReceives.rate, m.byteReceives.rate]},
-            {"td": [m.msgRoutes.rate, m.byteRoutes.rate]},
-            {"td": [m.msgDrops.value, m.byteDrops.value]}
+            {"td": [s.msgReceives.rate, s.byteReceives.rate]},
+            {"td": [s.msgRoutes.rate, s.byteRoutes.rate]},
+            {"td": [s.msgDrops.value, s.byteDrops.value]}
         ]
     };
 
-    wooly.doc().elembyid(id).descendant("table.tbody").update(mdata);
+    wooly.doc().elembyid(id).descendant("table.tbody").update(sdata);
 }
 
 [ExchangeStatus.html]

Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py	2007-11-27 02:53:27 UTC (rev 1365)
+++ mgmt/cumin/python/cumin/model.py	2007-11-27 03:07:49 UTC (rev 1366)
@@ -311,6 +311,15 @@
         stat.unit = "message"
         stat.categories = ("general")
 
+    def write_xml(self, exchange, writer):
+        writer.write("<exchange id=\"%i\">" % exchange.id)
+        writer.write("<name>%s</name>" % exchange.name)
+
+        self.write_error_xml(exchange, writer)
+        self.write_stat_xml(exchange, writer)
+            
+        writer.write("</exchange>")
+
 class DummyModel(Model):
     def __init__(self):
         super(DummyModel, self).__init__()




More information about the rhmessaging-commits mailing list