mirror of
https://github.com/infinition/Bjorn.git
synced 2026-03-11 23:21:59 +00:00
Add RLUtils class for managing RL/AI dashboard endpoints
- Implemented methods for fetching AI stats, training history, and recent experiences. - Added functionality to set operation mode (MANUAL, AUTO, AI) with appropriate handling. - Included helper methods for querying the database and sending JSON responses. - Integrated model metadata extraction for visualization purposes.
This commit is contained in:
@@ -71,10 +71,8 @@ class StatsOps:
|
||||
|
||||
def get_stats(self) -> Dict[str, int]:
|
||||
"""Compatibility alias to retrieve stats; ensures the singleton row exists"""
|
||||
self.ensure_stats_initialized()
|
||||
row = self.base.query("SELECT total_open_ports, alive_hosts_count, all_known_hosts_count, vulnerabilities_count FROM stats WHERE id=1;")
|
||||
if not row:
|
||||
self.ensure_stats_initialized()
|
||||
row = self.base.query("SELECT total_open_ports, alive_hosts_count, all_known_hosts_count, vulnerabilities_count FROM stats WHERE id=1;")
|
||||
r = row[0]
|
||||
return {
|
||||
"total_open_ports": int(r["total_open_ports"]),
|
||||
|
||||
Reference in New Issue
Block a user