mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 11:36:17 +00:00
Update AppImage
This commit is contained in:
@@ -14,7 +14,7 @@ import { OnboardingCarousel } from "./onboarding-carousel"
|
|||||||
import { AuthSetup } from "./auth-setup"
|
import { AuthSetup } from "./auth-setup"
|
||||||
import { Login } from "./login"
|
import { Login } from "./login"
|
||||||
import { Settings } from "./settings"
|
import { Settings } from "./settings"
|
||||||
import { getApiUrl } from "../lib/api-config"
|
import { getApiUrl, getApiBaseUrl } from "../lib/api-config"
|
||||||
import {
|
import {
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
@@ -52,7 +52,18 @@ interface FlaskSystemData {
|
|||||||
load_average: number[]
|
load_average: number[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("[v0] ========================================")
|
||||||
|
console.log("[v0] ProxmoxDashboard component file loaded!")
|
||||||
|
console.log("[v0] Timestamp:", new Date().toISOString())
|
||||||
|
console.log("[v0] ========================================")
|
||||||
|
|
||||||
export function ProxmoxDashboard() {
|
export function ProxmoxDashboard() {
|
||||||
|
console.log("[v0] ========================================")
|
||||||
|
console.log("[v0] ProxmoxDashboard component MOUNTING")
|
||||||
|
console.log("[v0] Window location:", typeof window !== "undefined" ? window.location.href : "SSR")
|
||||||
|
console.log("[v0] API Base URL:", typeof window !== "undefined" ? getApiBaseUrl() : "SSR")
|
||||||
|
console.log("[v0] ========================================")
|
||||||
|
|
||||||
const [systemStatus, setSystemStatus] = useState<SystemStatus>({
|
const [systemStatus, setSystemStatus] = useState<SystemStatus>({
|
||||||
status: "healthy",
|
status: "healthy",
|
||||||
uptime: "Loading...",
|
uptime: "Loading...",
|
||||||
|
|||||||
@@ -11,21 +11,29 @@
|
|||||||
*/
|
*/
|
||||||
export function getApiBaseUrl(): string {
|
export function getApiBaseUrl(): string {
|
||||||
if (typeof window === "undefined") {
|
if (typeof window === "undefined") {
|
||||||
|
console.log("[v0] getApiBaseUrl: Running on server (SSR)")
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
const { protocol, hostname, port } = window.location
|
const { protocol, hostname, port } = window.location
|
||||||
|
|
||||||
|
console.log("[v0] getApiBaseUrl - protocol:", protocol, "hostname:", hostname, "port:", port)
|
||||||
|
|
||||||
// If accessing via standard ports (80/443) or no port, assume we're behind a proxy
|
// If accessing via standard ports (80/443) or no port, assume we're behind a proxy
|
||||||
// In this case, use relative URLs so the proxy handles routing
|
// In this case, use relative URLs so the proxy handles routing
|
||||||
const isStandardPort = port === "" || port === "80" || port === "443"
|
const isStandardPort = port === "" || port === "80" || port === "443"
|
||||||
|
|
||||||
|
console.log("[v0] getApiBaseUrl - isStandardPort:", isStandardPort)
|
||||||
|
|
||||||
if (isStandardPort) {
|
if (isStandardPort) {
|
||||||
// Behind a proxy - use relative URL
|
// Behind a proxy - use relative URL
|
||||||
|
console.log("[v0] getApiBaseUrl: Detected proxy access, using relative URLs")
|
||||||
return ""
|
return ""
|
||||||
} else {
|
} else {
|
||||||
// Direct access - use explicit port 8008
|
// Direct access - use explicit port 8008
|
||||||
return `${protocol}//${hostname}:8008`
|
const baseUrl = `${protocol}//${hostname}:8008`
|
||||||
|
console.log("[v0] getApiBaseUrl: Direct access detected, using:", baseUrl)
|
||||||
|
return baseUrl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user