rhmessaging commits: r2739 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-05 10:03:33 -0500 (Wed, 05 Nov 2008)
New Revision: 2739
Modified:
mgmt/trunk/cumin/python/cumin/formats.py
Log:
Added fmt_dict global method to display dict() data in model properties.
Modified: mgmt/trunk/cumin/python/cumin/formats.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/formats.py 2008-11-04 21:11:31 UTC (rev 2738)
+++ mgmt/trunk/cumin/python/cumin/formats.py 2008-11-05 15:03:33 UTC (rev 2739)
@@ -2,6 +2,7 @@
from random import random
from util import *
+from wooly import Writer
def fmt_count(count):
return "<span class=\"count\">(%i)</span>" % count
@@ -132,3 +133,21 @@
name = fmt_shorten(name, pre, post)
return fmt_link(session.marshal(), name, selected and "selected")
+
+def fmt_dict(value, prefix=None):
+ html = """
+ <tr style="border-top: 0; border-bottom: 1px dotted #CCCCCC;">
+ <td style="padding:0; color: #444444;" nowrap="nowrap">%s</td>
+ <td style="padding:0 0 0 1em;">%s</td>
+ </tr>
+ """
+ writer = Writer()
+ writer.write("<table style='border-collapse: collapse;'>")
+ for key in value:
+ show_key = key
+ if prefix:
+ if key.startswith(prefix):
+ show_key = key[len(prefix):]
+ writer.write(html % (show_key, str(value[key])))
+ writer.write("</table>")
+ return writer.to_string()
15 years, 7 months
rhmessaging commits: r2738 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-11-04 16:11:31 -0500 (Tue, 04 Nov 2008)
New Revision: 2738
Modified:
mgmt/trunk/cumin/python/cumin/__init__.py
Log:
add missing import
Modified: mgmt/trunk/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/__init__.py 2008-11-04 20:04:09 UTC (rev 2737)
+++ mgmt/trunk/cumin/python/cumin/__init__.py 2008-11-04 21:11:31 UTC (rev 2738)
@@ -17,6 +17,7 @@
from stat import StatChartPage
from action import ActionPage
from user import LoginPage, UserSession
+from datetime import timedelta
from wooly import Session
15 years, 7 months
rhmessaging commits: r2737 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-04 15:04:09 -0500 (Tue, 04 Nov 2008)
New Revision: 2737
Modified:
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/queue.py
Log:
Added new "Add Queue" options
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-11-04 20:00:14 UTC (rev 2736)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-11-04 20:04:09 UTC (rev 2737)
@@ -798,12 +798,38 @@
return frame.queue_add.show(session)
def do_invoke(self, queue, args, completion):
+ FILECOUNT = "qpid.file_count"
+ FILESIZE = "qpid.file_size"
+ MAX_QUEUE_SIZE = "qpid.max_size"
+ MAX_QUEUE_COUNT = "qpid.max_count"
+ POLICY_TYPE = "qpid.policy_type"
+ CLUSTER_DURABLE = "qpid.persist_last_node"
+ LVQ = "qpid.last_value_queue"
+ OPTIMISTIC_CONSUME = "qpid.optimistic_consume"
+
reg = args["reg"]
+ declArgs = {}
+ if queue.durable:
+ declArgs[FILECOUNT] = args["file_count"]
+ declArgs[FILESIZE] = args["file_size"]
+
+ if args["q_size"]:
+ declArgs[MAX_QUEUE_SIZE] = args["q_size"]
+ if args["q_count"]:
+ declArgs[MAX_QUEUE_COUNT] = args["q_count"]
+ if args["policy"]:
+ declArgs[POLICY_TYPE] = args["policy"]
+ if args["cluster_durable"]:
+ declArgs[CLUSTER_DURABLE] = 1
+ if args["lvq"]:
+ declArgs[LVQ] = 1
+ if args["optimistic"]:
+ declArgs[OPTIMISTIC_CONSUME] = 1
+
session = self.getSessionFromRegistration(reg)
session.queue_declare(queue=queue.name,
- exclusive=queue.exclusive,
durable=queue.durable,
- auto_delete=queue.autoDelete)
+ arguments=declArgs)
# optionally bind to exchanges
binding_info = args['exchange_keys']
Modified: mgmt/trunk/cumin/python/cumin/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.py 2008-11-04 20:00:14 UTC (rev 2736)
+++ mgmt/trunk/cumin/python/cumin/queue.py 2008-11-04 20:04:09 UTC (rev 2737)
@@ -324,15 +324,38 @@
self.namef = NameField(app, "name")
self.add_field(self.namef)
- self.durable = DurabilityField(app, "durable")
+ self.durable = self.QueueDurabilityField(app, "durable")
self.add_field(self.durable)
- #self.exclusive = ExclusivityField(app, "exclusive")
- #self.add_field(self.exclusive)
+ self.more = MoreFieldSet(app, "more")
+ self.add_field(self.more)
- self.autodelete = AutoDeleteField(app, "autodelete")
- self.add_field(self.autodelete)
+ self.cluster_durable = self.ClusterDurabilityField(app, "cluster_durable")
+ self.more.add_field(self.cluster_durable)
+
+ self.lvq = self.LVQField(app, "lvq")
+ self.more.add_field(self.lvq)
+
+ self.optimistic = self.OptimisticField(app, "optimistic")
+ self.more.add_field(self.optimistic)
+ self.policy = self.PolicyField(app, "policy")
+ self.more.add_field(self.policy)
+
+ self.file_count = self.FileCountField(app, "file_count")
+ self.file_count.input.param.default = 8
+ self.more.add_field(self.file_count)
+
+ self.file_size = self.FileSizeField(app, "file_size")
+ self.file_size.input.param.default = 24
+ self.more.add_field(self.file_size)
+
+ self.q_size = self.QSizeField(app, "q_size")
+ self.more.add_field(self.q_size)
+
+ self.q_count = self.QCountField(app, "q_count")
+ self.more.add_field(self.q_count)
+
self.bindings = ExchangeKeysField(app, "bindings")
self.add_field(self.bindings)
@@ -341,12 +364,144 @@
(errors, form_binding_info) = self.bindings.get_binding_errors(session, queue_name)
return (errors or super_error, form_binding_info)
+ class QCountField(IntegerField):
+ def render_title(self, session):
+ return "Max Queue Count"
+
+ def render_field_help(self, session):
+ return "(Maximum in-memory queue size as a number of messages)"
+
+ class QSizeField(IntegerField):
+ def render_title(self, session):
+ return "Max Queue Size"
+
+ def render_field_help(self, session):
+ return "(Maximum in-memory queue size as bytes)"
+
+ class FileCountField(IntegerField):
+ def render_title(self, session):
+ return "File Count"
+
+ def render_field_help(self, session):
+ return "(Number of files in queue's persistence journal)"
+
+ class FileSizeField(IntegerField):
+ def render_title(self, session):
+ return "File Size"
+
+ def render_field_help(self, session):
+ return "(File size in pages - 64Kb/page)"
+
+ class QueueDurabilityField(TwoOptionRadioField):
+ def __init__(self, app, name, option1="durable", option2="transient"):
+ super(QueueForm.QueueDurabilityField, self).__init__(app, name, option1, option2)
+
+ self.option1_title = "Durable"
+ self.option2_title = "Transient"
+
+ def render_title(self, session):
+ return "Durable?"
+
+ def render_field_help(self, session):
+ return "(Queue is durable)"
+
+ class ClusterDurabilityField(TwoOptionRadioField):
+ def __init__(self, app, name, option1="durable", option2="transient"):
+ super(QueueForm.ClusterDurabilityField, self).__init__(app, name, option1, option2)
+
+ self.option1_title = "Cluster Durable"
+ self.option2_title = "Not Cluster Durable"
+
+ def render_title(self, session):
+ return "Cluster Durable?"
+
+ def render_field_help(self, session):
+ return "(Queue becomes durable if there is only one functioning cluster node)"
+
+ class LVQField(TwoOptionRadioField):
+ def __init__(self, app, name, option1="enable", option2="disable"):
+ super(QueueForm.LVQField, self).__init__(app, name, option1, option2)
+
+ self.option1_title = "Enabled"
+ self.option2_title = "Not Enabled"
+
+ def render_title(self, session):
+ return "Enable Last Value Queue?"
+
+ def render_field_help(self, session):
+ return "(Enable LVQ behavior on the queue)"
+
+ class OptimisticField(TwoOptionRadioField):
+ def __init__(self, app, name, option1="enable", option2="disable"):
+ super(QueueForm.OptimisticField, self).__init__(app, name, option1, option2)
+
+ self.option1_title = "Enabled"
+ self.option2_title = "Not Enabled"
+
+ def render_title(self, session):
+ return "Enable Optimistic Consume?"
+
+ def render_field_help(self, session):
+ return "(Enable optimistic consume on the queue)"
+
+ class PolicyField(RadioField):
+ def __init__(self, app, name):
+ super(QueueForm.PolicyField, self).__init__(app, name, None)
+
+ self.param = Parameter(app, "param")
+ self.param.default = "reject"
+ self.add_parameter(self.param)
+
+ option = self.Reject(app, "reject", self.param)
+ self.add_option(option)
+
+ option = self.Flow(app, "flow", self.param)
+ self.add_option(option)
+
+ option = self.Ring(app, "ring", self.param)
+ self.add_option(option)
+
+ option = self.RingStrict(app, "ring_strict", self.param)
+ self.add_option(option)
+
+ def render_title(self, session):
+ return "Policy-type"
+
+ def render_field_help(self, session):
+ return "(Action taken when queue limit is reached)"
+
+ class Reject(RadioFieldOption):
+ def render_value(self, session):
+ return "reject"
+
+ def render_title(self, session):
+ return "Reject"
+
+ class Flow(RadioFieldOption):
+ def render_value(self, session):
+ return "flow"
+
+ def render_title(self, session):
+ return "Flow to disc"
+
+ class Ring(RadioFieldOption):
+ def render_value(self, session):
+ return "ring"
+
+ def render_title(self, session):
+ return "Ring"
+
+ class RingStrict(RadioFieldOption):
+ def render_value(self, session):
+ return "ring_strict"
+
+ def render_title(self, session):
+ return "Ring Strict"
+
class QueueAdd(QueueForm):
def process_submit(self, session):
queue_name = self.namef.get(session)
durable = self.durable.get(session)
- #exclusive = self.exclusive.get(session)
- autodelete = self.autodelete.get(session)
(errors, form_binding_info) = self.validate(session, queue_name)
if errors:
@@ -358,13 +513,19 @@
queue = Queue()
queue.name = queue_name
queue.durable = (durable == "durable")
- queue.exclusive = False
- queue.autoDelete = (autodelete == "autodel")
reg = self.frame.get_object(session)
- args = {
- "exchange_keys": form_binding_info,
- "reg": reg}
+ args = {}
+ args["reg"] = reg
+ args["exchange_keys"] = form_binding_info
+ args["cluster_durable"] = self.cluster_durable.get(session) == "durable"
+ args["lvq"] = self.lvq.get(session) == "enable"
+ args["optimistic"] = self.optimistic.get(session) == "enable"
+ args["policy"] = self.policy.get(session)
+ args["file_count"] = self.file_count.get(session)
+ args["file_size"] = self.file_size.get(session)
+ args["q_count"] = self.q_count.get(session)
+ args["q_size"] = self.q_size.get(session)
action = self.app.model.broker.add_queue
action.invoke(queue, args)
15 years, 7 months
rhmessaging commits: r2736 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-04 15:00:14 -0500 (Tue, 04 Nov 2008)
New Revision: 2736
Modified:
mgmt/trunk/cumin/python/cumin/exchange.py
Log:
Removing unneeded calls to set_value for radiofield options
Modified: mgmt/trunk/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/exchange.py 2008-11-04 19:59:26 UTC (rev 2735)
+++ mgmt/trunk/cumin/python/cumin/exchange.py 2008-11-04 20:00:14 UTC (rev 2736)
@@ -348,23 +348,18 @@
self.add_parameter(self.type)
self.direct = RadioInput(app, "direct", self.type)
- self.direct.set_value("direct")
self.add_child(self.direct)
self.topic = RadioInput(app, "topic", self.type)
- self.topic.set_value("topic")
self.add_child(self.topic)
self.fanout = RadioInput(app, "fanout", self.type)
- self.fanout.set_value("fanout")
self.add_child(self.fanout)
self.headers = RadioInput(app, "headers", self.type)
- self.headers.set_value("headers")
self.add_child(self.headers)
self.xml = RadioInput(app, "xml", self.type)
- self.xml.set_value("xml")
self.add_child(self.xml)
def render_direct_id(self, session, *args):
15 years, 7 months
rhmessaging commits: r2735 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-04 14:59:26 -0500 (Tue, 04 Nov 2008)
New Revision: 2735
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.py
Log:
Using new general two radiobutton options class for SaveField
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-11-04 19:56:03 UTC (rev 2734)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-11-04 19:59:26 UTC (rev 2735)
@@ -491,7 +491,7 @@
self.host = DictParameter(app, "host")
self.add_parameter(self.host)
- self.durable = SavedField(app, "saved")
+ self.durable = self.SavedField(app, "saved")
self.add_field(self.durable)
self.errors = self.Errors(self, "errors")
@@ -611,6 +611,19 @@
def get_default(self, session):
return dict()
+ class SavedField(TwoOptionRadioField):
+ def __init__(self, app, name, option1="notsaved", option2="saved"):
+ super(BrokerLinkAdd.SavedField, self).__init__(app, name, option1, option2)
+
+ self.option1_title = "No, do not restore if broker restarts"
+ self.option2_title = "Yes, restore if broker restarts"
+
+ def render_title(self, session):
+ return "Restore if broker restarts?"
+
+ def render_field_help(self, session):
+ return "(Should the added configuration be durable)"
+
class BrokerSetClose(CuminBulkActionForm):
def process_return(self, session):
branch = session.branch()
15 years, 7 months
rhmessaging commits: r2734 - in mgmt/trunk/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-04 14:56:03 -0500 (Tue, 04 Nov 2008)
New Revision: 2734
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
mgmt/trunk/cumin/python/wooly/forms.py
mgmt/trunk/cumin/python/wooly/forms.strings
Log:
Moving MoreFieldSet out of wooly and into cumin/widgets
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-11-04 19:38:32 UTC (rev 2733)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-11-04 19:56:03 UTC (rev 2734)
@@ -1098,3 +1098,13 @@
def elem_id(self, session):
return self.name
+
+class MoreFieldSet(FieldForm, FormField):
+ def render_inputs(self, session, *args):
+ return self.render_fields(session, *args)
+
+ def render_more_text(self, session, *args):
+ return "Show Advanced Options..."
+
+ def render_less_text(self, session, *args):
+ return "Hide Advanced Options..."
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-11-04 19:38:32 UTC (rev 2733)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-11-04 19:56:03 UTC (rev 2734)
@@ -992,3 +992,41 @@
[FormHelp.html]
<a class="help action" id="help_link" href="{help_href}">Help</a>
+[MoreFieldSet.css]
+div.more_inputs {
+ display: none;
+ margin-left: 0.5em;
+ padding: 0.5em;
+ border: 1px dashed #333;
+ background-color: #FCFCFC;
+}
+
+div.more_field_set {
+ margin-bottom: 1em;
+}
+
+[MoreFieldSet.html]
+<div class="more_field_set">
+ <input type="button" id="button_{id}" onclick="toggle_more_fieldset(); return false;" value="{more_text}" />
+ <div id="{id}" class="more_inputs" style="display:none;">
+ {inputs}
+ </div>
+</div><!-- end of "more_field_set" -->
+<script type="text/javascript">
+function toggle_more_fieldset() {
+ var oDiv = document.getElementById("{id}");
+ var oButton = document.getElementById("button_{id}");
+ if (oDiv) {
+ if (oDiv.style.display == "none") {
+ oDiv.style.display = "block";
+ if (oButton)
+ oButton.value = "{less_text}";
+ } else {
+ oDiv.style.display = "none"
+ if (oButton)
+ oButton.value = "{more_text}";
+ }
+ }
+}
+</script>
+
\ No newline at end of file
Modified: mgmt/trunk/cumin/python/wooly/forms.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/forms.py 2008-11-04 19:38:32 UTC (rev 2733)
+++ mgmt/trunk/cumin/python/wooly/forms.py 2008-11-04 19:56:03 UTC (rev 2734)
@@ -428,13 +428,3 @@
writer.write(field.render(session))
return writer.to_string()
-
-class MoreFieldSet(FieldForm, FormField):
- def render_inputs(self, session, *args):
- return self.render_fields(session, *args)
-
- def render_more_text(self, session, *args):
- return "Show Advanced Options..."
-
- def render_less_text(self, session, *args):
- return "Hide Advanced Options..."
Modified: mgmt/trunk/cumin/python/wooly/forms.strings
===================================================================
--- mgmt/trunk/cumin/python/wooly/forms.strings 2008-11-04 19:38:32 UTC (rev 2733)
+++ mgmt/trunk/cumin/python/wooly/forms.strings 2008-11-04 19:56:03 UTC (rev 2734)
@@ -83,43 +83,3 @@
tabindex="{tab_index}" {checked_attr} {disabled_attr}/>
<label for="{id}">{title}</label>
</div>
-
-
-[MoreFieldSet.css]
-div.more_inputs {
- display: none;
- margin-left: 0.5em;
- padding: 0.5em;
- border: 1px dashed #333;
- background-color: #FCFCFC;
-}
-
-div.more_field_set {
- margin-bottom: 1em;
-}
-
-[MoreFieldSet.html]
-<div class="more_field_set">
- <input type="button" id="button_{id}" onclick="toggle_more_fieldset(); return false;" value="{more_text}" />
- <div id="{id}" class="more_inputs" style="display:none;">
- {inputs}
- </div>
-</div><!-- end of "more_field_set" -->
-<script type="text/javascript">
-function toggle_more_fieldset() {
- var oDiv = document.getElementById("{id}");
- var oButton = document.getElementById("button_{id}");
- if (oDiv) {
- if (oDiv.style.display == "none") {
- oDiv.style.display = "block";
- if (oButton)
- oButton.value = "{less_text}";
- } else {
- oDiv.style.display = "none"
- if (oButton)
- oButton.value = "{more_text}";
- }
- }
-}
-</script>
-
\ No newline at end of file
15 years, 7 months
rhmessaging commits: r2733 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-04 14:38:32 -0500 (Tue, 04 Nov 2008)
New Revision: 2733
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Removing individual form fields that all have two radio button options and replacing them with a more general class.
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-11-04 19:37:02 UTC (rev 2732)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-11-04 19:38:32 UTC (rev 2733)
@@ -978,105 +978,45 @@
def get_message(self, session):
return "An item with this %s already exists" % self.__field
-class DurabilityField(RadioField):
- def __init__(self, app, name):
- super(DurabilityField, self).__init__(app, name, None)
+class TwoOptionRadioField(RadioField):
+ def __init__(self, app, name, option1="option1", option2="option2"):
+ super(TwoOptionRadioField, self).__init__(app, name, None)
self.param = Parameter(app, "param")
- self.param.default = "durable"
+ self.param.default = option1
self.add_parameter(self.param)
- option = self.Durable(app, "durable", self.param)
- option.set_value(self.param.default)
+ option = self.Option1(app, option1, self.param)
self.add_option(option)
- option = self.Transient(app, "transient", self.param)
- option.set_value("transient")
+ option = self.Option2(app, option2, self.param)
self.add_option(option)
- def render_title(self, session):
- return "Durable?"
-
- class Durable(RadioFieldOption):
- def render_value(self, session):
- return "durable"
-
- def render_title(self, session):
- return "Durable"
-
- class Transient(RadioFieldOption):
- def render_value(self, session):
- return "transient"
-
- def render_title(self, session):
- return "Transient"
-
-class SavedField(RadioField):
- def __init__(self, app, name):
- super(SavedField, self).__init__(app, name, None)
-
- self.param = Parameter(app, "param")
- self.param.default = "notsaved"
- self.add_parameter(self.param)
-
- option = self.Saved(app, "saved", self.param)
- option.set_value("saved")
- self.add_option(option)
+ self.option1_value = option1
+ self.option2_value = option2
+ self.option1_title = option1
+ self.option2_title = option2
- option = self.NotSaved(app, "notsaved", self.param)
- option.set_value("notsaved")
- self.add_option(option)
-
def render_title(self, session):
- return "Restore if broker restarts?"
+ return "Pick an option"
- class Saved(RadioFieldOption):
+ class Option1(RadioFieldOption):
def render_value(self, session):
- return "saved"
+ return self.parent.option1_value
def render_title(self, session):
- return "Yes, restore if broker restarts"
+ return self.parent.option1_title
- class NotSaved(RadioFieldOption):
- def render_value(self, session):
- return "notsaved"
-
- def render_title(self, session):
- return "No, do not restore if broker restarts"
-
-class ExclusivityField(RadioField):
- def __init__(self, app, name):
- super(ExclusivityField, self).__init__(app, name)
-
- self.param = Parameter(app, "param")
- self.param.default = "exclusive"
- self.add_parameter(self.param)
-
- option = self.Exclusive(app, "exclusive")
- option.set_value(self.param.default)
- self.add_option(option)
+ def render_radio_class(self, session):
+ return "class=\"two_options\""
- option = self.NonExclusive(app, "non-exclusive")
- option.set_value("non-exclusive")
- self.add_option(option)
-
- def render_title(self, session):
- return "Exclusive?"
-
- class Exclusive(RadioFieldOption):
+ class Option2(RadioFieldOption):
def render_value(self, session):
- return "exclusive"
+ return self.parent.option2_value
def render_title(self, session):
- return "Exclusive"
+ return self.parent.option2_title
- class NonExclusive(RadioFieldOption):
- def render_value(self, session):
- return "non-exclusive"
-
- def render_title(self, session):
- return "Non-exclusive"
-
class MultiplicityField(RadioField):
def __init__(self, app, name):
super(MultiplicityField, self).__init__(app, name, None)
@@ -1129,39 +1069,6 @@
def render_title(self, session):
return
-class AutoDeleteField(RadioField):
- def __init__(self, app, name):
- super(AutoDeleteField, self).__init__(app, name, None)
-
- self.param = Parameter(app, "param")
- self.param.default = "autodel"
- self.add_parameter(self.param)
-
- option = self.AutoDel(app, "autodel", self.param)
- option.set_value(self.param.default)
- self.add_option(option)
-
- option = self.Preserve(app, "preserve", self.param)
- option.set_value("preserve")
- self.add_option(option)
-
- def render_title(self, session):
- return "Auto-Delete?"
-
- class AutoDel(RadioFieldOption):
- def render_value(self, session):
- return "autodel"
-
- def render_title(self, session):
- return "Auto-Delete"
-
- class Preserve(RadioFieldOption):
- def render_value(self, session):
- return "preserve"
-
- def render_title(self, session):
- return "Preserve"
-
class AjaxField(Widget):
def render_script(self, session):
script = """
15 years, 7 months
rhmessaging commits: r2732 - mgmt/trunk/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-04 14:37:02 -0500 (Tue, 04 Nov 2008)
New Revision: 2732
Modified:
mgmt/trunk/cumin/python/wooly/forms.py
mgmt/trunk/cumin/python/wooly/forms.strings
mgmt/trunk/cumin/python/wooly/parameters.py
Log:
Resurrecting IntegerField class.
Adding MoreFormField and accompanying javascript to show and hide a list of fields on a form.
Modified: mgmt/trunk/cumin/python/wooly/forms.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/forms.py 2008-11-03 18:37:19 UTC (rev 2731)
+++ mgmt/trunk/cumin/python/wooly/forms.py 2008-11-04 19:37:02 UTC (rev 2732)
@@ -208,12 +208,8 @@
def __init__(self, app, name, param):
super(RadioInput, self).__init__(app, name, param)
- self.value = None
+ self.value = name
- # XXX lose this
- def set_value(self, value):
- self.value = value
-
def render_value(self, session, *args):
return self.value
@@ -287,6 +283,9 @@
def do_validate(self, session, errors):
pass
+ def render_field_help(self, session):
+ pass
+
class ScalarField(FormField):
def __init__(self, app, name, input):
super(ScalarField, self).__init__(app, name)
@@ -324,11 +323,22 @@
class IntegerField(ScalarField):
def __init__(self, app, name):
- super(IntegerInputField, self).__init__(app, name, None)
+ super(IntegerField, self).__init__(app, name, None)
- self.input = PasswordInput(app, "input")
+ self.input = IntegerInput(app, "input")
self.add_child(self.input)
+ def do_validate(self, session, errors):
+ val = self.get(session)
+ try:
+ val = int(val)
+ except:
+ if val:
+ error = FormError("A Numeric Value is Expected")
+ errors.append(error)
+ else:
+ self.set(session, self.input.param.get_default(session))
+
# XXX make this use a RadioInputSet instead?
class RadioField(FormField):
def __init__(self, app, name, param):
@@ -418,3 +428,13 @@
writer.write(field.render(session))
return writer.to_string()
+
+class MoreFieldSet(FieldForm, FormField):
+ def render_inputs(self, session, *args):
+ return self.render_fields(session, *args)
+
+ def render_more_text(self, session, *args):
+ return "Show Advanced Options..."
+
+ def render_less_text(self, session, *args):
+ return "Hide Advanced Options..."
Modified: mgmt/trunk/cumin/python/wooly/forms.strings
===================================================================
--- mgmt/trunk/cumin/python/wooly/forms.strings 2008-11-03 18:37:19 UTC (rev 2731)
+++ mgmt/trunk/cumin/python/wooly/forms.strings 2008-11-04 19:37:02 UTC (rev 2732)
@@ -58,8 +58,13 @@
div.field div.title {
font-weight: bold;
font-size: 0.9em;
- margin: 0 0 1em 0;
+ float: left;
+ margin: 0 1em 1em 0;
}
+div.field div.field_help {
+ font-size: 0.9em;
+ color: #222;
+}
div.field div.inputs {
margin: 0 0 1em 1em;
@@ -67,9 +72,9 @@
[FormField.html]
<div class="field">
- <div class="title">{title}</div>
+ <div class="title">{title}</div> <div class="field_help">{field_help}</div><div style="clear:left;"><!-- --></div>
{errors}
- <div class="inputs">{inputs}</div>
+ <div class="inputs">{inputs}</div><div style="clear:left;"><!-- --></div>
</div>
[RadioFieldOption.html]
@@ -78,3 +83,43 @@
tabindex="{tab_index}" {checked_attr} {disabled_attr}/>
<label for="{id}">{title}</label>
</div>
+
+
+[MoreFieldSet.css]
+div.more_inputs {
+ display: none;
+ margin-left: 0.5em;
+ padding: 0.5em;
+ border: 1px dashed #333;
+ background-color: #FCFCFC;
+}
+
+div.more_field_set {
+ margin-bottom: 1em;
+}
+
+[MoreFieldSet.html]
+<div class="more_field_set">
+ <input type="button" id="button_{id}" onclick="toggle_more_fieldset(); return false;" value="{more_text}" />
+ <div id="{id}" class="more_inputs" style="display:none;">
+ {inputs}
+ </div>
+</div><!-- end of "more_field_set" -->
+<script type="text/javascript">
+function toggle_more_fieldset() {
+ var oDiv = document.getElementById("{id}");
+ var oButton = document.getElementById("button_{id}");
+ if (oDiv) {
+ if (oDiv.style.display == "none") {
+ oDiv.style.display = "block";
+ if (oButton)
+ oButton.value = "{less_text}";
+ } else {
+ oDiv.style.display = "none"
+ if (oButton)
+ oButton.value = "{more_text}";
+ }
+ }
+}
+</script>
+
\ No newline at end of file
Modified: mgmt/trunk/cumin/python/wooly/parameters.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/parameters.py 2008-11-03 18:37:19 UTC (rev 2731)
+++ mgmt/trunk/cumin/python/wooly/parameters.py 2008-11-04 19:37:02 UTC (rev 2732)
@@ -78,7 +78,10 @@
class IntegerParameter(Parameter):
def do_unmarshal(self, string):
- return int(string)
+ try:
+ return int(string)
+ except:
+ return string
class BooleanParameter(Parameter):
def __init__(self, model, name):
15 years, 7 months
rhmessaging commits: r2731 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-03 13:37:19 -0500 (Mon, 03 Nov 2008)
New Revision: 2731
Modified:
mgmt/trunk/cumin/python/cumin/slot.py
Log:
Removing extra columns from SlotSet
Modified: mgmt/trunk/cumin/python/cumin/slot.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/slot.py 2008-11-03 14:37:42 UTC (rev 2730)
+++ mgmt/trunk/cumin/python/cumin/slot.py 2008-11-03 18:37:19 UTC (rev 2731)
@@ -18,20 +18,7 @@
col = self.Name(app, "name")
self.add_column(col)
- col = self.Machine(app, "machine")
- self.add_column(col)
-
- col = self.System(app, "system")
- self.add_column(col)
-
class Name(SqlTableColumn):
def render_title(self, session, data):
return "Name"
- class Machine(SqlTableColumn):
- def render_title(self, session, data):
- return "Machine"
-
- class System(SqlTableColumn):
- def render_title(self, session, data):
- return "System"
15 years, 7 months
rhmessaging commits: r2730 - in mgmt/trunk/mint: sql and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-03 09:37:42 -0500 (Mon, 03 Nov 2008)
New Revision: 2730
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/sql/schema.sql
Log:
Changes from the latest mint>make schema
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-11-03 13:43:01 UTC (rev 2729)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-11-03 14:37:42 UTC (rev 2730)
@@ -3,6 +3,12 @@
from datetime import datetime
from qpid.management import objectId
+class Pool(SQLObject):
+ class sqlmeta:
+ lazyUpdate = True
+ sourceId = StringCol(length=1000, default=None, unique=True)
+
+
class Slot(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -152,7 +158,7 @@
Note = StringCol(length=4000, default=None)
Out = StringCol(length=4000, default=None)
Owner = StringCol(length=1000, default=None)
- Juser = StringCol(length=1000, default=None)
+ GridUser = StringCol(length=1000, default=None)
ProcId = IntCol(default=None)
QDate = TimestampCol(default=None)
JobUniverse = IntCol(default=None)
@@ -912,14 +918,6 @@
byteTxnDequeues = BigIntCol(default=None)
bytePersistEnqueues = BigIntCol(default=None)
bytePersistDequeues = BigIntCol(default=None)
- enqueueTxnStarts = BigIntCol(default=None)
- enqueueTxnCommits = BigIntCol(default=None)
- enqueueTxnRejects = BigIntCol(default=None)
- enqueueTxnCount = IntCol(default=None)
- dequeueTxnStarts = BigIntCol(default=None)
- dequeueTxnCommits = BigIntCol(default=None)
- dequeueTxnRejects = BigIntCol(default=None)
- dequeueTxnCount = IntCol(default=None)
consumerCount = IntCol(default=None)
consumerCountLow = IntCol(default=None)
consumerCountHigh = IntCol(default=None)
@@ -954,6 +952,7 @@
name = StringCol(length=1000, default=None)
type = StringCol(length=1000, default=None)
durable = BoolCol(default=None)
+ arguments = PickleCol(default=None)
class ExchangeStats(SQLObject):
@@ -996,6 +995,7 @@
queue = ForeignKey('Queue', cascade='null', default=None)
bindingKey = StringCol(length=1000, default=None)
arguments = PickleCol(default=None)
+ origin = StringCol(length=1000, default=None)
class BindingStats(SQLObject):
@@ -1027,6 +1027,8 @@
address = StringCol(length=1000, default=None)
incoming = BoolCol(default=None)
SystemConnection = BoolCol(default=None)
+ federationLink = BoolCol(default=None)
+ authIdentity = StringCol(length=1000, default=None)
def close(self, model, callback):
@@ -1045,8 +1047,6 @@
clientConnection = ForeignKey('ClientConnection', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
closing = BoolCol(default=None)
- federationLink = BoolCol(default=None)
- authIdentity = StringCol(length=1000, default=None)
framesFromClient = BigIntCol(default=None)
framesToClient = BigIntCol(default=None)
bytesFromClient = BigIntCol(default=None)
@@ -1221,6 +1221,10 @@
session = ForeignKey('Session', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
framesOutstanding = IntCol(default=None)
+ TxnStarts = BigIntCol(default=None)
+ TxnCommits = BigIntCol(default=None)
+ TxnRejects = BigIntCol(default=None)
+ TxnCount = IntCol(default=None)
@@ -1229,7 +1233,8 @@
schemaNameToClassMap = dict()
schemaReservedWordsMap = {"in": "inRsv", "In": "InRsv",
"connection": "clientConnection", "Connection": "ClientConnection",
- "other": "otherRsv"}
+ "connectionRef": "clientConnectionRef",
+ "user": "gridUser", "User": "GridUser"}
classToSchemaNameMap['Slot'] = 'Slot'
schemaNameToClassMap['Slot'] = Slot
Modified: mgmt/trunk/mint/sql/schema.sql
===================================================================
--- mgmt/trunk/mint/sql/schema.sql 2008-11-03 13:43:01 UTC (rev 2729)
+++ mgmt/trunk/mint/sql/schema.sql 2008-11-03 14:37:42 UTC (rev 2730)
@@ -131,7 +131,8 @@
exchange_id INT,
queue_id INT,
binding_key VARCHAR(1000),
- arguments BYTEA
+ arguments BYTEA,
+ origin VARCHAR(1000)
);
CREATE TABLE binding_stats (
@@ -211,7 +212,9 @@
vhost_id INT,
address VARCHAR(1000),
incoming BOOL,
- system_connection BOOL
+ system_connection BOOL,
+ federation_link BOOL,
+ auth_identity VARCHAR(1000)
);
CREATE TABLE client_connection_stats (
@@ -219,8 +222,6 @@
rec_time TIMESTAMP,
client_connection_id INT,
closing BOOL,
- federation_link BOOL,
- auth_identity VARCHAR(1000),
frames_from_client BIGINT,
frames_to_client BIGINT,
bytes_from_client BIGINT,
@@ -289,7 +290,8 @@
vhost_id INT,
name VARCHAR(1000),
type VARCHAR(1000),
- durable BOOL
+ durable BOOL,
+ arguments BYTEA
);
CREATE TABLE exchange_stats (
@@ -337,7 +339,7 @@
note VARCHAR(4000),
out VARCHAR(4000),
owner VARCHAR(1000),
- juser VARCHAR(1000),
+ grid_user VARCHAR(1000),
proc_id INT,
q_date TIMESTAMP,
job_universe INT,
@@ -504,6 +506,11 @@
monitor_self_time TIMESTAMP
);
+CREATE TABLE pool (
+ id SERIAL PRIMARY KEY,
+ source_id VARCHAR(1000) UNIQUE
+);
+
CREATE TABLE queue (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
@@ -540,14 +547,6 @@
byte_txn_dequeues BIGINT,
byte_persist_enqueues BIGINT,
byte_persist_dequeues BIGINT,
- enqueue_txn_starts BIGINT,
- enqueue_txn_commits BIGINT,
- enqueue_txn_rejects BIGINT,
- enqueue_txn_count INT,
- dequeue_txn_starts BIGINT,
- dequeue_txn_commits BIGINT,
- dequeue_txn_rejects BIGINT,
- dequeue_txn_count INT,
consumer_count INT,
consumer_count_low INT,
consumer_count_high INT,
@@ -627,7 +626,11 @@
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
session_id INT,
- frames_outstanding INT
+ frames_outstanding INT,
+ txn_starts BIGINT,
+ txn_commits BIGINT,
+ txn_rejects BIGINT,
+ txn_count INT
);
CREATE TABLE slot (
15 years, 7 months