From ac30bd6e51cc087e40b09bc2c5010d9bedd49427 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Mon, 6 Oct 2025 18:15:56 +0200 Subject: [PATCH] Update hardware.ts --- AppImage/types/hardware.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/AppImage/types/hardware.ts b/AppImage/types/hardware.ts index af1547f..022a1d4 100644 --- a/AppImage/types/hardware.ts +++ b/AppImage/types/hardware.ts @@ -172,4 +172,12 @@ export interface HardwareData { memory_modules?: any[] } -export const fetcher = (url: string) => fetch(url).then((res) => res.json()) +export const fetcher = (url: string) => { + const baseUrl = typeof window !== "undefined" ? `${window.location.protocol}//${window.location.hostname}:8008` : "" + const fullUrl = url.startsWith("http") ? url : `${baseUrl}${url}` + console.log("[v0] Hardware fetcher - Full URL:", fullUrl) + return fetch(fullUrl).then((res) => { + console.log("[v0] Hardware fetcher - Response status:", res.status) + return res.json() + }) +}