Add login history to settings
This commit is contained in:
@@ -133,6 +133,23 @@ def database_schema():
|
||||
)
|
||||
return render_template("dashboard/settings/database_schema.html", schema_info=schema_info)
|
||||
|
||||
@settings.route("/login-history", methods=["GET"])
|
||||
@login_required
|
||||
def login_history():
|
||||
"""Display login history for the current user"""
|
||||
user_id = current_user.id
|
||||
history = db.get_login_history(user_id, limit=50)
|
||||
|
||||
if htmx:
|
||||
return render_block(
|
||||
environment,
|
||||
"dashboard/settings/login_history.html",
|
||||
"page",
|
||||
history=history
|
||||
)
|
||||
return render_template("dashboard/settings/login_history.html", history=history)
|
||||
|
||||
|
||||
def get_database_schema():
|
||||
"""Fetch database schema information for ERD generation"""
|
||||
# Get all tables
|
||||
@@ -413,3 +430,4 @@ def import_data():
|
||||
|
||||
except Exception as e:
|
||||
return {"error": f"Import failed: {str(e)}"}, 500
|
||||
|
||||
|
||||
Reference in New Issue
Block a user