Update hardware.ts

This commit is contained in:
MacRimi
2025-10-06 18:15:56 +02:00
parent 174fc4f72b
commit ac30bd6e51

View File

@@ -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()
})
}