This commit is contained in:
Christopher Cookman 2025-08-31 23:10:09 -06:00
parent 8888e7e75e
commit 07a6f3664e

View file

@ -50,7 +50,7 @@
ws.onmessage = function(event) { ws.onmessage = function(event) {
// Handle incoming event log messages // Handle incoming event log messages
// Example: append to a table or display in the UI // Example: append to a table or display in the UI
console.log('Event received:', event); console.log('Event received:', event.data);
}; };
ws.onopen = function() { ws.onopen = function() {
@ -67,6 +67,38 @@
</script> </script>
</head> </head>
<body> <body>
<div class="container">
<h1>Event Log Viewer</h1>
<table>
<thead>
<tr>
<th>Controller</th>
<th>Event Index</th>
<th>Timestamp</th>
<th>Type</th>
<th>Granted</th>
<th>Door</th>
<th>Direction</th>
<th>Card Number</th>
<th>Reason</th>
</tr>
</thead>
<tbody>
<% logs.forEach(function(log) { %>
<tr>
<td><%= log.Controller %></td>
<td><%= log.EventIndex %></td>
<td><%= log.Timestamp %></td>
<td><%= log.Type %></td>
<td><%= log.Granted %></td>
<td><%= log.Door %></td>
<td><%= log.Direction %></td>
<td><%= log.CardNumber %></td>
<td><%= log.Reason %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
</body> </body>
</html> </html>