first commit

This commit is contained in:
Stefan Hacker
2026-02-02 09:46:35 +01:00
commit 6901dc369b
98 changed files with 13030 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
{% extends "base.html" %}
{% block title %}{% if tenant %}Mandant bearbeiten{% else %}Neuer Mandant{% endif %} - mGuard VPN{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h4 class="mb-0">
<i class="bi bi-building"></i>
{% if tenant %}Mandant bearbeiten{% else %}Neuer Mandant{% endif %}
</h4>
</div>
<div class="card-body">
<form method="post" action="{% if tenant %}/tenants/{{ tenant.id }}/edit{% else %}/tenants/new{% endif %}">
<div class="mb-3">
<label for="name" class="form-label">Name *</label>
<input type="text" class="form-control" id="name" name="name"
value="{{ tenant.name if tenant else '' }}" required>
</div>
<div class="mb-3">
<label for="description" class="form-label">Beschreibung</label>
<textarea class="form-control" id="description" name="description" rows="3">{{ tenant.description if tenant and tenant.description else '' }}</textarea>
</div>
{% if tenant %}
<div class="mb-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="is_active" name="is_active" value="true"
{% if tenant.is_active %}checked{% endif %}>
<label class="form-check-label" for="is_active">Aktiv</label>
</div>
</div>
{% endif %}
<div class="d-flex justify-content-between">
<a href="/tenants" class="btn btn-secondary">
<i class="bi bi-arrow-left"></i> Abbrechen
</a>
<button type="submit" class="btn btn-primary">
<i class="bi bi-check-lg"></i> Speichern
</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}
+63
View File
@@ -0,0 +1,63 @@
{% extends "base.html" %}
{% block title %}Mandanten - mGuard VPN{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h1><i class="bi bi-building"></i> Mandanten</h1>
<a href="/tenants/new" class="btn btn-primary">
<i class="bi bi-plus-lg"></i> Neuer Mandant
</a>
</div>
<div class="card">
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th>Name</th>
<th>Beschreibung</th>
<th>Benutzer</th>
<th>Gateways</th>
<th>Status</th>
<th>Erstellt</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
{% for tenant in tenants %}
<tr>
<td><strong>{{ tenant.name }}</strong></td>
<td>{{ tenant.description or '-' }}</td>
<td>{{ tenant.users|length }}</td>
<td>{{ tenant.gateways|length }}</td>
<td>
{% if tenant.is_active %}
<span class="badge bg-success">Aktiv</span>
{% else %}
<span class="badge bg-secondary">Inaktiv</span>
{% endif %}
</td>
<td>{{ tenant.created_at.strftime('%d.%m.%Y') }}</td>
<td>
<a href="/tenants/{{ tenant.id }}/edit" class="btn btn-sm btn-outline-primary">
<i class="bi bi-pencil"></i>
</a>
<form action="/tenants/{{ tenant.id }}/delete" method="post" class="d-inline"
onsubmit="return confirm('Mandant wirklich löschen?');">
<button type="submit" class="btn btn-sm btn-outline-danger">
<i class="bi bi-trash"></i>
</button>
</form>
</td>
</tr>
{% else %}
<tr>
<td colspan="7" class="text-center text-muted">Keine Mandanten vorhanden</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}