uhppoted-db-web/views/event-logs.ejs
2025-08-31 22:54:11 -06:00

72 lines
1.4 KiB
Plaintext

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Log Viewer</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f7f7f7;
margin: 0;
padding: 0;
}
.container {
max-width: 900px;
margin: 40px auto;
background: #fff;
padding: 32px;
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 {
padding: 12px 8px;
border-bottom: 1px solid #e0e0e0;
text-align: left;
}
th {
background: #f0f0f0;
color: #444;
}
tr:hover {
background: #f9f9f9;
}
</style>
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = `${wsProtocol}//${location.host}${location.pathname}`;
const ws = new WebSocket(wsUrl);
ws.onmessage = function(event) {
// Handle incoming event log messages
// Example: append to a table or display in the UI
console.log('Event received:', event);
};
ws.onopen = function() {
console.log('WebSocket connection established');
};
ws.onclose = function() {
console.log('WebSocket connection closed');
};
ws.onerror = function(error) {
console.error('WebSocket error:', error);
};
</script>
</head>
<body>
</body>
</html>