168 lines
No EOL
7.4 KiB
HTML
168 lines
No EOL
7.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{{ title if title else 'Network Documentation' }}</title>
|
|
<!-- Bootstrap CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<!-- Tabler Icons -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@2.22.0/tabler-icons.min.css">
|
|
<!-- Font Awesome -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<!-- Google Fonts -->
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
<!-- Custom CSS -->
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/app.css') }}">
|
|
{% block styles %}{% endblock %}
|
|
<script>
|
|
// Check for saved theme preference or respect OS preference
|
|
function initTheme() {
|
|
const storedTheme = localStorage.getItem('theme');
|
|
if (storedTheme) {
|
|
document.documentElement.setAttribute('data-bs-theme', storedTheme);
|
|
} else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
document.documentElement.setAttribute('data-bs-theme', 'dark');
|
|
localStorage.setItem('theme', 'dark');
|
|
}
|
|
}
|
|
|
|
// Run before page load to prevent flash
|
|
initTheme();
|
|
</script>
|
|
</head>
|
|
|
|
<body class="{{ 'auth-page' if not current_user.is_authenticated else '' }}">
|
|
<!-- Notification Area -->
|
|
<div id="notification-area"></div>
|
|
|
|
{% if current_user.is_authenticated %}
|
|
<!-- Sidebar for authenticated users -->
|
|
<aside class="sidebar">
|
|
<div class="sidebar-brand">
|
|
<span class="ti ti-network"></span>
|
|
<span class="sidebar-brand-text">NetDocs</span>
|
|
</div>
|
|
|
|
<div class="sidebar-nav">
|
|
<div class="sidebar-heading">Main</div>
|
|
<a href="{{ url_for('dashboard.dashboard_home') }}"
|
|
class="sidebar-item {{ 'active' if request.endpoint == 'dashboard.dashboard_home' }}">
|
|
<span class="ti ti-dashboard me-2"></span> Dashboard
|
|
</a>
|
|
<a href="{{ url_for('dashboard.server_list') }}"
|
|
class="sidebar-item {{ 'active' if request.endpoint and request.endpoint.startswith('dashboard.server') }}">
|
|
<span class="ti ti-server me-2"></span> Servers
|
|
</a>
|
|
<a href="{{ url_for('ipam.ipam_home') }}"
|
|
class="sidebar-item {{ 'active' if request.endpoint and request.endpoint.startswith('ipam.') }}">
|
|
<span class="ti ti-network me-2"></span> IPAM
|
|
</a>
|
|
|
|
<div class="sidebar-heading">Management</div>
|
|
<a href="{{ url_for('dashboard.server_new') }}" class="sidebar-item">
|
|
<span class="ti ti-plus me-2"></span> Add Server
|
|
</a>
|
|
<a href="{{ url_for('ipam.subnet_new') }}" class="sidebar-item">
|
|
<span class="ti ti-plus me-2"></span> Add Subnet
|
|
</a>
|
|
|
|
<div class="sidebar-heading">User</div>
|
|
<a href="{{ url_for('auth.logout') }}" class="sidebar-item">
|
|
<span class="ti ti-logout me-2"></span> Logout
|
|
</a>
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- Main Content for authenticated users -->
|
|
<div class="main-content">
|
|
<!-- Top Navbar -->
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom mb-4">
|
|
<div class="container-fluid">
|
|
<button class="sidebar-toggler btn btn-outline-secondary d-lg-none me-2">
|
|
<span class="ti ti-menu-2"></span>
|
|
</button>
|
|
|
|
<span class="navbar-brand d-none d-lg-block">
|
|
{{ title if title else 'Network Documentation' }}
|
|
</span>
|
|
|
|
<div class="d-flex align-items-center">
|
|
<div class="dropdown">
|
|
<a href="#" class="d-flex align-items-center text-decoration-none dropdown-toggle"
|
|
id="user-dropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
|
<span class="d-none d-md-inline me-2">{{ current_user.email }}</span>
|
|
<span class="ti ti-user"></span>
|
|
</a>
|
|
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="user-dropdown">
|
|
<li><a class="dropdown-item" href="{{ url_for('auth.logout') }}">Logout</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="ms-auto me-3">
|
|
<button class="btn btn-icon" id="theme-toggle" aria-label="Toggle theme">
|
|
<span class="ti ti-moon theme-icon-light"></span>
|
|
<span class="ti ti-sun theme-icon-dark"></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Flash Messages -->
|
|
<div class="container-fluid mt-3">
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
|
{{ message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
</div>
|
|
{% else %}
|
|
<!-- Simple flash message container for non-authenticated users -->
|
|
<div class="container mt-3">
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
|
{{ message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- ONLY ONE CONTENT BLOCK FOR BOTH AUTHENTICATED AND NON-AUTHENTICATED STATES -->
|
|
<div class="{{ 'py-4' if current_user.is_authenticated else '' }}">
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
|
|
{% if current_user.is_authenticated %}
|
|
</div> <!-- End of main-content div that was opened for authenticated users -->
|
|
{% endif %}
|
|
|
|
<!-- Bootstrap JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<!-- HTMX for dynamic content -->
|
|
<script src="https://unpkg.com/htmx.org@1.9.2"></script>
|
|
<!-- Custom JS -->
|
|
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
|
|
<script>
|
|
// Sidebar toggle for mobile - using modern event listener approach
|
|
const sidebarToggler = document.querySelector('.sidebar-toggler');
|
|
if (sidebarToggler) {
|
|
sidebarToggler.addEventListener('click', () => {
|
|
document.querySelector('.sidebar').classList.toggle('show');
|
|
});
|
|
}
|
|
</script>
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
|
|
</html> |