Author: justi9
Date: 2007-10-16 12:03:14 -0400 (Tue, 16 Oct 2007)
New Revision: 1087
Modified:
mgmt/cumin/python/cumin/server.py
mgmt/cumin/python/cumin/server.strings
Log:
Adds the profile value to the server config properties.
Modified: mgmt/cumin/python/cumin/server.py
===================================================================
--- mgmt/cumin/python/cumin/server.py 2007-10-16 15:39:36 UTC (rev 1086)
+++ mgmt/cumin/python/cumin/server.py 2007-10-16 16:03:14 UTC (rev 1087)
@@ -170,6 +170,17 @@
def render_title(self, session, prop):
return "Edit Property '%s'" % prop.name
+def get_profile_value(prop):
+ profile = prop.get_server().get_server_profile()
+ value = None
+
+ if profile:
+ for p in profile.config_property_items():
+ if p.name == prop.name:
+ value = p.value
+
+ return value
+
class ServerView(Widget):
def __init__(self, app, name):
super(ServerView, self).__init__(app, name)
@@ -214,6 +225,9 @@
def get_items(self, session, server):
return sorted_by(server.config_property_items())
+ def render_item_profile_value(self, session, prop):
+ return get_profile_value(prop)
+
def render_item_edit_href(self, session, prop):
branch = session.branch()
frame = self.page().show_server(branch, prop.get_server())
@@ -420,8 +434,8 @@
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
+ self.tabs.add_tab(self.ProfileConfigTab(app, "config"))
self.tabs.add_tab(self.ProfileServerTab(app, "servers"))
- self.tabs.add_tab(self.ProfileConfigTab(app, "config"))
def render_title(self, session, profile):
return "Server Profile '%s'" % profile.name
@@ -429,6 +443,13 @@
def render_name(self, session, profile):
return profile.name
+ class ProfileConfigTab(ConfigPropertySet):
+ def get_items(self, session, profile):
+ return sorted_by(profile.config_property_items())
+
+ def render_title(self, session, profile):
+ return "Configuration"
+
class ProfileServerTab(ServerSet):
def __init__(self, app, name):
super(ServerProfileView.ProfileServerTab, self).__init__(app, name)
@@ -438,10 +459,3 @@
def get_items(self, session, profile):
return sorted_by(profile.server_items())
-
- class ProfileConfigTab(ConfigPropertySet):
- def get_items(self, session, profile):
- return sorted_by(profile.config_property_items())
-
- def render_title(self, session, profile):
- return "Configuration"
Modified: mgmt/cumin/python/cumin/server.strings
===================================================================
--- mgmt/cumin/python/cumin/server.strings 2007-10-16 15:39:36 UTC (rev 1086)
+++ mgmt/cumin/python/cumin/server.strings 2007-10-16 16:03:14 UTC (rev 1087)
@@ -53,7 +53,7 @@
<td>{item_name}</td>
<td>{item_value}</td>
<td></td>
- <td></td>
+ <td>{item_profile_value}</td>
<td><a class="action"
href="{item_edit_href}">Edit</a></td>
</tr>