Update virtual-machines.tsx

This commit is contained in:
MacRimi
2025-10-21 20:31:15 +02:00
parent 8ee8edcd36
commit 928f592d9c

View File

@@ -179,11 +179,11 @@ const getModalProgressColor = (percent: number): string => {
} }
const getOSIcon = (osInfo: VMDetails["os_info"] | undefined, vmType: string): React.ReactNode => { const getOSIcon = (osInfo: VMDetails["os_info"] | undefined, vmType: string): React.ReactNode => {
if (vmType !== "lxc") { if (vmType !== "lxc" || !osInfo?.id) {
return null return null
} }
const osId = osInfo?.id?.toLowerCase() const osId = osInfo.id.toLowerCase()
switch (osId) { switch (osId) {
case "debian": case "debian":
@@ -195,7 +195,7 @@ const getOSIcon = (osInfo: VMDetails["os_info"] | undefined, vmType: string): Re
case "arch": case "arch":
return <img src="/icons/arch.svg" alt="Arch" className="h-16 w-16" /> return <img src="/icons/arch.svg" alt="Arch" className="h-16 w-16" />
default: default:
return <Container className="h-16 w-16 text-cyan-500" /> return null
} }
} }
@@ -283,7 +283,7 @@ export function VirtualMachines() {
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
}, },
body: JSON.stringify({ action }), body: JSON.JSON.stringify({ action }),
}) })
if (response.ok) { if (response.ok) {