[CalendarServer-changes] [15487] CalendarServer/trunk/calendarserver/webadmin

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 30 10:23:17 PDT 2016


Revision: 15487
          http://trac.calendarserver.org//changeset/15487
Author:   sagen at apple.com
Date:     2016-03-30 10:23:17 -0700 (Wed, 30 Mar 2016)
Log Message:
-----------
Fix the webadmin breakage

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/webadmin/config.py
    CalendarServer/trunk/calendarserver/webadmin/landing.py
    CalendarServer/trunk/calendarserver/webadmin/landing.xhtml
    CalendarServer/trunk/calendarserver/webadmin/principals.xhtml
    CalendarServer/trunk/calendarserver/webadmin/principals_edit.xhtml

Modified: CalendarServer/trunk/calendarserver/webadmin/config.py
===================================================================
--- CalendarServer/trunk/calendarserver/webadmin/config.py	2016-03-28 16:17:46 UTC (rev 15486)
+++ CalendarServer/trunk/calendarserver/webadmin/config.py	2016-03-30 17:23:17 UTC (rev 15487)
@@ -95,11 +95,14 @@
                 return html.code(unicode(value))
 
             if isinstance(value, list):
-                result = []
-                for item in value:
-                    result.append(describe(item))
-                    result.append(html.br())
-                result.pop()
+                if len(value) == 0:
+                    result = u"(empty list)"
+                else:
+                    result = []
+                    for item in value:
+                        result.append(describe(item))
+                        result.append(html.br())
+                    result.pop()
 
             else:
                 result = describe(value)

Modified: CalendarServer/trunk/calendarserver/webadmin/landing.py
===================================================================
--- CalendarServer/trunk/calendarserver/webadmin/landing.py	2016-03-28 16:17:46 UTC (rev 15486)
+++ CalendarServer/trunk/calendarserver/webadmin/landing.py	2016-03-30 17:23:17 UTC (rev 15487)
@@ -65,48 +65,48 @@
         # self._root = root
         # self._principalCollections = principalCollections
 
-        # from .config import ConfigurationResource
-        # self.putChild(u"config", ConfigurationResource(configuration, principalCollections))
+        from .config import ConfigurationResource
+        self.putChild(u"config", ConfigurationResource(configuration, principalCollections))
 
-        # from .principals import PrincipalsResource
-        # self.putChild(u"principals", PrincipalsResource(directory, store, principalCollections))
+        from .principals import PrincipalsResource
+        self.putChild(u"principals", PrincipalsResource(directory, store, principalCollections))
 
-        # from .logs import LogsResource
-        # self.putChild(u"logs", LogsResource())
+        from .logs import LogsResource
+        self.putChild(u"logs", LogsResource(principalCollections))
 
         # from .work import WorkMonitorResource
         # self.putChild(u"work", WorkMonitorResource(store))
 
 
-    def getChild(self, name):
-        bound = super(WebAdminLandingResource, self).getChild(name)
+    # def getChild(self, name):
+    #     bound = super(WebAdminLandingResource, self).getChild(name)
 
-        if bound is not None:
-            return bound
+    #     if bound is not None:
+    #         return bound
 
-        #
-        # Dynamically load and vend child resources not bound using putChild()
-        # in __init__().  This is useful for development, since it allows one
-        # to comment out the putChild() call above, and then code will be
-        # re-loaded for each request.
-        #
+    #     #
+    #     # Dynamically load and vend child resources not bound using putChild()
+    #     # in __init__().  This is useful for development, since it allows one
+    #     # to comment out the putChild() call above, and then code will be
+    #     # re-loaded for each request.
+    #     #
 
-        from . import config, principals, logs, work
+    #     from . import config, principals, logs, work
 
-        if name == u"config":
-            reload(config)
-            return config.ConfigurationResource(self.configuration, self._principalCollections)
+    #     if name == u"config":
+    #         reload(config)
+    #         return config.ConfigurationResource(self.configuration, self._principalCollections)
 
-        elif name == u"principals":
-            reload(principals)
-            return principals.PrincipalsResource(self.directory, self.store, self._principalCollections)
+    #     elif name == u"principals":
+    #         reload(principals)
+    #         return principals.PrincipalsResource(self.directory, self.store, self._principalCollections)
 
-        elif name == u"logs":
-            reload(logs)
-            return logs.LogsResource(self._principalCollections)
+    #     elif name == u"logs":
+    #         reload(logs)
+    #         return logs.LogsResource(self._principalCollections)
 
-        elif name == u"work":
-            reload(work)
-            return work.WorkMonitorResource(self.store, self._principalCollections)
+    #     elif name == u"work":
+    #         reload(work)
+    #         return work.WorkMonitorResource(self.store, self._principalCollections)
 
-        return None
+    #     return None

Modified: CalendarServer/trunk/calendarserver/webadmin/landing.xhtml
===================================================================
--- CalendarServer/trunk/calendarserver/webadmin/landing.xhtml	2016-03-28 16:17:46 UTC (rev 15486)
+++ CalendarServer/trunk/calendarserver/webadmin/landing.xhtml	2016-03-30 17:23:17 UTC (rev 15487)
@@ -15,11 +15,6 @@
       <li><a href="principals">Principal Management</a></li>
     </ul>
 
-    <ul>
-      <li><a href="logs">Server Logs</a></li>
-      <li><a href="work">Workload Monitor</a></li>
-    </ul>
-
   </body>
 
 </html>

Modified: CalendarServer/trunk/calendarserver/webadmin/principals.xhtml
===================================================================
--- CalendarServer/trunk/calendarserver/webadmin/principals.xhtml	2016-03-28 16:17:46 UTC (rev 15486)
+++ CalendarServer/trunk/calendarserver/webadmin/principals.xhtml	2016-03-30 17:23:17 UTC (rev 15487)
@@ -39,7 +39,7 @@
       </thead>
       <tbody>
         <tr class="record" t:render="search_results_row">
-          <t:attr name="onclick">window.open("./<t:slot name="uid" />");</t:attr>
+          <t:attr name="onclick">window.open("/admin/principals/<t:slot name="uid" />");</t:attr>
           <td class="record_full_name"><t:slot name="fullNames" /></td>
           <td class="record_type"><t:slot name="recordType" /></td>
           <td class="record_short_name"><t:slot name="shortNames" /></td>

Modified: CalendarServer/trunk/calendarserver/webadmin/principals_edit.xhtml
===================================================================
--- CalendarServer/trunk/calendarserver/webadmin/principals_edit.xhtml	2016-03-28 16:17:46 UTC (rev 15486)
+++ CalendarServer/trunk/calendarserver/webadmin/principals_edit.xhtml	2016-03-30 17:23:17 UTC (rev 15487)
@@ -63,7 +63,7 @@
         </tr>
         <tr>
           <td>Server ID</td>
-          <td><t:slot name="serverID" /></td>
+          <td><t:slot name="serverURI" /></td>
         </tr>
         <!--
         <tr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160330/59584ec8/attachment.html>


More information about the calendarserver-changes mailing list