Lots of UI and admin changes, need to clean up the three audit log tables and a few other niggles.

This commit is contained in:
2025-04-01 00:05:48 +01:00
parent 7eefb9ced0
commit aaf90b55da
11 changed files with 309 additions and 52 deletions

View File

@@ -184,5 +184,22 @@ func InitDB(filepath string) *sql.DB {
if _, err := db.Exec(createAdminAccessLogTable); err != nil {
log.Fatal("❌ Failed to create admin access log table:", err)
}
createNewAuditLogTable := `
CREATE TABLE IF NOT EXISTS audit_log (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER,
username TEXT,
action TEXT,
path TEXT,
ip TEXT,
user_agent TEXT,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
);`
if _, err := db.Exec(createNewAuditLogTable); err != nil {
log.Fatal("❌ Failed to create admin access log table:", err)
}
return db
}