From 714407eb465050d0f1722a602cd4b3c43322d089 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sun, 5 Oct 2025 15:38:29 +0200 Subject: [PATCH] Update virtual-machines.tsx --- AppImage/components/virtual-machines.tsx | 64 ++++-------------------- 1 file changed, 11 insertions(+), 53 deletions(-) diff --git a/AppImage/components/virtual-machines.tsx b/AppImage/components/virtual-machines.tsx index f658fbf..b0b2cdc 100644 --- a/AppImage/components/virtual-machines.tsx +++ b/AppImage/components/virtual-machines.tsx @@ -96,23 +96,6 @@ const formatBytes = (bytes: number | undefined): string => { return `${(bytes / Math.pow(k, i)).toFixed(2)} ${sizes[i]}` } -const extractIPFromNetConfig = (netConfig: string | undefined): string | null => { - if (!netConfig) return null - - // Check for DHCP - if (netConfig.includes("ip=dhcp")) { - return "DHCP" - } - - // Extract static IP (format: ip=192.168.0.4/24) - const ipMatch = netConfig.match(/ip=([0-9.]+)/) - if (ipMatch && ipMatch[1]) { - return ipMatch[1] - } - - return null -} - export function VirtualMachines() { const { data: vmData, @@ -296,12 +279,6 @@ export function VirtualMachines() { const memoryBadge = getMemoryOvercommitBadge() - console.log("[v0] VM Data:", vmData) - console.log("[v0] Physical Memory GB:", physicalMemoryGB) - console.log("[v0] Total Allocated Memory GB:", totalAllocatedMemoryGB) - console.log("[v0] Is Memory Overcommit:", isMemoryOvercommit) - console.log("[v0] Memory Badge:", memoryBadge) - if (isLoading) { return (
@@ -445,7 +422,7 @@ export function VirtualMachines() {
- {vm.type === "lxc" && vm.ipaddress && ( + {vm.ipaddress && (
IP Address
{vm.ipaddress}
@@ -552,7 +529,7 @@ export function VirtualMachines() {
VMID
{selectedVM.vmid}
- {selectedVM.type === "lxc" && selectedVM.ipaddress && ( + {selectedVM.ipaddress && (
IP Address
{selectedVM.ipaddress}
@@ -600,11 +577,9 @@ export function VirtualMachines() {
Disk I/O
- ↓ {formatBytes(selectedVM.diskread)}
- ↑ {formatBytes(selectedVM.diskwrite)}
@@ -613,11 +588,9 @@ export function VirtualMachines() {
Network I/O
- ↓ {formatBytes(selectedVM.netin)}
- ↑ {formatBytes(selectedVM.netout)}
@@ -690,31 +663,16 @@ export function VirtualMachines() {
{Object.keys(vmDetails.config) .filter((key) => key.match(/^net\d+$/)) - .map((netKey) => { - const netConfig = vmDetails.config[netKey] - const extractedIP = extractIPFromNetConfig(netConfig) - - return ( -
-
- Network Interface {netKey.replace("net", "")} -
-
- {netConfig} -
- {extractedIP && selectedVM.type === "lxc" && ( -
- - IP: {extractedIP} - -
- )} + .map((netKey) => ( +
+
+ Network Interface {netKey.replace("net", "")}
- ) - })} +
+ {vmDetails.config[netKey]} +
+
+ ))} {vmDetails.config.nameserver && (
DNS Nameserver