- Add config.py for environment configuration management - Add utils.py with utility functions - Add .env.example for environment variable reference - Add routes_example.py as route reference - Add login.html template for authentication - Update server.py with enhancements - Update all dashboard and log templates - Move documentation to 'explanations and old code' directory - Update database schema
195 lines
6.7 KiB
HTML
195 lines
6.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Logs for Hostname: {{ hostname }}</title>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
|
<style>
|
|
body {
|
|
background-color: #f8f9fa;
|
|
font-family: Arial, sans-serif;
|
|
display: flex;
|
|
}
|
|
.sidebar {
|
|
width: 250px;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
padding: 20px;
|
|
height: calc(100vh - 56px);
|
|
position: fixed;
|
|
top: 56px;
|
|
left: -250px;
|
|
transition: left 0.3s ease;
|
|
overflow-y: auto;
|
|
z-index: 1000;
|
|
}
|
|
.sidebar.active {
|
|
left: 0;
|
|
}
|
|
.sidebar-header {
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
margin-bottom: 20px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
.sidebar-content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
.sidebar-btn {
|
|
background-color: rgba(255,255,255,0.2);
|
|
color: white;
|
|
border: none;
|
|
padding: 10px 15px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
text-align: left;
|
|
transition: background-color 0.3s;
|
|
font-size: 13px;
|
|
text-decoration: none;
|
|
display: block;
|
|
}
|
|
.sidebar-btn:hover {
|
|
background-color: rgba(255,255,255,0.4);
|
|
color: white;
|
|
}
|
|
.toggle-btn {
|
|
position: fixed;
|
|
left: 20px;
|
|
top: 20px;
|
|
background-color: #667eea;
|
|
color: white;
|
|
border: none;
|
|
padding: 10px 15px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
z-index: 1001;
|
|
font-size: 18px;
|
|
}
|
|
.main-content {
|
|
margin-left: 0;
|
|
width: 100%;
|
|
transition: margin-left 0.3s ease;
|
|
padding-top: 60px;
|
|
padding-left: 20px;
|
|
padding-right: 20px;
|
|
max-width: 100%;
|
|
overflow-x: hidden;
|
|
}
|
|
h1 {
|
|
text-align: center;
|
|
color: #343a40;
|
|
}
|
|
.container {
|
|
max-width: 1200px;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
.table-container {
|
|
background-color: #ffffff;
|
|
border-radius: 8px;
|
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
padding: 20px;
|
|
}
|
|
.table {
|
|
margin-bottom: 0;
|
|
table-layout: fixed; /* Ensures consistent column widths */
|
|
width: 100%; /* Makes the table take up the full container width */
|
|
}
|
|
.table th, .table td {
|
|
text-align: center;
|
|
word-wrap: break-word; /* Ensures long text wraps within the cell */
|
|
}
|
|
.table th:nth-child(1), .table td:nth-child(1) {
|
|
width: 25%; /* Device ID column */
|
|
}
|
|
.table th:nth-child(2), .table td:nth-child(2) {
|
|
width: 25%; /* Nume Masa column */
|
|
}
|
|
.table th:nth-child(3), .table td:nth-child(3) {
|
|
width: 25%; /* Timestamp column */
|
|
}
|
|
.table th:nth-child(4), .table td:nth-child(4) {
|
|
width: 25%; /* Event Description column */
|
|
}
|
|
.back-button {
|
|
margin-bottom: 20px;
|
|
text-align: center;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<!-- User Header -->
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" style="position: fixed; top: 0; width: 100%; z-index: 999;">
|
|
<div class="container-fluid">
|
|
<button class="toggle-btn" onclick="toggleSidebar()"><i class="fas fa-chevron-right"></i></button>
|
|
<span class="navbar-brand" style="margin-left: 40px;">🖥️ Server Monitoring</span>
|
|
<div class="ms-auto d-flex align-items-center gap-3">
|
|
<span class="text-white">Welcome, <strong>{{ current_user.username }}</strong></span>
|
|
<a href="/logout" class="btn btn-sm btn-danger">Logout</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Sidebar -->
|
|
<div class="sidebar" id="sidebar">
|
|
<div class="sidebar-header">
|
|
Quick Actions
|
|
<button onclick="toggleSidebar()" style="background: none; border: none; color: white; font-size: 20px; cursor: pointer;">×</button>
|
|
</div>
|
|
<div class="sidebar-content">
|
|
<a href="/dashboard" class="sidebar-btn"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
|
|
<a href="/unique_devices" class="sidebar-btn"><i class="fas fa-laptop"></i> Unique Devices</a>
|
|
<a href="/device_management" class="sidebar-btn"><i class="fas fa-tools"></i> Device Management</a>
|
|
<a href="/server_logs" class="sidebar-btn"><i class="fas fa-server"></i> Server Logs</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="main-content">
|
|
<div class="container mt-5">
|
|
<h1 class="mb-4">Logs for Hostname: {{ hostname }}</h1>
|
|
<div class="table-container">
|
|
<table class="table table-striped table-bordered">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>Device ID</th>
|
|
<th>Nume Masa</th>
|
|
<th>Timestamp</th>
|
|
<th>Event Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% if logs %}
|
|
{% for log in logs %}
|
|
<tr>
|
|
<td>{{ log[0] }}</td>
|
|
<td>{{ log[1] }}</td>
|
|
<td>{{ log[2] }}</td>
|
|
<td>{{ log[3] }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="4">No logs found for this hostname.</td>
|
|
</tr>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<footer>
|
|
<p class="text-center mt-4">© 2023 Device Logs Dashboard. All rights reserved.</p>
|
|
</footer>
|
|
<script>
|
|
function toggleSidebar() {
|
|
document.getElementById('sidebar').classList.toggle('active');
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |