mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-19 12:06:17 +00:00
Update flask_server.py
This commit is contained in:
@@ -925,7 +925,6 @@ def get_smart_data(disk_name):
|
|||||||
except (ValueError, IndexError) as e:
|
except (ValueError, IndexError) as e:
|
||||||
print(f"[v0] Error parsing attribute line '{line}': {e}")
|
print(f"[v0] Error parsing attribute line '{line}': {e}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# If we got complete data, break
|
# If we got complete data, break
|
||||||
if smart_data['model'] != 'Unknown' and smart_data['serial'] != 'Unknown':
|
if smart_data['model'] != 'Unknown' and smart_data['serial'] != 'Unknown':
|
||||||
print(f"[v0] Successfully extracted complete data from text output (attempt {cmd_index + 1})")
|
print(f"[v0] Successfully extracted complete data from text output (attempt {cmd_index + 1})")
|
||||||
@@ -3344,15 +3343,16 @@ def api_logs():
|
|||||||
service = request.args.get('service', None)
|
service = request.args.get('service', None)
|
||||||
since_days = request.args.get('since_days', None)
|
since_days = request.args.get('since_days', None)
|
||||||
|
|
||||||
cmd = ['journalctl', '-n', limit, '--output', 'json', '--no-pager']
|
|
||||||
|
|
||||||
if since_days:
|
if since_days:
|
||||||
try:
|
try:
|
||||||
days = int(since_days)
|
days = int(since_days)
|
||||||
cmd.extend(['--since', f'{days} days ago'])
|
cmd = ['journalctl', '--since', f'{days} days ago', '--output', 'json', '--no-pager']
|
||||||
print(f"[API] Filtering logs since {days} days ago")
|
print(f"[API] Filtering logs since {days} days ago (no limit)")
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print(f"[API] Invalid since_days value: {since_days}")
|
print(f"[API] Invalid since_days value: {since_days}")
|
||||||
|
cmd = ['journalctl', '-n', limit, '--output', 'json', '--no-pager']
|
||||||
|
else:
|
||||||
|
cmd = ['journalctl', '-n', limit, '--output', 'json', '--no-pager']
|
||||||
|
|
||||||
# Add priority filter if specified
|
# Add priority filter if specified
|
||||||
if priority:
|
if priority:
|
||||||
|
|||||||
Reference in New Issue
Block a user