Add configuration, utilities, and update server with enhanced monitoring features
- 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
This commit is contained in:
@@ -10,11 +10,86 @@
|
||||
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;
|
||||
@@ -120,6 +195,33 @@
|
||||
</script>
|
||||
</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">
|
||||
<div class="server-log-header text-center">
|
||||
<h1 class="mb-2">
|
||||
@@ -221,10 +323,16 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p class="text-center mt-4">© 2025 Server Operations Dashboard. All rights reserved.</p>
|
||||
</footer>
|
||||
<script>
|
||||
function toggleSidebar() {
|
||||
document.getElementById('sidebar').classList.toggle('active');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user