mirror of
https://github.com/infinition/Bjorn.git
synced 2026-03-11 07:01: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:
@@ -436,14 +436,14 @@ class BackupUtils:
|
||||
return
|
||||
|
||||
try:
|
||||
with open(backup_path, 'rb') as f:
|
||||
file_data = f.read()
|
||||
file_size = os.path.getsize(backup_path)
|
||||
handler.send_response(200)
|
||||
handler.send_header('Content-Type', 'application/octet-stream')
|
||||
handler.send_header('Content-Disposition', f'attachment; filename="{filename}"')
|
||||
handler.send_header('Content-Length', str(len(file_data)))
|
||||
handler.send_header('Content-Length', str(file_size))
|
||||
handler.end_headers()
|
||||
handler.wfile.write(file_data)
|
||||
with open(backup_path, 'rb') as f:
|
||||
shutil.copyfileobj(f, handler.wfile)
|
||||
except Exception as e:
|
||||
self.logger.error(f"Error downloading backup: {e}")
|
||||
handler.send_response(500)
|
||||
|
||||
Reference in New Issue
Block a user