Author: justi9
Date: 2007-10-10 09:49:24 -0400 (Wed, 10 Oct 2007)
New Revision: 994
Modified:
mgmt/cumin/python/cumin/cluster.py
mgmt/cumin/python/cumin/page.py
Log:
More navigation improvements. Now a vhost and its resources are
(navigationally speaking) contained inside of servers and clustered
servers, if the vhost is not a template vhost.
Modified: mgmt/cumin/python/cumin/cluster.py
===================================================================
--- mgmt/cumin/python/cumin/cluster.py 2007-10-10 13:34:25 UTC (rev 993)
+++ mgmt/cumin/python/cumin/cluster.py 2007-10-10 13:49:24 UTC (rev 994)
@@ -29,7 +29,7 @@
def render_item_link(self, session, server):
branch = session.branch()
- self.page().show_cluster_server(branch, server).show_view(branch)
+ self.page().show_server(branch, server).show_view(branch)
return mlink(branch.marshal(), "Server", server.name)
@@ -54,6 +54,9 @@
self.server = ServerFrame(app, "server")
self.add_child(self.server)
+ self.vhost = VirtualHostFrame(app, "vhost")
+ self.add_child(self.vhost)
+
def set_cluster(self, session, cluster):
self.param.set(session, cluster)
@@ -64,6 +67,10 @@
self.server.set_server(session, server)
return self.show_mode(session, self.server)
+ def show_virtual_host(self, session, vhost):
+ self.vhost.set_virtual_host(session, vhost)
+ return self.show_mode(session, self.vhost)
+
def render_href(self, session, cluster):
branch = session.branch()
self.page().show_cluster(branch, cluster).show_view(branch)
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-10-10 13:34:25 UTC (rev 993)
+++ mgmt/cumin/python/cumin/page.py 2007-10-10 13:49:24 UTC (rev 994)
@@ -37,21 +37,35 @@
self.app.sessions.append(session)
def show_server(self, session, server):
- return self.main.show_server(session, server)
+ cluster = server.get_cluster()
+ if cluster:
+ frame = self.main.show_cluster(session, cluster)
+ frame = frame.show_server(session, server)
+ else:
+ frame = self.main.show_server(session, server)
+
+ return frame
+
def show_server_group(self, session, sgroup):
return self.main.show_server_group(session, sgroup)
def show_cluster(self, session, cluster):
return self.main.show_cluster(session, cluster)
- def show_cluster_server(self, session, server):
- frame = self.main.show_cluster(session, server.get_cluster())
- return frame.show_server(session, server)
-
def show_virtual_host(self, session, vhost):
- return self.main.show_virtual_host(session, vhost)
+ server = vhost.get_server()
+ cluster = vhost.get_cluster()
+ if server:
+ frame = self.show_server(session, server)
+ elif cluster:
+ frame = self.show_cluster(session, cluster)
+ else:
+ frame = self.main
+
+ return frame.show_virtual_host(session, vhost)
+
def show_queue(self, session, queue):
frame = self.show_virtual_host(session, queue.virtual_host)
return frame.show_queue(session, queue)