feat: initialize full-stack architecture with backend routes, database schema, and glassmorphic frontend UI

This commit is contained in:
2026-05-13 00:12:19 +03:00
parent bd73f18d5c
commit 0732acbda5
21 changed files with 1937 additions and 307 deletions

View File

@@ -0,0 +1,17 @@
import json
from ..db import get_db_connection, release_db_connection
def log_action(user_id, action, details=None):
"""Записывает действие пользователя в лог аудита."""
conn = get_db_connection()
try:
cur = conn.cursor()
cur.execute(
"INSERT INTO audit_log (user_id, action, details) VALUES (%s, %s, %s)",
(user_id, action, json.dumps(details) if details else None)
)
conn.commit()
except Exception as e:
print(f"Audit Log Error: {e}")
finally:
release_db_connection(conn)