diff --git a/backend/blueprints/__pycache__/admin_unified.cpython-313.pyc b/backend/blueprints/__pycache__/admin_unified.cpython-313.pyc index ed1244862..48775d0b6 100644 Binary files a/backend/blueprints/__pycache__/admin_unified.cpython-313.pyc and b/backend/blueprints/__pycache__/admin_unified.cpython-313.pyc differ diff --git a/backend/blueprints/admin_unified.py b/backend/blueprints/admin_unified.py index 7b1f8e869..e3c004484 100644 --- a/backend/blueprints/admin_unified.py +++ b/backend/blueprints/admin_unified.py @@ -94,7 +94,7 @@ def admin_required(f): @admin_blueprint.route("/") @admin_required def admin_dashboard(): - """Admin-Dashboard-Hauptseite mit Systemstatistiken""" + """Admin-Dashboard-Hauptseite mit Systemstatistiken und Benutzerdaten""" try: with get_cached_session() as db_session: # Grundlegende Statistiken sammeln @@ -106,6 +106,9 @@ def admin_dashboard(): active_jobs = db_session.query(Job).filter( Job.status.in_(['pending', 'printing', 'paused']) ).count() + + # Alle Benutzer für die Benutzerverwaltung laden + users = db_session.query(User).order_by(User.created_at.desc()).all() stats = { 'total_users': total_users, @@ -114,13 +117,13 @@ def admin_dashboard(): 'active_jobs': active_jobs } - admin_logger.info(f"Admin-Dashboard geladen von {current_user.username}") - return render_template('admin.html', stats=stats, active_tab=None) + admin_logger.info(f"Admin-Dashboard geladen von {current_user.username} mit {len(users)} Benutzern") + return render_template('admin.html', stats=stats, users=users, active_tab=None) except Exception as e: admin_logger.error(f"Fehler beim Laden des Admin-Dashboards: {str(e)}") flash("Fehler beim Laden der Dashboard-Daten", "error") - return render_template('admin.html', stats={}, active_tab=None) + return render_template('admin.html', stats={}, users=[], active_tab=None) @admin_blueprint.route("/plug-schedules") @admin_required