[rhmessaging-commits] rhmessaging commits: r1091 - mgmt/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Oct 16 13:32:06 EDT 2007


Author: justi9
Date: 2007-10-16 13:32:06 -0400 (Tue, 16 Oct 2007)
New Revision: 1091

Modified:
   mgmt/cumin/python/cumin/server.py
   mgmt/cumin/python/cumin/server.strings
Log:
Adds diff highlighting to the server config tab.



Modified: mgmt/cumin/python/cumin/server.py
===================================================================
--- mgmt/cumin/python/cumin/server.py	2007-10-16 17:12:57 UTC (rev 1090)
+++ mgmt/cumin/python/cumin/server.py	2007-10-16 17:32:06 UTC (rev 1091)
@@ -106,7 +106,7 @@
     def do_marshal(self, prop):
         return str(prop.id)
 
-class ServerConfigPropertyForm(CuminForm):
+class ServerConfigPropertyForm(CuminForm, Frame):
     def __init__(self, app, name):
         super(ServerConfigPropertyForm, self).__init__(app, name)
 
@@ -244,11 +244,21 @@
         def get_items(self, session, server):
             return sorted_by(server.config_property_items())
 
+        def maybe_highlight(self, value, comparedto):
+            print type(value), type(comparedto)
+
+            if value != comparedto:
+                value = "<span class=\"ServerConfigTab diff\">%s</span>" \
+                        % value
+
+            return value
+
         def render_item_server_value(self, session, prop):
-            return prop.server_value
+            return self.maybe_highlight(prop.server_value, prop.value)
 
         def render_item_profile_value(self, session, prop):
-            return get_profile_value(prop)
+            value = get_profile_value(prop)
+            return self.maybe_highlight(value, prop.value)
 
         def render_item_edit_href(self, session, prop):
             branch = session.branch()

Modified: mgmt/cumin/python/cumin/server.strings
===================================================================
--- mgmt/cumin/python/cumin/server.strings	2007-10-16 17:12:57 UTC (rev 1090)
+++ mgmt/cumin/python/cumin/server.strings	2007-10-16 17:32:06 UTC (rev 1091)
@@ -30,6 +30,11 @@
   <td>{item_link}</td>
 </tr>
 
+[ServerConfigTab.css]
+.ServerConfigTab.diff {
+  background-color: #ff9;
+}
+
 [ServerConfigTab.html]
 <ul class="actions">
   <li><a href="">Apply Configuration to Server</a></li>
@@ -75,7 +80,7 @@
         <div class="value">{profile_value}</div>
       </div>
       <div class="field">
-        {server} Use the actual value currently set on the server
+        {server} Use the value currently set on the server
         <div class="value">{server_value}</div>
       </div>
       <div class="field">




More information about the rhmessaging-commits mailing list