diff --git a/AppImage/components/hardware.tsx b/AppImage/components/hardware.tsx index 0f0455a..e3a47de 100644 --- a/AppImage/components/hardware.tsx +++ b/AppImage/components/hardware.tsx @@ -71,9 +71,20 @@ export default function Hardware() { setSelectedGPU(gpu) setRealtimeGPUData(null) + const pciDevice = findPCIDeviceForGPU(gpu) + const fullSlot = pciDevice?.slot || gpu.slot + + // Validar que el slot no esté vacío + if (!fullSlot) { + console.error("[v0] GPU slot is empty, cannot fetch real-time data") + setRealtimeGPUData({ has_monitoring_tool: false }) + setLoadingGPUData(false) + return + } + try { - console.log("[v0] Fetching real-time GPU data for slot:", gpu.slot) - const response = await fetch(`http://localhost:8008/api/gpu/${gpu.slot}/realtime`, { + console.log("[v0] Fetching real-time GPU data for slot:", fullSlot) + const response = await fetch(`http://localhost:8008/api/gpu/${fullSlot}/realtime`, { signal: AbortSignal.timeout(6000), }) if (response.ok) { @@ -473,7 +484,7 @@ export default function Hardware() {