143 lines
6.4 KiB
HTML
143 lines
6.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}mGuard VPN Manager{% endblock %}</title>
|
|
|
|
<!-- Bootstrap 5 CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<!-- Bootstrap Icons -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.css" rel="stylesheet">
|
|
<!-- Custom CSS -->
|
|
<link href="/static/css/custom.css" rel="stylesheet">
|
|
|
|
<!-- HTMX -->
|
|
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
|
|
|
|
{% block head %}{% endblock %}
|
|
</head>
|
|
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
|
|
{% if current_user %}
|
|
<!-- Navigation -->
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand" href="/dashboard">
|
|
<i class="bi bi-shield-lock"></i> mGuard VPN
|
|
</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav me-auto">
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if request.url.path == '/dashboard' %}active{% endif %}" href="/dashboard">
|
|
<i class="bi bi-speedometer2"></i> Dashboard
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if '/gateways' in request.url.path %}active{% endif %}" href="/gateways">
|
|
<i class="bi bi-router"></i> Gateways
|
|
</a>
|
|
</li>
|
|
{% if current_user.is_admin %}
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle {% if '/vpn-servers' in request.url.path or '/ca' in request.url.path %}active{% endif %}"
|
|
href="#" role="button" data-bs-toggle="dropdown">
|
|
<i class="bi bi-hdd-network"></i> VPN
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<li>
|
|
<a class="dropdown-item" href="/vpn-servers">
|
|
<i class="bi bi-server"></i> VPN-Server
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a class="dropdown-item" href="/ca">
|
|
<i class="bi bi-file-earmark-lock"></i> Zertifizierungsstellen
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
{% endif %}
|
|
{% if current_user.is_admin %}
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if '/users' in request.url.path %}active{% endif %}" href="/users">
|
|
<i class="bi bi-people"></i> Benutzer
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if current_user.is_super_admin %}
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if '/tenants' in request.url.path %}active{% endif %}" href="/tenants">
|
|
<i class="bi bi-building"></i> Mandanten
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if '/applications' in request.url.path %}active{% endif %}" href="/applications">
|
|
<i class="bi bi-app-indicator"></i> Anwendungen
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if '/connections' in request.url.path %}active{% endif %}" href="/connections">
|
|
<i class="bi bi-plug"></i> Verbindungen
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
|
|
<i class="bi bi-person-circle"></i> {{ current_user.username }}
|
|
</a>
|
|
<ul class="dropdown-menu dropdown-menu-end">
|
|
<li><span class="dropdown-item-text text-muted">{{ current_user.role.value }}</span></li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><a class="dropdown-item" href="/logout"><i class="bi bi-box-arrow-right"></i> Logout</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
{% endif %}
|
|
|
|
<!-- Main Content -->
|
|
<main class="{% if current_user %}py-4{% endif %}">
|
|
<div class="container-fluid">
|
|
<!-- Flash Messages -->
|
|
{% if flash_messages %}
|
|
{% for msg in flash_messages %}
|
|
<div class="alert alert-{{ msg.category }} alert-dismissible fade show" role="alert">
|
|
{{ msg.message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
</main>
|
|
|
|
<!-- Footer -->
|
|
{% if current_user %}
|
|
<footer class="footer mt-auto py-3 bg-light">
|
|
<div class="container-fluid">
|
|
<span class="text-muted">mGuard VPN Manager v1.0 |
|
|
<span hx-get="/htmx/connections/count" hx-trigger="load, every 30s" hx-swap="innerHTML">
|
|
<i class="bi bi-hourglass-split"></i>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</footer>
|
|
{% endif %}
|
|
|
|
<!-- Bootstrap 5 JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
<!-- Custom JS -->
|
|
<script src="/static/js/app.js"></script>
|
|
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html>
|