Author: justi9
Date: 2007-10-16 08:48:21 -0400 (Tue, 16 Oct 2007)
New Revision: 1080
Modified:
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/server.py
mgmt/cumin/python/cumin/server.strings
Log:
Adds a server profiles tab to the main view.
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-10-16 12:29:00 UTC (rev 1079)
+++ mgmt/cumin/python/cumin/page.py 2007-10-16 12:48:21 UTC (rev 1080)
@@ -153,6 +153,7 @@
self.add_tab(self.servers)
self.add_tab(self.ClusterTab(app, "clusters"))
+ self.add_tab(self.ProfileTab(app, "profiles"))
def show_server_group(self, session, group):
mode = self.show_mode(session, self.servers)
@@ -174,3 +175,13 @@
def render_title(self, session, model):
return self.clusters.render_title(session, model)
+
+ class ProfileTab(Widget):
+ def __init__(self, app, name):
+ super(MainView.ProfileTab, self).__init__(app, name)
+
+ self.profiles = ServerProfileSet(app, "profiles")
+ self.add_child(self.profiles)
+
+ def render_title(self, session, model):
+ return "Server Profiles (%i)" % len(model.get_server_profiles())
Modified: mgmt/cumin/python/cumin/server.py
===================================================================
--- mgmt/cumin/python/cumin/server.py 2007-10-16 12:29:00 UTC (rev 1079)
+++ mgmt/cumin/python/cumin/server.py 2007-10-16 12:48:21 UTC (rev 1080)
@@ -94,6 +94,14 @@
def render_none(self, session, group):
return none()
+class ServerProfileSet(ItemSet):
+ def get_items(self, session, model):
+ return csorted(model.get_server_profiles())
+
+ def render_item_link(self, session, profile):
+ branch = session.branch()
+ return mlink(branch.marshal(), "ServerProfile", profile.name)
+
class ServerConfigPropertySet(ItemSet):
def get_items(self, session, server):
return csorted(server.config_property_items())
Modified: mgmt/cumin/python/cumin/server.strings
===================================================================
--- mgmt/cumin/python/cumin/server.strings 2007-10-16 12:29:00 UTC (rev 1079)
+++ mgmt/cumin/python/cumin/server.strings 2007-10-16 12:48:21 UTC (rev 1080)
@@ -5,7 +5,8 @@
<th>Cluster</th>
<th>Status</th>
</tr>
-{items}
+
+ {items}
</table>
[ServerSet.item_html]
@@ -15,6 +16,20 @@
<td>0 errors, 0 warnings</td>
</tr>
+[ServerProfileSet.html]
+<table class="ServerProfileSet mobjects">
+ <tr>
+ <th>Server Profile</th>
+ </tr>
+
+ {items}
+</table>
+
+[ServerProfileSet.item_html]
+<tr>
+ <td>{item_link}</td>
+</tr>
+
[ServerConfigPropertySet.html]
<ul class="actions">
<li><a href="">Apply Configuration to This
Server</a></li>