From 42c6e70ebef5d4586a0afae1deb40f8aaf449447 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sun, 5 Oct 2025 20:24:30 +0200 Subject: [PATCH] Update virtual-machines.tsx --- AppImage/components/virtual-machines.tsx | 41 ++++++++++-------------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/AppImage/components/virtual-machines.tsx b/AppImage/components/virtual-machines.tsx index 0a092e7..f037b45 100644 --- a/AppImage/components/virtual-machines.tsx +++ b/AppImage/components/virtual-machines.tsx @@ -6,19 +6,7 @@ import { Badge } from "./ui/badge" import { Progress } from "./ui/progress" import { Button } from "./ui/button" import { Dialog, DialogContent, DialogHeader, DialogTitle } from "./ui/dialog" -import { - Server, - Play, - Square, - Cpu, - MemoryStick, - HardDrive, - Network, - Power, - RotateCcw, - StopCircle, - AlertTriangle, -} from "lucide-react" +import { Server, Play, Square, Cpu, MemoryStick, HardDrive, Network, Power, RotateCcw, StopCircle } from "lucide-react" import useSWR from "swr" interface VMData { @@ -303,11 +291,20 @@ export function VirtualMachines() { const getMemoryUsageColor = (percent: number | null) => { if (percent === null) return "bg-blue-500" - if (percent >= 80) return "bg-red-500" + if (percent >= 90) return "bg-red-500" + if (percent >= 80) return "bg-orange-500" if (percent >= 60) return "bg-yellow-500" return "bg-green-500" } + const getMemoryPercentTextColor = (percent: number | null) => { + if (percent === null) return "text-muted-foreground" + if (percent >= 90) return "text-red-500" + if (percent >= 80) return "text-orange-500" + if (percent >= 60) return "text-yellow-500" + return "text-green-500" + } + console.log("[v0] Memory status:", { physical: physicalMemoryGB, allocated: allocatedMemoryGB, @@ -368,10 +365,7 @@ export function VirtualMachines() { Total Memory -
- {isMemoryOvercommit && } - -
+
{/* Memory Usage (current) */} @@ -379,12 +373,12 @@ export function VirtualMachines() {
{usedMemoryGB.toFixed(1)} GB
- {memoryUsagePercent.toFixed(1)}% of {physicalMemoryGB.toFixed(1)} GB + + {memoryUsagePercent.toFixed(1)}% + {" "} + of {physicalMemoryGB.toFixed(1)} GB
- div]:${getMemoryUsageColor(memoryUsagePercent)}`} - /> +
) : (
@@ -404,7 +398,6 @@ export function VirtualMachines() {
{isMemoryOvercommit ? ( - Exceeds Physical ) : (