mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 03:26:17 +00:00
Update flask_server.py
This commit is contained in:
@@ -3390,14 +3390,14 @@ def api_logs():
|
|||||||
'error': 'journalctl not available or failed',
|
'error': 'journalctl not available or failed',
|
||||||
'logs': [],
|
'logs': [],
|
||||||
'total': 0
|
'total': 0
|
||||||
})
|
}), 500
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error getting logs: {e}")
|
print(f"Error getting logs: {e}")
|
||||||
return jsonify({
|
return jsonify({
|
||||||
'error': f'Unable to access system logs: {str(e)}',
|
'error': str(e),
|
||||||
'logs': [],
|
'logs': [],
|
||||||
'total': 0
|
'total': 0
|
||||||
})
|
}), 500
|
||||||
|
|
||||||
@app.route('/api/logs/download', methods=['GET'])
|
@app.route('/api/logs/download', methods=['GET'])
|
||||||
def api_logs_download():
|
def api_logs_download():
|
||||||
@@ -3609,7 +3609,7 @@ def api_notifications_download():
|
|||||||
download_name=f'notification_{timestamp.replace(":", "_").replace(" ", "_")}.log'
|
download_name=f'notification_{timestamp.replace(":", "_").replace(" ", "_")}.log'
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
return jsonify({'error': 'Failed to generate notification log'}), 500
|
return jsonify({'error': 'Failed to generate log file'}), 500
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error downloading notification log: {e}")
|
print(f"Error downloading notification log: {e}")
|
||||||
@@ -3969,7 +3969,7 @@ def api_gpu_realtime(slot):
|
|||||||
def api_vm_details(vmid):
|
def api_vm_details(vmid):
|
||||||
"""Get detailed information for a specific VM/LXC"""
|
"""Get detailed information for a specific VM/LXC"""
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(['pvesh', 'get', f'/cluster/resources', '--type', 'vm', '--output-format', 'json'],
|
result = subprocess.run(['pvesh', 'get', '/cluster/resources', '--type', 'vm', '--output-format', 'json'],
|
||||||
capture_output=True, text=True, timeout=10)
|
capture_output=True, text=True, timeout=10)
|
||||||
|
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user