From 901e4012cc2ea4644102ae900c16e1feb883f6fa Mon Sep 17 00:00:00 2001 From: MacRimi Date: Tue, 28 Oct 2025 22:45:15 +0100 Subject: [PATCH] Update AppImage --- AppImage/components/virtual-machines.tsx | 86 +++++++++++++----------- AppImage/scripts/flask_server.py | 9 ++- 2 files changed, 56 insertions(+), 39 deletions(-) diff --git a/AppImage/components/virtual-machines.tsx b/AppImage/components/virtual-machines.tsx index 1efa13d..d79859d 100644 --- a/AppImage/components/virtual-machines.tsx +++ b/AppImage/components/virtual-machines.tsx @@ -945,63 +945,73 @@ export function VirtualMachines() { className="sm:hidden p-4 rounded-lg border border-black/10 dark:border-white/10 bg-black/5 dark:bg-white/5 transition-colors cursor-pointer" onClick={() => handleVMClick(vm)} > -
+
+ {/* Status icon */} {vm.status === "running" ? ( ) : ( )} + {/* Type badge */} {getTypeBadge(vm.type).label} - {/* Name and ID */} + {/* Name and ID - takes remaining space */}
{vm.name}
ID: {vm.vmid}
+
-
- {/* CPU icon with percentage */} -
- {vm.status === "running" && ( - {cpuPercent}% - )} - -
+ {/* Second row: Resource usage icons with percentages */} +
+ {/* CPU icon with percentage */} +
+ {vm.status === "running" && ( + {cpuPercent}% + )} + +
- {/* Memory icon with percentage */} -
- {vm.status === "running" && ( - {memPercent}% - )} - -
+ {/* Memory icon with percentage */} +
+ {vm.status === "running" && ( + {memPercent}% + )} + +
- {/* Disk icon with percentage */} -
- {vm.status === "running" && ( - {diskPercent}% - )} - -
+ {/* Disk icon with percentage */} +
+ {vm.status === "running" && ( + {diskPercent}% + )} + +
+ + {/* Network icon */} +
+ -- +
+ {/* */}
) diff --git a/AppImage/scripts/flask_server.py b/AppImage/scripts/flask_server.py index 5493ee7..28cc879 100644 --- a/AppImage/scripts/flask_server.py +++ b/AppImage/scripts/flask_server.py @@ -5534,6 +5534,10 @@ def api_vm_details(vmid): except Exception as e: pass # Silently handle errors + ip_address = None + if vm_type == 'lxc' and resource.get('status') == 'running': + ip_address = get_lxc_ip_from_lxc_info(vmid) + response_data = { **resource, 'config': config, @@ -5541,6 +5545,9 @@ def api_vm_details(vmid): 'vm_type': vm_type } + if ip_address: + response_data['ip_address'] = ip_address + if vm_type == 'lxc': hardware_info = parse_lxc_hardware_config(vmid, node) response_data['hardware_info'] = hardware_info @@ -5723,6 +5730,6 @@ if __name__ == '__main__': cli.show_server_banner = lambda *x: None # Print only essential information - print("API endpoints available at: /api/system, /api/system-info, /api/storage, /api/proxmox-storage, /api/network, /api/vms, /api/logs, /api/health, /api/hardware, /api/prometheus, /api/node/metrics") + #print("API endpoints available at: /api/system, /api/system-info, /api/storage, /api/proxmox-storage, /api/network, /api/vms, /api/logs, /api/health, /api/hardware, /api/prometheus, /api/node/metrics") app.run(host='0.0.0.0', port=8008, debug=False)