UI: echter Build hinter nginx, relative API-Pfade, Logs-Seite ehrlich

Vorher lief der Vite-ENTWICKLUNGSSERVER als Produktion, und vier Dateien
riefen hartkodiert http://localhost:8000 auf — vom PC aus fragte der Browser
damit den PC selbst nach Laufwerken (deshalb blieb das UI immer leer);
Settings nutzte ein nie gesetztes VITE_API_URL. Die Logs-Seite zeigte fest
einprogrammierte Fantasie-Einträge ("The Matrix gerippt").

- lib/api.ts: axios-Instanz mit baseURL /api; nginx proxied /api → api:8000
  (ein Origin, kein CORS), SSE-tauglich (proxy_buffering off)
- Dockerfile: Vite-Build → nginx:alpine statt npm run dev
- Logs + LiveLog von echtem /logs-Endpoint; MetadataPreview: echte Laufwerke
  aus /devices statt erfundener /dev/bluray-Optionen, startet echten Job

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-07-23 15:02:39 +02:00
parent eee3a83d0e
commit f2da1ad525
8 changed files with 111 additions and 61 deletions
+3 -5
View File
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react'
import axios from 'axios'
import { Clock, Activity, HardDrive, BarChart, AlertCircle, CheckCircle, Disc, Play, Pause, SkipForward } from 'lucide-react'
import { api } from '../lib/api'
import { useDarkMode } from '../context/ThemeContext'
import DeviceDiscovery from '../components/DeviceDiscovery'
import LiveLogSection from '../components/LiveLogSection'
@@ -24,11 +24,9 @@ interface Device {
status: 'empty' | 'ready' | 'ripping'
}
const API_URL = 'http://localhost:8000'
async function fetchJobs(): Promise<Job[]> {
try {
const response = await axios.get(`${API_URL}/jobs`)
const response = await api.get('/jobs')
return response.data
} catch {
return []
@@ -37,7 +35,7 @@ async function fetchJobs(): Promise<Job[]> {
async function fetchDevices(): Promise<Device[]> {
try {
const response = await axios.get(`${API_URL}/devices`)
const response = await api.get('/devices')
return response.data
} catch {
return []