Test
This commit is contained in:
parent
78cdf093ef
commit
0c672e717a
|
@ -1,5 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
@ -11,6 +12,7 @@
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
/* max-width: 900px; */
|
||||
margin: 40px auto;
|
||||
|
@ -19,25 +21,31 @@
|
|||
border-radius: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
margin-bottom: 32px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
th, td {
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: 12px 8px;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th {
|
||||
background: #f0f0f0;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
tr:hover {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
@ -76,7 +84,9 @@
|
|||
<td>${log.EventIndex}</td>
|
||||
<td>${formattedDate}</td>
|
||||
<td>${eventTypes[log.Type] || log.Type}</td>
|
||||
<td>${log.Granted ? "True" : "False"}</td>
|
||||
<td style="${log.Type === 1 ? `background:${log.Granted ? '#c8f7c5' : '#f7c5c5'};` : ''}">
|
||||
${log.Granted ? "True" : "False"}
|
||||
</td>
|
||||
<td>${log.Door}</td>
|
||||
<td>${directions[log.Direction] || log.Direction}</td>
|
||||
<td>${log.CardNumber}</td>
|
||||
|
@ -98,6 +108,7 @@
|
|||
};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Event Log Viewer</h1>
|
||||
|
@ -118,12 +129,14 @@
|
|||
<tbody>
|
||||
<% logs.forEach(function(log) { %>
|
||||
<tr>
|
||||
<td><%= log.Controller %></td>
|
||||
<td><%= log.EventIndex %></td>
|
||||
<td>
|
||||
<%
|
||||
const date = new Date(log.Timestamp);
|
||||
const pad = n => n.toString().padStart(2, '0');
|
||||
<%= log.Controller %>
|
||||
</td>
|
||||
<td>
|
||||
<%= log.EventIndex %>
|
||||
</td>
|
||||
<td>
|
||||
<% const date=new Date(log.Timestamp); const pad=n=> n.toString().padStart(2, '0');
|
||||
const yyyy = date.getFullYear();
|
||||
const mm = pad(date.getMonth() + 1);
|
||||
const dd = pad(date.getDate());
|
||||
|
@ -135,16 +148,29 @@
|
|||
%>
|
||||
<%= `${yyyy}-${mm}-${dd} ${HH}:${MM}:${ss} ${tz}` %>
|
||||
</td>
|
||||
<td><%= dataTypes.EventType[log.Type] %></td>
|
||||
<td><%= log.Granted ? "True" : "False" %></td>
|
||||
<td><%= log.Door %></td>
|
||||
<td><%= dataTypes.Direction[log.Direction] %></td>
|
||||
<td><%= log.CardNumber %></td>
|
||||
<td><%= dataTypes.EventReason[log.Reason] %></td>
|
||||
<td>
|
||||
<%= dataTypes.EventType[log.Type] %>
|
||||
</td>
|
||||
<td style="<%= log.Type === 1 ? `background:${log.Granted ? '#c8f7c5' : '#f7c5c5'};` : '' %>">
|
||||
<%= log.Granted ? "True" : "False" %>
|
||||
</td>
|
||||
<td>
|
||||
<%= log.Door %>
|
||||
</td>
|
||||
<td>
|
||||
<%= dataTypes.Direction[log.Direction] %>
|
||||
</td>
|
||||
<td>
|
||||
<%= log.CardNumber %>
|
||||
</td>
|
||||
<td>
|
||||
<%= dataTypes.EventReason[log.Reason] %>
|
||||
</td>
|
||||
</tr>
|
||||
<% }); %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue