rhmessaging commits: r2779 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-10 10:39:44 -0500 (Mon, 10 Nov 2008)
New Revision: 2779
Modified:
mgmt/trunk/cumin/python/cumin/broker.py
Log:
Different blank row detection for cumin-test
Modified: mgmt/trunk/cumin/python/cumin/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.py 2008-11-10 15:05:57 UTC (rev 2778)
+++ mgmt/trunk/cumin/python/cumin/broker.py 2008-11-10 15:39:44 UTC (rev 2779)
@@ -651,7 +651,10 @@
if self.validate(session, addrs, names, groups):
for i in range(0, fields):
- addr = addrs[i]
+ try:
+ addr = addrs[i]
+ except:
+ addr = None
if addr:
name = names[i]
@@ -679,7 +682,10 @@
fields = self.fields.get(session)
for i in range(0, fields):
- addr, name = addrs[i], names[i]
+ try:
+ addr, name = addrs[i], names[i]
+ except:
+ addr = name = None
if not addr and not name:
pass # It's just an empty row
16 years, 2 months
rhmessaging commits: r2778 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-10 10:05:57 -0500 (Mon, 10 Nov 2008)
New Revision: 2778
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Really show correct job count on job tab when multiple brokers are registered.
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-11-10 14:05:13 UTC (rev 2777)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-11-10 15:05:57 UTC (rev 2778)
@@ -80,20 +80,22 @@
def get_args(self, session):
return self.frame.get_args(session)
- def get_phase_sql(self, session):
- return self.phase.get_sql_constraint(session)
+ def get_phase_sql(self, session, phase=None):
+ return self.phase.get_sql_constraint(session, phase)
def get_phase_title(self, session):
state = self.phase.get(session)
return self.phase.get_title(state)
def render_sql_where(self, session, *args):
+ phase = len(args) > 1 and args[1] or None
elems = list()
- elems.append(self.get_phase_sql(session))
+ elems.append(self.get_phase_sql(session, phase))
elems.append("s.pool = %(pool)s")
return "where %s" % " and ".join(elems)
- def get_sql_values(self, session, pool):
+ def get_sql_values(self, session, *args):
+ pool = args[0]
return {"pool": pool.id}
class ArgsColumn(SqlTableColumn):
@@ -238,6 +240,11 @@
def get_find_sql_values(self, session, pool):
return {"custom_id": self.job_search.get(session), "pool": pool.id}
+ def get_full_item_count(self, session, *args):
+ # request item count will phase=="a"
+ new_args = (args[0], "a")
+ return self.get_item_count(session, *new_args)
+
def get_visible_columns(self, session):
return self.get_request_visible_columns(session, ["custom_group", "scheduler", "submitter"])
@@ -993,7 +1000,7 @@
return self.frame.get_args(session)
def render_title(self, session, *args):
- return "Jobs %s" % fmt_count(self.job_tab.get_item_count(session, *args))
+ return "Jobs %s" % fmt_count(self.job_tab.get_full_item_count(session, *args))
def show_status_switch(self, session):
is_group = self.is_group.get(session)
@@ -1239,8 +1246,9 @@
self.add_state("c", "Completed")
self.add_state("d", "Removed")
- def get_sql_constraint(self, session):
- phase = self.get(session)
+ def get_sql_constraint(self, session, phase=None):
+ if not phase:
+ phase = self.get(session)
alive = "((c.rec_time is null or " + \
"c.rec_time <= now() - interval '10 minutes')" + \
16 years, 2 months
rhmessaging commits: r2777 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-10 09:05:13 -0500 (Mon, 10 Nov 2008)
New Revision: 2777
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Show correct job count on job tab when multiple brokers are registered.
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-11-10 04:42:58 UTC (rev 2776)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-11-10 14:05:13 UTC (rev 2777)
@@ -993,7 +993,7 @@
return self.frame.get_args(session)
def render_title(self, session, *args):
- return "Jobs %s" % fmt_count(Job.select().count())#self.job_tab.get_item_count(session, job))
+ return "Jobs %s" % fmt_count(self.job_tab.get_item_count(session, *args))
def show_status_switch(self, session):
is_group = self.is_group.get(session)
16 years, 2 months
rhmessaging commits: r2776 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-11-09 23:42:58 -0500 (Sun, 09 Nov 2008)
New Revision: 2776
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Only show the last 16 characters of the command in the command column of JobSet.
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-11-10 04:31:24 UTC (rev 2775)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-11-10 04:42:58 UTC (rev 2776)
@@ -190,7 +190,7 @@
return "Command"
def render_content(self, session, data):
- return fmt_shorten(data[self.name], pre=5, post=11)
+ return fmt_shorten(data[self.name], 0, 16)
class TitleColumn(SqlTableColumn):
def render_title(self, session, data):
16 years, 2 months
rhmessaging commits: r2775 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-11-09 23:31:24 -0500 (Sun, 09 Nov 2008)
New Revision: 2775
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
By default, show the view mode of a frame when show_object is called
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-11-08 17:58:41 UTC (rev 2774)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-11-10 04:31:24 UTC (rev 2775)
@@ -55,7 +55,8 @@
def show_object(self, session, object):
self.object.set(session, object)
- return self.show(session)
+ self.__view.show(session)
+ return self
def get_args(self, session):
if self.object:
16 years, 2 months
rhmessaging commits: r2774 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-08 12:58:41 -0500 (Sat, 08 Nov 2008)
New Revision: 2774
Modified:
mgmt/trunk/cumin/python/cumin/binding.py
Log:
Used new SubmitSwitch on ExchangeBinding widget
Modified: mgmt/trunk/cumin/python/cumin/binding.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/binding.py 2008-11-08 17:57:10 UTC (rev 2773)
+++ mgmt/trunk/cumin/python/cumin/binding.py 2008-11-08 17:58:41 UTC (rev 2774)
@@ -1,6 +1,6 @@
from cumin.exchange import ExchangeInfo
from cumin.util import sorted_by
-from cumin.widgets import StateSwitch
+from cumin.widgets import SubmitSwitch
from formats import *
from wooly import Template, Writer, Attribute, Parameter, Widget
from wooly.forms import FormInput, FormField, Form
@@ -237,17 +237,13 @@
if m_info.endswith("nv"):
return this_exchange[m_info]
-class ExchangeState(StateSwitch):
+class ExchangeState(SubmitSwitch):
def __init__(self, app, name):
super(ExchangeState, self).__init__(app, name)
- self.add_state("c", "Active")
- self.add_state("a", "All")
+ self.add_state("c", "Active", bm="phase")
+ self.add_state("a", "All", bm="phase")
- def render_item_link(self, session, state):
- path = state == "a" and "state_all" or "state_active"
- return super(ExchangeState, self).render_item_link(session, state, id=path, bm="phase")
-
def is_all(self, session):
return self.get(session) == "a"
@@ -302,7 +298,8 @@
writer = Writer()
for exchange in sortedExchanges:
if ExchangeInfo.is_builtin(exchange) or \
- not (self.state.is_active(session) and not is_active(exchange)):
+ (not exchange._get_deletionTime() and \
+ not (self.state.is_active(session) and not is_active(exchange))):
# instance_key gives us a unique path for each exchange
# we will be rendering
instance_key = self.dict_param.get_instance_key(str(exchange.id))
16 years, 2 months
rhmessaging commits: r2773 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-08 12:57:10 -0500 (Sat, 08 Nov 2008)
New Revision: 2773
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Minor cleanup: removed unused id argument
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-11-08 17:56:12 UTC (rev 2772)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-11-08 17:57:10 UTC (rev 2773)
@@ -907,7 +907,7 @@
self.set(session, state)
break
- def render_item_link(self, session, state, id=""):
+ def render_item_link(self, session, state):
branch = session.branch()
self.set(branch, state)
@@ -921,7 +921,7 @@
else:
class_ = self.get(session) == state and "selected"
href = branch.marshal()
- return fmt_link(href, title, class_, id=id, link_title=link_title)
+ return fmt_link(href, title, class_, link_title=link_title)
def is_bad(self, file):
bad = False
16 years, 2 months
rhmessaging commits: r2772 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-08 12:56:12 -0500 (Sat, 08 Nov 2008)
New Revision: 2772
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Added class SubmitSwitch to submit the form when changing states. This is so other form values get submitted and remembered.
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-11-08 17:53:18 UTC (rev 2771)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-11-08 17:56:12 UTC (rev 2772)
@@ -524,11 +524,13 @@
self.__states = list()
self.__titles = dict()
self.__hover = dict()
+ self.__bookmark = dict()
- def add_state(self, state, title, hover=""):
+ def add_state(self, state, title, hover="", bm=None):
self.__states.append(state)
self.__titles[state] = title
self.__hover[state] = hover
+ self.__bookmark[state] = bm
if self.__param.default is None:
self.__param.default = state
@@ -546,15 +548,28 @@
def get_title(self, state):
return state in self.__titles and self.__titles[state]
- def render_item_link(self, session, state, id="", bm=""):
+ def get_hover(self, state):
+ return state in self.__hover and self.__hover[state]
+
+ def get_bookmark(self, state):
+ return state in self.__bookmark and self.__bookmark[state]
+
+ def get_param_id(self):
+ """ needed because the SubmitSwitch class uses
+ a hidden input to set the param value instead
+ of a link name/value pair """
+ return self.__param.path
+
+ def render_item_link(self, session, state):
branch = session.branch()
self.set(branch, state)
- title = self.__titles[state]
- hover = self.__hover[state]
+ title = self.get_title(state)
+ hover = self.get_hover(state)
class_ = self.get(session) == state and "selected"
+ bm = self.get_bookmark(state)
- return fmt_link(branch.marshal(), title, class_, id=id, link_title=hover, bm=bm)
+ return fmt_link(branch.marshal(), title, class_, link_title=hover, bm=bm)
class GroupSwitch(StateSwitch):
def __init__(self, app, name):
@@ -603,6 +618,30 @@
return sql
+class SubmitSwitch(StateSwitch):
+ """ Clicking on the link will submit the form.
+
+ This uses javascript and a hidden input to
+ submit the form when the link is clicked. This
+ allows other fields on the form to "remember"
+ their values. """
+ def render_value(self, session, *args):
+ return str(self.get(session))
+
+ def render_name(self, session, *args):
+ """ this needs to be the path of the param """
+ return self.get_param_id()
+
+ def render_item_link(self, session, state):
+ title = self.get_title(state)
+ hover = self.get_hover(state)
+ class_ = self.get(session) == state and "selected"
+ bm = self.get_bookmark(state)
+ name = self.get_param_id()
+ click = "submit_state('%s', '%s'); return false;" % (name, state)
+
+ return fmt_link("", title, class_, link_title=hover, bm=bm, click=click)
+
class CuminTable(SqlTable):
def __init__(self, app, name):
super(CuminTable, self).__init__(app, name)
@@ -1069,6 +1108,8 @@
return
class AjaxField(Widget):
+ """ Update a single span or div after the page loads """
+
def render_script(self, session):
script = """
<script type="text/javascript">
@@ -1112,6 +1153,20 @@
return self.render_id(session)
class MoreFieldSet(FieldForm, FormField):
+ """ Displays a button that opens and closes a set of fields
+
+ Used in a FieldForm as a FormField. Instead of calling
+ add_field on the FieldForm, call add_field on this.
+ For example:
+ self.more = MoreFieldSet(app, "more")
+ self.add_field(self.more)
+
+ self.name = NameField(app, "name")
+ self.more.add_field(self.name)
+
+ self.port = StringField(app, "port")
+ self.more.add_field(self.port)
+ """
def __init__(self, app, name):
super(MoreFieldSet, self).__init__(app, name)
@@ -1140,4 +1195,3 @@
def render_open_display(self, session, *args):
return self.input.get(session) and "block" or "none"
-
\ No newline at end of file
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-11-08 17:53:18 UTC (rev 2771)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-11-08 17:56:12 UTC (rev 2772)
@@ -849,6 +849,26 @@
[StateSwitch.item_html]
<li>{item_link}</li>
+[SubmitSwitch.javascript]
+function submit_state(id, state) {
+ var oHidden = document.forms[0].elements[id];
+ if (oHidden) {
+ if (oHidden.length) {
+ for (var i=0; i<oHidden.length; i++) {
+ oHidden[i].value = state;
+ }
+ } else {
+ oHidden.value = state;
+ }
+ document.forms[0].submit();
+ }
+}
+
+[SubmitSwitch.html]
+<ul class="radiotabs">
+ {items}
+</ul><input type="hidden" name="{name}" value="{value}" />
+
[CuminEditableProperties.html]
<table class="PropertySet Editable">
<thead>
@@ -1004,7 +1024,11 @@
div.more_field_set {
margin-bottom: 1em;
}
+div.more_field_set ul.actions {
+ margin-bottom: 0.5em;
+}
+
[MoreFieldSet.html]
<div class="more_field_set">
<ul class="actions">
16 years, 2 months
rhmessaging commits: r2771 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-08 12:53:18 -0500 (Sat, 08 Nov 2008)
New Revision: 2771
Modified:
mgmt/trunk/cumin/python/cumin/queue.py
Log:
For consistency, moved durability option in advanced options for queue add.
Modified: mgmt/trunk/cumin/python/cumin/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.py 2008-11-08 17:52:32 UTC (rev 2770)
+++ mgmt/trunk/cumin/python/cumin/queue.py 2008-11-08 17:53:18 UTC (rev 2771)
@@ -324,12 +324,12 @@
self.namef = NameField(app, "name")
self.add_field(self.namef)
- self.durable = self.QueueDurabilityField(app, "durable")
- self.add_field(self.durable)
-
self.more = MoreFieldSet(app, "more")
self.add_field(self.more)
+ self.durable = self.QueueDurabilityField(app, "durable")
+ self.more.add_field(self.durable)
+
self.cluster_durable = self.ClusterDurabilityField(app, "cluster_durable")
self.more.add_field(self.cluster_durable)
16 years, 2 months
rhmessaging commits: r2770 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-08 12:52:32 -0500 (Sat, 08 Nov 2008)
New Revision: 2770
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Added missing add-link/bridge options
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-11-08 17:50:53 UTC (rev 2769)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-11-08 17:52:32 UTC (rev 2770)
@@ -793,6 +793,7 @@
reg = args["reg"]
username = args["username"]
password = args["password"]
+ transport = args["transport"]
if username == "anonymous":
authMechanism = "ANONYMOUS"
else:
@@ -800,8 +801,8 @@
broker = reg._get_broker()
broker.connect(self.model.data, completion,
- link.host, link.port, link.useSsl, link.durable,
- authMechanism, username, password)
+ link.host, link.port, link.durable,
+ authMechanism, username, password, transport)
class AddQueue(CuminAction):
FILECOUNT = "qpid.file_count"
@@ -1520,13 +1521,12 @@
dest = args["exchange"] # see qpid-route
key = args["key"]
tag = args["tag"]
+ dynamic = args["dynamic"]
excludes = args["excludes"]
- srcIsQueue = 0
- srcIsLocal = 0
link.bridge(self.model.data, completion,
durable, src, dest, key,
- tag, excludes, srcIsQueue, srcIsLocal)
+ tag, excludes, False, False, dynamic)
class Close(CuminAction):
def show(self, session, link):
16 years, 2 months