Author: justi9
Date: 2007-10-12 17:03:35 -0400 (Fri, 12 Oct 2007)
New Revision: 1030
Modified:
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/virtualhost.py
mgmt/cumin/python/cumin/virtualhost.strings
Log:
Removes the vhost template stuff for now. Adds a config tab to the
vhost view.
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-10-12 20:44:01 UTC (rev 1029)
+++ mgmt/cumin/python/cumin/page.py 2007-10-12 21:03:35 UTC (rev 1030)
@@ -3,7 +3,6 @@
from wooly.widgets import *
from wooly.resources import *
-from virtualhost import *
from server import *
from cluster import *
from widgets import *
@@ -115,9 +114,6 @@
self.view = MainView(app, "view")
self.add_child(self.view)
- self.vhost = VirtualHostTemplateFrame(app, "vhost")
- self.add_child(self.vhost)
-
self.server = ServerFrame(app, "server")
self.add_child(self.server)
Modified: mgmt/cumin/python/cumin/virtualhost.py
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.py 2007-10-12 20:44:01 UTC (rev 1029)
+++ mgmt/cumin/python/cumin/virtualhost.py 2007-10-12 21:03:35 UTC (rev 1030)
@@ -21,11 +21,6 @@
return mlink(branch.marshal(), "VirtualHost", vhost.name)
-class VirtualHostGroupTree(ItemTree):
- def render_title(self, session, model):
- return "Groups (%i)" \
- % len(model.get_virtual_host_groups())
-
class VirtualHostParameter(Parameter):
def do_unmarshal(self, string):
return self.app.model.get_virtual_host(int(string))
@@ -33,9 +28,9 @@
def do_marshal(self, vhost):
return str(vhost.id)
-class BaseVirtualHostFrame(CuminFrame):
+class VirtualHostFrame(CuminFrame):
def __init__(self, app, name):
- super(BaseVirtualHostFrame, self).__init__(app, name)
+ super(VirtualHostFrame, self).__init__(app, name)
self.param = VirtualHostParameter(app, "id")
self.add_parameter(self.param)
@@ -47,60 +42,26 @@
self.exchange = ExchangeFrame(app, "exchange")
self.add_child(self.exchange)
+ self.view = VirtualHostView(app, "view")
+ self.add_child(self.view)
+
def set_virtual_host(self, session, vhost):
return self.param.set(session, vhost)
+ def show_view(self, session):
+ return self.show_mode(session, self.view)
+
def show_queue(self, session, queue):
self.queue.set_queue(session, queue)
-
return self.show_mode(session, self.queue)
def show_exchange(self, session, exchange):
self.exchange.set_exchange(session, exchange)
-
return self.show_mode(session, self.exchange)
-class VirtualHostFrame(BaseVirtualHostFrame):
- def __init__(self, app, name):
- super(VirtualHostFrame, self).__init__(app, name)
-
- self.view = VirtualHostView(app, "view")
- self.add_child(self.view)
-
- def set_virtual_host(self, session, vhost):
- return self.param.set(session, vhost)
-
- def show_view(self, session):
- return self.show_mode(session, self.view)
-
def render_title(self, session, vhost):
return "Functional Host '%s'" % vhost.name
-class VirtualHostTemplateFrame(BaseVirtualHostFrame):
- def __init__(self, app, name):
- super(VirtualHostTemplateFrame, self).__init__(app, name)
-
- self.view = VirtualHostTemplateView(app, "view")
- self.add_child(self.view)
-
- self.queue_add = QueueAdd(app, "queue_add")
- self.add_child(self.queue_add)
-
- self.exchange_add = ExchangeAdd(app, "exchange_add")
- self.add_child(self.exchange_add)
-
- def show_view(self, session):
- return self.show_mode(session, self.view)
-
- def show_queue_add(self, session):
- return self.show_mode(session, self.queue_add)
-
- def show_exchange_add(self, session):
- return self.show_mode(session, self.exchange_add)
-
- def render_title(self, session, vhost):
- return "Host Template '%s'" % vhost.name
-
class VirtualHostView(Widget):
def __init__(self, app, name):
super(VirtualHostView, self).__init__(app, name)
@@ -108,15 +69,11 @@
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
- self.queues = QueueSet(app, "queues")
- self.tabs.add_child(self.queues)
+ self.tabs.add_child(QueueSet(app, "queues"))
+ self.tabs.add_child(ExchangeSet(app, "exchanges"))
+ self.tabs.add_child(self.ConfigTab(app, "config"))
+ self.tabs.add_child(self.LogTab(app, "log"))
- self.exchanges = ExchangeSet(app, "exchanges")
- self.tabs.add_child(self.exchanges)
-
- self.log = self.VirtualHostLog(app, "log")
- self.tabs.add_child(self.log)
-
def render_title(self, session, vhost):
return "Functional Host '%s'" % vhost.name
@@ -145,66 +102,10 @@
else:
return none()
- class VirtualHostLog(Widget):
+ class ConfigTab(Widget):
def render_title(self, session, vhost):
- return "Log Messages"
+ return "Configuration"
-class VirtualHostTemplateView(Widget):
- def __init__(self, app, name):
- super(VirtualHostTemplateView, self).__init__(app, name)
-
- self.tabs = TabSet(app, "tabs")
- self.add_child(self.tabs)
-
- self.queues = self.QueueTab(app, "queues")
- self.tabs.add_child(self.queues)
-
- self.exchanges = self.ExchangeTab(app, "exchanges")
- self.tabs.add_child(self.exchanges)
-
- def render_title(self, session, vhost):
- return "Host Template '%s'" % vhost.name
-
- def render_name(self, session, vhost):
- return vhost.name
-
- def render_add_queue_href(self, session, vhost):
- branch = session.branch()
- self.page().show_virtual_host(branch, vhost).show_queue_add(branch)
- return branch.marshal()
-
- def render_add_exchange_href(self, session, vhost):
- branch = session.branch()
- self.page().show_virtual_host(branch, vhost).show_exchange_add(branch)
- return branch.marshal()
-
- class QueueTab(Widget):
- def __init__(self, app, name):
- super(VirtualHostTemplateView.QueueTab, self).__init__(app, name)
-
- self.queues = QueueSet(app, "queues")
- self.add_child(self.queues)
-
+ class LogTab(Widget):
def render_title(self, session, vhost):
- return self.queues.render_title(session, vhost)
-
- def render_add_queue_href(self, session, vhost):
- branch = session.branch()
- self.page().show_virtual_host(branch, vhost).show_queue_add(branch)
- return branch.marshal()
-
- class ExchangeTab(Widget):
- def __init__(self, app, name):
- super(VirtualHostTemplateView.ExchangeTab, self).__init__(app, name)
-
- self.exchanges = ExchangeSet(app, "exchanges")
- self.add_child(self.exchanges)
-
- def render_title(self, session, vhost):
- return self.exchanges.render_title(session, vhost)
-
- def render_add_exchange_href(self, session, vhost):
- branch = session.branch()
- frame = self.page().show_virtual_host(branch, vhost)
- frame.show_exchange_add(branch)
- return branch.marshal()
+ return "Log Messages"
Modified: mgmt/cumin/python/cumin/virtualhost.strings
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.strings 2007-10-12 20:44:01 UTC (rev 1029)
+++ mgmt/cumin/python/cumin/virtualhost.strings 2007-10-12 21:03:35 UTC (rev 1030)
@@ -27,32 +27,3 @@
{tabs}
</div>
-
-[VirtualHostTemplateView.html]
-<div class="oblock">
- <h1>{title}</h1>
-
- <dl class="properties">
- <dt>Name</dt><dd>{name}</dd>
- </dl>
-
- <ul class="actions">
- <li><a href="">Remove This Template</a></li>
- </ul>
-
- {tabs}
-</div>
-
-[QueueTab.html]
-<ul class="actions">
- <li><a href="{add_queue_href}">Add Queue</a></li>
-</ul>
-
-{queues}
-
-[ExchangeTab.html]
-<ul class="actions">
- <li><a href="{add_exchange_href}">Add
Exchange</a></li>
-</ul>
-
-{exchanges}