mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 11:36:17 +00:00
Update AppImage
This commit is contained in:
@@ -121,13 +121,29 @@ export function NodeMetricsCharts() {
|
|||||||
memoryZfsArc: item.zfsarc ? Number((item.zfsarc / 1024 / 1024 / 1024).toFixed(2)) : 0,
|
memoryZfsArc: item.zfsarc ? Number((item.zfsarc / 1024 / 1024 / 1024).toFixed(2)) : 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index === 0) {
|
if (index < 5 || index === result.data.length - 1) {
|
||||||
console.log("[v0] First transformed data point:", transformed)
|
console.log(`[v0] Data point ${index}:`, {
|
||||||
|
rawCpu: item.cpu,
|
||||||
|
transformedCpu: transformed.cpu,
|
||||||
|
rawLoad: item.loadavg,
|
||||||
|
transformedLoad: transformed.load,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return transformed
|
return transformed
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const cpuValues = transformedData.map((d) => d.cpu)
|
||||||
|
const minCpu = Math.min(...cpuValues)
|
||||||
|
const maxCpu = Math.max(...cpuValues)
|
||||||
|
const avgCpu = cpuValues.reduce((a, b) => a + b, 0) / cpuValues.length
|
||||||
|
console.log("[v0] CPU Statistics:", {
|
||||||
|
min: minCpu,
|
||||||
|
max: maxCpu,
|
||||||
|
avg: avgCpu.toFixed(2),
|
||||||
|
sampleSize: cpuValues.length,
|
||||||
|
})
|
||||||
|
|
||||||
console.log("[v0] Total transformed data points:", transformedData.length)
|
console.log("[v0] Total transformed data points:", transformedData.length)
|
||||||
console.log("[v0] Setting data state with", transformedData.length, "points")
|
console.log("[v0] Setting data state with", transformedData.length, "points")
|
||||||
|
|
||||||
|
|||||||
@@ -743,6 +743,11 @@ def get_storage_info():
|
|||||||
'critical_disks': 0
|
'critical_disks': 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Define get_disk_hardware_info (stub for now, will be replaced by lsblk parsing)
|
||||||
|
def get_disk_hardware_info(disk_name):
|
||||||
|
"""Placeholder for disk hardware info - to be populated by lsblk later."""
|
||||||
|
return {}
|
||||||
|
|
||||||
def get_smart_data(disk_name):
|
def get_smart_data(disk_name):
|
||||||
"""Get SMART data for a specific disk - Enhanced with multiple device type attempts"""
|
"""Get SMART data for a specific disk - Enhanced with multiple device type attempts"""
|
||||||
smart_data = {
|
smart_data = {
|
||||||
@@ -3269,11 +3274,33 @@ def get_hardware_info():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[v0] Error getting memory info: {e}")
|
print(f"[v0] Error getting memory info: {e}")
|
||||||
|
|
||||||
storage_info = get_storage_info()
|
# </CHANGE> Commented out get_disk_hardware_info call as function doesn't exist
|
||||||
for device in storage_info.get('disks', []):
|
# storage_info = get_storage_info()
|
||||||
hw_info = get_disk_hardware_info(device['name'])
|
# for device in storage_info.get('disks', []):
|
||||||
device.update(hw_info)
|
# hw_info = get_disk_hardware_info(device['name'])
|
||||||
hardware_data['storage_devices'] = storage_info.get('disks', [])
|
# device.update(hw_info)
|
||||||
|
# hardware_data['storage_devices'] = storage_info.get('disks', [])
|
||||||
|
|
||||||
|
# Storage Devices - simplified version without hardware info
|
||||||
|
try:
|
||||||
|
result = subprocess.run(['lsblk', '-J', '-o', 'NAME,SIZE,TYPE,MOUNTPOINT,MODEL'],
|
||||||
|
capture_output=True, text=True, timeout=5)
|
||||||
|
if result.returncode == 0:
|
||||||
|
import json
|
||||||
|
lsblk_data = json.loads(result.stdout)
|
||||||
|
storage_devices = []
|
||||||
|
for device in lsblk_data.get('blockdevices', []):
|
||||||
|
if device.get('type') == 'disk':
|
||||||
|
storage_devices.append({
|
||||||
|
'name': device.get('name', ''),
|
||||||
|
'size': device.get('size', ''),
|
||||||
|
'model': device.get('model', 'Unknown'),
|
||||||
|
'type': device.get('type', 'disk')
|
||||||
|
})
|
||||||
|
hardware_data['storage_devices'] = storage_devices
|
||||||
|
print(f"[v0] Storage devices: {len(storage_devices)} found")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"[v0] Error getting storage info: {e}")
|
||||||
|
|
||||||
# Graphics Cards (from lspci - will be duplicated by new PCI device listing, but kept for now)
|
# Graphics Cards (from lspci - will be duplicated by new PCI device listing, but kept for now)
|
||||||
try:
|
try:
|
||||||
@@ -4078,8 +4105,7 @@ def api_notifications_download():
|
|||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
import tempfile
|
import tempfile
|
||||||
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.log') as f:
|
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.log') as f:
|
||||||
f.write(f"ProxMenux Log - Notification around: {timestamp}\n")
|
f.write(f"ProxMenux Log ({log_type}, since {since_days if since_days else f'{hours}h'}) - Generated: {datetime.now().isoformat()}\n")
|
||||||
f.write(f"Time Window: {since_time} to {until_time}\n")
|
|
||||||
f.write("=" * 80 + "\n\n")
|
f.write("=" * 80 + "\n\n")
|
||||||
f.write(result.stdout)
|
f.write(result.stdout)
|
||||||
temp_path = f.name
|
temp_path = f.name
|
||||||
|
|||||||
Reference in New Issue
Block a user