From c0aa2b85fcf0218f60a4b72747970f34eb203c7a Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sun, 19 Oct 2025 17:53:39 +0200 Subject: [PATCH] Update metrics-dialog.tsx --- AppImage/components/metrics-dialog.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/AppImage/components/metrics-dialog.tsx b/AppImage/components/metrics-dialog.tsx index b18d72b..f217d8d 100644 --- a/AppImage/components/metrics-dialog.tsx +++ b/AppImage/components/metrics-dialog.tsx @@ -46,7 +46,13 @@ export function MetricsView({ vmid, vmName, vmType, metricType, onBack }: Metric console.log("[v0] Fetching metrics for VMID:", vmid, "Timeframe:", timeframe, "Type:", vmType) try { - const response = await fetch(`http://localhost:8008/api/vms/${vmid}/metrics?timeframe=${timeframe}`) + const baseUrl = + typeof window !== "undefined" ? `${window.location.protocol}//${window.location.hostname}:8008` : "" + const apiUrl = `${baseUrl}/api/vms/${vmid}/metrics?timeframe=${timeframe}` + + console.log("[v0] Fetching from URL:", apiUrl) + + const response = await fetch(apiUrl) console.log("[v0] Response status:", response.status)