new calculation approach with unique sessions, new API endpoint to get list of active sessions, fix for UNDEF user, UI and Back to support certificate management still under development
This commit is contained in:
14
APP/db.py
14
APP/db.py
@@ -67,6 +67,20 @@ class DatabaseManager:
|
||||
''')
|
||||
cursor.execute('CREATE INDEX IF NOT EXISTS idx_usage_ts ON usage_history(timestamp)')
|
||||
|
||||
# 2.1 Active Sessions (Temporary state table)
|
||||
cursor.execute('''
|
||||
CREATE TABLE IF NOT EXISTS active_sessions (
|
||||
client_id INTEGER,
|
||||
common_name TEXT,
|
||||
real_address TEXT,
|
||||
bytes_received INTEGER,
|
||||
bytes_sent INTEGER,
|
||||
connected_since TIMESTAMP,
|
||||
last_seen TIMESTAMP,
|
||||
FOREIGN KEY (client_id) REFERENCES clients (id)
|
||||
)
|
||||
''')
|
||||
|
||||
# 3. Aggregated Stats Tables
|
||||
tables = ['stats_5min', 'stats_15min', 'stats_hourly', 'stats_6h', 'stats_daily']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user