mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 11:36:17 +00:00
Update AppImage
This commit is contained in:
@@ -945,28 +945,24 @@ 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)}
|
||||
>
|
||||
<div className="flex items-center gap-2 mb-3">
|
||||
{/* Status icon */}
|
||||
<div className="flex items-center gap-3">
|
||||
{vm.status === "running" ? (
|
||||
<Play className="h-5 w-5 text-green-500 fill-current flex-shrink-0" />
|
||||
) : (
|
||||
<Square className="h-5 w-5 text-red-500 fill-current flex-shrink-0" />
|
||||
)}
|
||||
|
||||
{/* Type badge */}
|
||||
<Badge variant="outline" className={`${getTypeBadge(vm.type).color} flex-shrink-0`}>
|
||||
{getTypeBadge(vm.type).label}
|
||||
</Badge>
|
||||
|
||||
{/* Name and ID - takes remaining space */}
|
||||
{/* Name and ID */}
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="font-semibold text-foreground truncate">{vm.name}</div>
|
||||
<div className="text-[10px] text-muted-foreground">ID: {vm.vmid}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Second row: Resource usage icons with percentages */}
|
||||
<div className="flex items-center justify-between gap-4 px-1">
|
||||
<div className="flex items-center gap-3 flex-shrink-0">
|
||||
{/* CPU icon with percentage */}
|
||||
<div className="flex flex-col items-center gap-0.5">
|
||||
{vm.status === "running" && (
|
||||
@@ -974,7 +970,7 @@ export function VirtualMachines() {
|
||||
)}
|
||||
<Cpu
|
||||
className={`h-4 w-4 ${
|
||||
vm.status === "stopped" ? "text-gray-500" : getIconColor(Number.parseFloat(cpuPercent))
|
||||
vm.status === "stopped" ? "text-gray-500" : getUsageColor(Number.parseFloat(cpuPercent))
|
||||
}`}
|
||||
/>
|
||||
</div>
|
||||
@@ -986,7 +982,7 @@ export function VirtualMachines() {
|
||||
)}
|
||||
<MemoryStick
|
||||
className={`h-4 w-4 ${
|
||||
vm.status === "stopped" ? "text-gray-500" : getIconColor(Number.parseFloat(memPercent))
|
||||
vm.status === "stopped" ? "text-gray-500" : getUsageColor(Number.parseFloat(memPercent))
|
||||
}`}
|
||||
/>
|
||||
</div>
|
||||
@@ -998,20 +994,14 @@ export function VirtualMachines() {
|
||||
)}
|
||||
<HardDrive
|
||||
className={`h-4 w-4 ${
|
||||
vm.status === "stopped" ? "text-gray-500" : getIconColor(Number.parseFloat(diskPercent))
|
||||
vm.status === "stopped"
|
||||
? "text-gray-500"
|
||||
: getUsageColor(Number.parseFloat(diskPercent))
|
||||
}`}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Network icon */}
|
||||
<div className="flex flex-col items-center gap-0.5">
|
||||
<span className="text-[10px] font-medium text-transparent">--</span>
|
||||
<Network
|
||||
className={`h-4 w-4 ${vm.status === "stopped" ? "text-gray-500" : "text-muted-foreground"}`}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{/* </CHANGE> */}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -5534,10 +5534,6 @@ 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,
|
||||
@@ -5545,9 +5541,6 @@ 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
|
||||
@@ -5730,6 +5723,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)
|
||||
|
||||
Reference in New Issue
Block a user