Update AppImage

This commit is contained in:
MacRimi
2025-10-26 18:03:09 +01:00
parent 28898aa1db
commit 071724949f
2 changed files with 64 additions and 28 deletions

View File

@@ -34,6 +34,9 @@ interface NetworkData {
bridge_total_count?: number bridge_total_count?: number
vm_lxc_active_count?: number vm_lxc_active_count?: number
vm_lxc_total_count?: number vm_lxc_total_count?: number
hostname?: string
domain?: string
dns_servers?: string[]
} }
interface NetworkInterface { interface NetworkInterface {
@@ -260,6 +263,12 @@ export function NetworkMetrics() {
} }
} }
const hostname = networkData.hostname || "N/A"
const domain = networkData.domain || "N/A"
const dnsServers = networkData.dns_servers || []
const primaryDNS = dnsServers[0] || "N/A"
const secondaryDNS = dnsServers[1] || "N/A"
return ( return (
<div className="space-y-6"> <div className="space-y-6">
{/* Network Overview Cards */} {/* Network Overview Cards */}
@@ -308,26 +317,24 @@ export function NetworkMetrics() {
<Card className="bg-card border-border"> <Card className="bg-card border-border">
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium text-muted-foreground">Top Interface</CardTitle> <CardTitle className="text-sm font-medium text-muted-foreground">Network Configuration</CardTitle>
<Activity className="h-4 w-4 text-muted-foreground" /> <Network className="h-4 w-4 text-muted-foreground" />
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<div className="text-xl lg:text-2xl font-bold text-foreground truncate">{topInterface.name}</div> <div className="space-y-2">
<div className="flex items-center gap-2 mt-2"> <div className="flex flex-col">
{topInterface.vm_type ? ( <span className="text-xs text-muted-foreground">Hostname</span>
<Badge variant="outline" className={getVMTypeBadge(topInterface.vm_type).color}> <span className="text-sm font-medium text-foreground truncate">{hostname}</span>
{getVMTypeBadge(topInterface.vm_type).label} </div>
</Badge> <div className="flex flex-col">
) : ( <span className="text-xs text-muted-foreground">Domain</span>
<Badge variant="outline" className={getInterfaceTypeBadge(topInterface.type).color}> <span className="text-sm font-medium text-foreground truncate">{domain}</span>
{getInterfaceTypeBadge(topInterface.type).label} </div>
</Badge> <div className="flex flex-col">
)} <span className="text-xs text-muted-foreground">Primary DNS</span>
{topInterface.vm_name && topInterface.vm_name !== "N/A" && ( <span className="text-sm font-medium text-foreground truncate">{primaryDNS}</span>
<span className="text-xs text-muted-foreground truncate"> {topInterface.vm_name}</span> </div>
)}
</div> </div>
<p className="text-xs text-muted-foreground mt-2">Total traffic: {formatBytes(topInterfaceTraffic)}</p>
</CardContent> </CardContent>
</Card> </Card>

View File

@@ -1087,7 +1087,7 @@ def get_smart_data(disk_name):
smart_data['media_wearout_indicator'] = wear_used smart_data['media_wearout_indicator'] = wear_used
smart_data['ssd_life_left'] = max(0, 100 - wear_used) smart_data['ssd_life_left'] = max(0, 100 - wear_used)
print(f"[v0] Media Wearout Indicator (ID 230): {used}% used, {smart_data['ssd_life_left']}% life left") print(f"[v0] Media Wearout Indicator (ID 230): {wear_used}% used, {smart_data['ssd_life_left']}% life left")
except Exception as e: except Exception as e:
print(f"[v0] Error parsing Media_Wearout_Indicator (ID 230): {e}") print(f"[v0] Error parsing Media_Wearout_Indicator (ID 230): {e}")
elif attr_id == '233': # Media_Wearout_Indicator (Intel/Samsung SSD) elif attr_id == '233': # Media_Wearout_Indicator (Intel/Samsung SSD)
@@ -1411,9 +1411,38 @@ def get_network_info():
'physical_interfaces': [], # Added separate list for physical interfaces 'physical_interfaces': [], # Added separate list for physical interfaces
'bridge_interfaces': [], # Added separate list for bridge interfaces 'bridge_interfaces': [], # Added separate list for bridge interfaces
'vm_lxc_interfaces': [], 'vm_lxc_interfaces': [],
'traffic': {'bytes_sent': 0, 'bytes_recv': 0, 'packets_sent': 0, 'packets_recv': 0} 'traffic': {'bytes_sent': 0, 'bytes_recv': 0, 'packets_sent': 0, 'packets_recv': 0},
'hostname': socket.gethostname(),
'domain': None,
'dns_servers': []
} }
try:
with open('/etc/resolv.conf', 'r') as f:
for line in f:
line = line.strip()
if line.startswith('nameserver'):
dns_server = line.split()[1]
network_data['dns_servers'].append(dns_server)
elif line.startswith('domain'):
network_data['domain'] = line.split()[1]
elif line.startswith('search') and not network_data['domain']:
# Use first search domain if no domain is set
domains = line.split()[1:]
if domains:
network_data['domain'] = domains[0]
except Exception as e:
print(f"[v0] Error reading DNS configuration: {e}")
try:
fqdn = socket.getfqdn()
if '.' in fqdn and fqdn != network_data['hostname']:
# Extract domain from FQDN if not already set
if not network_data['domain']:
network_data['domain'] = fqdn.split('.', 1)[1]
except Exception as e:
print(f"[v0] Error getting FQDN: {e}")
vm_lxc_map = get_vm_lxc_names() vm_lxc_map = get_vm_lxc_names()
# Get network interfaces # Get network interfaces
@@ -2694,15 +2723,15 @@ def get_detailed_gpu_info(gpu):
print(f"[v0] VRAM Total: {detailed_info['memory_total']}", flush=True) print(f"[v0] VRAM Total: {detailed_info['memory_total']}", flush=True)
data_retrieved = True data_retrieved = True
# Calculate memory utilization percentage # Calculate memory utilization percentage
if detailed_info['memory_used'] and detailed_info['memory_total']: if detailed_info['memory_used'] and detailed_info['memory_total']:
mem_used = int(detailed_info['memory_used'].replace(' MB', '')) mem_used = int(detailed_info['memory_used'].replace(' MB', ''))
mem_total = int(detailed_info['memory_total'].replace(' MB', '')) mem_total = int(detailed_info['memory_total'].replace(' MB', ''))
if mem_total > 0: if mem_total > 0:
mem_util = (mem_used / mem_total) * 100 mem_util = (mem_used / mem_total) * 100
detailed_info['utilization_memory'] = round(mem_util, 1) detailed_info['utilization_memory'] = round(mem_util, 1)
print(f"[v0] Memory Utilization: {detailed_info['utilization_memory']}%", flush=True) print(f"[v0] Memory Utilization: {detailed_info['utilization_memory']}%", flush=True)
# Parse GRBM (Graphics Register Bus Manager) for engine utilization # Parse GRBM (Graphics Register Bus Manager) for engine utilization
if 'GRBM' in device: if 'GRBM' in device: