Update AppImage

This commit is contained in:
MacRimi
2025-11-11 17:01:25 +01:00
parent c255d9a5d8
commit 955bed80fb
5 changed files with 11 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ import {
import useSWR from "swr" import useSWR from "swr"
import { useState, useEffect } from "react" import { useState, useEffect } from "react"
import { type HardwareData, type GPU, type PCIDevice, type StorageDevice, fetcher } from "../types/hardware" import { type HardwareData, type GPU, type PCIDevice, type StorageDevice, fetcher } from "../types/hardware"
import { API_PORT } from "@/lib/api-config"
const parseLsblkSize = (sizeStr: string | undefined): number => { const parseLsblkSize = (sizeStr: string | undefined): number => {
if (!sizeStr) return 0 if (!sizeStr) return 0
@@ -247,7 +248,7 @@ export default function Hardware() {
const apiUrl = isStandardPort const apiUrl = isStandardPort
? `/api/gpu/${fullSlot}/realtime` ? `/api/gpu/${fullSlot}/realtime`
: `${protocol}//${hostname}:8008/api/gpu/${fullSlot}/realtime` : `${protocol}//${hostname}:${API_PORT}/api/gpu/${fullSlot}/realtime`
const response = await fetch(apiUrl, { const response = await fetch(apiUrl, {
method: "GET", method: "GET",

View File

@@ -5,6 +5,7 @@ import { Button } from "@/components/ui/button"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { ArrowLeft, Loader2 } from "lucide-react" import { ArrowLeft, Loader2 } from "lucide-react"
import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts" import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts"
import { API_PORT } from "@/lib/api-config"
interface MetricsViewProps { interface MetricsViewProps {
vmid: number vmid: number
@@ -121,7 +122,7 @@ export function MetricsView({ vmid, vmName, vmType, onBack }: MetricsViewProps)
const { protocol, hostname, port } = window.location const { protocol, hostname, port } = window.location
const isStandardPort = port === "" || port === "80" || port === "443" const isStandardPort = port === "" || port === "80" || port === "443"
const baseUrl = isStandardPort ? "" : `${protocol}//${hostname}:8008` const baseUrl = isStandardPort ? "" : `${protocol}//${hostname}:${API_PORT}`
const apiUrl = `${baseUrl}/api/vms/${vmid}/metrics?timeframe=${timeframe}` const apiUrl = `${baseUrl}/api/vms/${vmid}/metrics?timeframe=${timeframe}`

View File

@@ -3,6 +3,7 @@
import { useState, useEffect } from "react" import { useState, useEffect } from "react"
import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts" import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts"
import { Loader2 } from "lucide-react" import { Loader2 } from "lucide-react"
import { API_PORT } from "@/lib/api-config"
interface NetworkMetricsData { interface NetworkMetricsData {
time: string time: string
@@ -78,7 +79,7 @@ export function NetworkTrafficChart({
const { protocol, hostname, port } = window.location const { protocol, hostname, port } = window.location
const isStandardPort = port === "" || port === "80" || port === "443" const isStandardPort = port === "" || port === "80" || port === "443"
const baseUrl = isStandardPort ? "" : `${protocol}//${hostname}:8008` const baseUrl = isStandardPort ? "" : `${protocol}//${hostname}:${API_PORT}`
const apiUrl = interfaceName const apiUrl = interfaceName
? `${baseUrl}/api/network/${interfaceName}/metrics?timeframe=${timeframe}` ? `${baseUrl}/api/network/${interfaceName}/metrics?timeframe=${timeframe}`

View File

@@ -6,6 +6,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ".
import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts" import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts"
import { Loader2, TrendingUp, MemoryStick } from "lucide-react" import { Loader2, TrendingUp, MemoryStick } from "lucide-react"
import { useIsMobile } from "../hooks/use-mobile" import { useIsMobile } from "../hooks/use-mobile"
import { API_PORT } from "@/lib/api-config"
const TIMEFRAME_OPTIONS = [ const TIMEFRAME_OPTIONS = [
{ value: "hour", label: "1 Hour" }, { value: "hour", label: "1 Hour" },
@@ -91,7 +92,7 @@ export function NodeMetricsCharts() {
const { protocol, hostname, port } = window.location const { protocol, hostname, port } = window.location
const isStandardPort = port === "" || port === "80" || port === "443" const isStandardPort = port === "" || port === "80" || port === "443"
const baseUrl = isStandardPort ? "" : `${protocol}//${hostname}:8008` const baseUrl = isStandardPort ? "" : `${protocol}//${hostname}:${API_PORT}`
const apiUrl = `${baseUrl}/api/node/metrics?timeframe=${timeframe}` const apiUrl = `${baseUrl}/api/node/metrics?timeframe=${timeframe}`

View File

@@ -9,6 +9,7 @@ import { ScrollArea } from "./ui/scroll-area"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./ui/tabs" import { Tabs, TabsContent, TabsList, TabsTrigger } from "./ui/tabs"
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./ui/dialog" import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./ui/dialog"
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "./ui/sheet" import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "./ui/sheet"
import { API_PORT } from "@/lib/api-config"
import { import {
FileText, FileText,
Search, Search,
@@ -131,10 +132,10 @@ export function SystemLogs() {
if (isStandardPort) { if (isStandardPort) {
return endpoint return endpoint
} else { } else {
return `${protocol}//${hostname}:8008${endpoint}` return `${protocol}//${hostname}:${API_PORT}${endpoint}`
} }
} }
return `${protocol}//${hostname}:8008${endpoint}` return `${protocol}//${hostname}:${API_PORT}${endpoint}`
} }
useEffect(() => { useEffect(() => {