[CalendarServer-changes] [12626] CalendarServer/trunk/calendarserver/webadmin/logs.xhtml

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:22:43 PDT 2014


Revision: 12626
          http://trac.calendarserver.org//changeset/12626
Author:   wsanchez at apple.com
Date:     2014-02-09 13:54:32 -0800 (Sun, 09 Feb 2014)
Log Message:
-----------
Start wiring up an event source

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/webadmin/logs.xhtml

Modified: CalendarServer/trunk/calendarserver/webadmin/logs.xhtml
===================================================================
--- CalendarServer/trunk/calendarserver/webadmin/logs.xhtml	2014-02-08 23:05:59 UTC (rev 12625)
+++ CalendarServer/trunk/calendarserver/webadmin/logs.xhtml	2014-02-09 21:54:32 UTC (rev 12626)
@@ -4,14 +4,47 @@
   <head>
     <title><t:slot name="title" /></title>
     <link t:render="stylesheet" />
+
+    <script type="text/javascript">
+
+      window.onload = function() {
+          var eventSource = new EventSource("log_events");
+
+          var accessStatusElement = document.getElementById("access-log-status");
+          var accessLogElement = document.getElementById("access-log");
+
+          accessStatusElement.innerHTML = "Connecting...";
+
+          eventSource.onerror = function() {
+              accessStatusElement.innerHTML = "Connection error.";
+          };
+
+          eventSource.onopen = function() {
+              accessStatusElement.innerHTML = "Connected.";
+          };
+
+          eventSource.onmessage = function(event) {
+              accessLogElement.innerHTML += event.data + "<br />";
+          };
+      }
+
+    </script>
   </head>
 
   <body>
 
     <h1><t:slot name="title" /></h1>
 
-    <p>...</p>
+    <h2>Access Log</h2>
 
+    <div id="access-log-status" />
+    <div id="access-log" />
+
+    <h2>Server Log</h2>
+
+    <div id="server-log-status" />
+    <div id="server-log" />
+
   </body>
 
 </html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/c0beea07/attachment.html>


More information about the calendarserver-changes mailing list