[rhmessaging-commits] rhmessaging commits: r1482 - in mgmt: notes and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu Dec 13 15:25:38 EST 2007


Author: justi9
Date: 2007-12-13 15:25:38 -0500 (Thu, 13 Dec 2007)
New Revision: 1482

Modified:
   mgmt/cumin/python/cumin/client.py
   mgmt/cumin/python/cumin/client.strings
   mgmt/notes/justin-todo.txt
Log:
Adds a client close form and hooks it up.



Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py	2007-12-13 20:17:34 UTC (rev 1481)
+++ mgmt/cumin/python/cumin/client.py	2007-12-13 20:25:38 UTC (rev 1482)
@@ -75,9 +75,45 @@
         self.add_mode(self.view)
         self.set_view_mode(self.view)
 
+        self.close = ClientClose(app, "close")
+        self.add_mode(self.close)
+
+    def show_close(self, session):
+        return self.show_mode(session, self.close)
+
     def get_title(self, session, client):
         return "Client %s" % client.address
 
+def doit(error, args):
+    print error, args
+    print "did it!"
+
+class ClientClose(CuminConfirmForm):
+    def get_title(self, session, client):
+        return "Close Client '%s'" % client.address
+
+    def process_cancel(self, session, client):
+        branch = session.branch()
+        self.page().show_client(branch, client).show_view(branch)
+        self.page().set_redirect_url(session, branch.marshal())
+
+    def process_submit(self, session, client):
+        print "open close"
+
+        print "client.managedBroker", client.managedBroker
+        
+        client.close(self.app.model.data, client.managedBroker, doit)
+
+        print "close close"
+
+        self.process_cancel(session, client)
+
+    def render_submit_content(self, session, client):
+        return "Yes, Close Client '%s'" % client.address
+
+    def render_cancel_content(self, session, client):
+        return "No, Cancel"
+
 class ClientStatus(CuminStatus):
     def render_messages_produced(self, session, client):
         stat = self.app.model.client.get_stat("msgsProduced")
@@ -132,6 +168,11 @@
     def render_updated(self, session, client):
         return fmt_datetime(client.recTime)
 
+    def render_close_href(self, session, client):
+        branch = session.branch()
+        self.parent().show_close(branch)
+        return branch.marshal()
+
 class ClientStatistics(TabSet):
     def __init__(self, app, name):
         super(ClientStatistics, self).__init__(app, name)

Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings	2007-12-13 20:17:34 UTC (rev 1481)
+++ mgmt/cumin/python/cumin/client.strings	2007-12-13 20:25:38 UTC (rev 1482)
@@ -110,8 +110,7 @@
   <tr>
     <th class="actions" colspan="2">
       <h2>Act on This Client:</h2>
-      <a href="{href}">Detach</a>
-      <a href="{href}">Close</a>
+      <a href="{close_href}">Close</a>
     </th>
   </tr>
 </table>

Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt	2007-12-13 20:17:34 UTC (rev 1481)
+++ mgmt/notes/justin-todo.txt	2007-12-13 20:25:38 UTC (rev 1482)
@@ -41,6 +41,8 @@
 
  * Group form submit has different behaviors between hitting enter and
    clicking submit
+
+ * Add client icon
  
 Deferred
 




More information about the rhmessaging-commits mailing list