mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 03:26:17 +00:00
Update virtual-machines.tsx
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>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user