mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 19:46:18 +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"
|
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)}
|
onClick={() => handleVMClick(vm)}
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-2 mb-3">
|
<div className="flex items-center gap-3">
|
||||||
{/* Status icon */}
|
|
||||||
{vm.status === "running" ? (
|
{vm.status === "running" ? (
|
||||||
<Play className="h-5 w-5 text-green-500 fill-current flex-shrink-0" />
|
<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" />
|
<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`}>
|
<Badge variant="outline" className={`${getTypeBadge(vm.type).color} flex-shrink-0`}>
|
||||||
{getTypeBadge(vm.type).label}
|
{getTypeBadge(vm.type).label}
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|
||||||
{/* Name and ID - takes remaining space */}
|
{/* Name and ID */}
|
||||||
<div className="flex-1 min-w-0">
|
<div className="flex-1 min-w-0">
|
||||||
<div className="font-semibold text-foreground truncate">{vm.name}</div>
|
<div className="font-semibold text-foreground truncate">{vm.name}</div>
|
||||||
<div className="text-[10px] text-muted-foreground">ID: {vm.vmid}</div>
|
<div className="text-[10px] text-muted-foreground">ID: {vm.vmid}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Second row: Resource usage icons with percentages */}
|
<div className="flex items-center gap-3 flex-shrink-0">
|
||||||
<div className="flex items-center justify-between gap-4 px-1">
|
|
||||||
{/* CPU icon with percentage */}
|
{/* CPU icon with percentage */}
|
||||||
<div className="flex flex-col items-center gap-0.5">
|
<div className="flex flex-col items-center gap-0.5">
|
||||||
{vm.status === "running" && (
|
{vm.status === "running" && (
|
||||||
@@ -974,7 +970,7 @@ export function VirtualMachines() {
|
|||||||
)}
|
)}
|
||||||
<Cpu
|
<Cpu
|
||||||
className={`h-4 w-4 ${
|
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>
|
</div>
|
||||||
@@ -986,7 +982,7 @@ export function VirtualMachines() {
|
|||||||
)}
|
)}
|
||||||
<MemoryStick
|
<MemoryStick
|
||||||
className={`h-4 w-4 ${
|
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>
|
</div>
|
||||||
@@ -998,20 +994,14 @@ export function VirtualMachines() {
|
|||||||
)}
|
)}
|
||||||
<HardDrive
|
<HardDrive
|
||||||
className={`h-4 w-4 ${
|
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>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
{/* </CHANGE> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user