webcrawler v1.0
This commit is contained in:
parent
008e2bc274
commit
6b057fb941
19 changed files with 814 additions and 112 deletions
50
app/templates/admin_panel.html
Normal file
50
app/templates/admin_panel.html
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="admin-panel">
|
||||
<h2>Benutzerverwaltung</h2>
|
||||
|
||||
<!-- Tabelle für Benutzerverwaltung -->
|
||||
<table class="user-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Benutzername</th>
|
||||
<th>Admin</th>
|
||||
<th>Aktionen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td>{{ user.id }}</td>
|
||||
<td>{{ user.username }}</td>
|
||||
<td>{{ 'Ja' if user.is_admin else 'Nein' }}</td>
|
||||
<td>
|
||||
<form action="{{ url_for('auth.reset_password', user_id=user.id) }}" method="post" style="display:inline;">
|
||||
<input type="text" name="new_password" placeholder="Neues Passwort" required>
|
||||
<button type="submit" class="reset-btn">Passwort zurücksetzen</button>
|
||||
</form>
|
||||
{% if not user.is_admin %}
|
||||
<form action="{{ url_for('auth.delete_user', user_id=user.id) }}" method="post" style="display:inline;">
|
||||
<button type="submit" class="delete-btn">Benutzer löschen</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Formular zum Erstellen neuer Benutzer -->
|
||||
<h3>Neuen Benutzer erstellen</h3>
|
||||
<form action="{{ url_for('auth.create_user') }}" method="post" class="create-user-form">
|
||||
<input type="text" name="username" placeholder="Benutzername" required>
|
||||
<input type="password" name="password" placeholder="Passwort" required>
|
||||
<label>
|
||||
<input type="checkbox" name="is_admin"> Admin
|
||||
</label>
|
||||
<button type="submit" class="create-btn">Benutzer erstellen</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -14,14 +14,50 @@
|
|||
<ul>
|
||||
<li><a href="{{ url_for('auth.job_status') }}">Jobs</a></li>
|
||||
<li><a href="{{ url_for('auth.upload') }}">Upload</a></li>
|
||||
{% if current_user.is_admin %}
|
||||
<li><a href="{{ url_for('auth.admin_panel') }}">Admin</a></li> <!-- Admin-Bereich Link -->
|
||||
{% endif %}
|
||||
<li><a href="{{ url_for('auth.logout') }}">Logout</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<!-- Flash-Nachrichten -->
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<div id="flash-badge-container">
|
||||
{% for message in messages %}
|
||||
<div class="flash-badge">{{ message }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<div class="{% if request.endpoint in ['auth.login', 'auth.signup'] %}form-container{% else %}container{% endif %}">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<!-- JavaScript für Ein- und Ausblendanimation des Flash-Badges -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var flashBadges = document.querySelectorAll('.flash-badge');
|
||||
flashBadges.forEach(function(badge) {
|
||||
// Einblendung mit Verzögerung
|
||||
setTimeout(function() {
|
||||
badge.classList.add('show');
|
||||
}, 100);
|
||||
|
||||
// Ausblendung nach 5 Sekunden und Entfernen aus dem DOM
|
||||
setTimeout(function() {
|
||||
badge.classList.remove('show');
|
||||
badge.classList.add('hide');
|
||||
setTimeout(function() {
|
||||
badge.remove();
|
||||
}, 400); // Zeit für die Ausblendanimation
|
||||
}, 5000);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue