[rhmessaging-commits] rhmessaging commits: r1636 - mgmt/cumin/python/cumin.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Mon Feb 4 09:29:52 EST 2008
Author: justi9
Date: 2008-02-04 09:29:52 -0500 (Mon, 04 Feb 2008)
New Revision: 1636
Added:
mgmt/cumin/python/cumin/system.py
mgmt/cumin/python/cumin/system.strings
Log:
Adds initial system ui elements.
Added: mgmt/cumin/python/cumin/system.py
===================================================================
--- mgmt/cumin/python/cumin/system.py (rev 0)
+++ mgmt/cumin/python/cumin/system.py 2008-02-04 14:29:52 UTC (rev 1636)
@@ -0,0 +1,85 @@
+from mint import *
+from wooly import *
+from wooly.widgets import *
+
+from widgets import *
+from parameters import *
+from formats import *
+from util import *
+
+strings = StringCatalog(__file__)
+
+class SystemSet(CuminTable, Form):
+ def __init__(self, app, name):
+ super(SystemSet, self).__init__(app, name)
+
+ self.table_sql = "system as s"
+
+ self.add_sql_column("id", "s.id")
+ self.add_sql_column("name", "s.sys_id")
+
+ self.ids = CheckboxIdColumn(app, "id")
+ self.add_column(self.ids)
+ self.add_form_parameter(self.ids)
+
+ col = self.NameColumn(app, "name")
+ self.add_column(col)
+
+ # XXX get rid of this
+ self.submit = BooleanParameter(app, "submit")
+ self.add_parameter(self.submit)
+ self.add_form_parameter(self.submit)
+
+ def get_title(self, session, model):
+ count = System.select().count()
+ return "Systems %s" % fmt_count(count)
+
+ class NameColumn(SqlTableColumn):
+ def get_title(self, session, model):
+ return "Name"
+
+ def render_content(self, session, data):
+ system = Identifiable(data["id"])
+ branch = session.branch()
+ self.frame().show_system(branch, system).show_view(branch)
+ return fmt_olink(branch, system, name=data["name"])
+
+class SystemFrame(CuminFrame):
+ def __init__(self, app, name):
+ super(SystemFrame, self).__init__(app, name)
+
+ self.param = SystemParameter(app, "id")
+ self.add_parameter(self.param)
+ self.set_object_parameter(self.param)
+
+ self.view = SystemView(app, "view")
+ self.add_mode(self.view)
+ self.set_view_mode(self.view)
+
+ def get_title(self, session, broker):
+ return "System '%s'" % system.sysId
+
+class SystemStatus(CuminStatus):
+ pass
+
+class SystemView(CuminView):
+ def __init__(self, app, name):
+ super(SystemView, self).__init__(app, name)
+
+ self.status = SystemStatus(app, "status")
+ self.add_child(self.status)
+
+ self.tabs = TabSet(app, "tabs")
+ self.add_child(self.tabs)
+
+ self.add_tab(SystemStatsTab(app, "stats"))
+
+ def get_title(self, session, broker):
+ return "System '%s'" % broker.name
+
+ def render_data_url(self, session, model):
+ return "model.xml"
+
+ class SystemStatsTab(Widget):
+ def get_title(self, session, broker):
+ return "Statistics"
Added: mgmt/cumin/python/cumin/system.strings
===================================================================
--- mgmt/cumin/python/cumin/system.strings (rev 0)
+++ mgmt/cumin/python/cumin/system.strings 2008-02-04 14:29:52 UTC (rev 1636)
@@ -0,0 +1,16 @@
+[SystemSet.html]
+<form id="{id}" method="post" action="?">
+ <table class="mobjects">
+ <thead>
+ <tr>
+ <th class="setnav" colspan="0">
+ <div class="rfloat">{page}</div>
+ {count}
+ </th>
+ </tr>
+ <tr>{headers}</tr>
+ </thead>
+ <tbody>{items}</tbody>
+ </table>
+ {hidden_inputs}
+</form>
More information about the rhmessaging-commits
mailing list