updated
This commit is contained in:
parent
37faf87c98
commit
f8b6dae669
Binary file not shown.
File diff suppressed because one or more lines are too long
2
backend/web/dist/index.html
vendored
2
backend/web/dist/index.html
vendored
@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||||
<title>App</title>
|
<title>App</title>
|
||||||
<script type="module" crossorigin src="/assets/index-DeJUGWfr.js"></script>
|
<script type="module" crossorigin src="/assets/index-B0V3ux9Z.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-s1ZflJsu.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-s1ZflJsu.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@ -201,6 +201,47 @@ export default function App() {
|
|||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
const logout = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
// Backend löscht Session + Cookie (204)
|
||||||
|
await fetch('/api/auth/logout', { method: 'POST', cache: 'no-store' as any })
|
||||||
|
} catch {
|
||||||
|
// ignore
|
||||||
|
} finally {
|
||||||
|
// UI/State reset
|
||||||
|
setAuthed(false)
|
||||||
|
setAuthChecked(true)
|
||||||
|
|
||||||
|
setError(null)
|
||||||
|
setBusy(false)
|
||||||
|
|
||||||
|
// optional: UI zurücksetzen, damit nach erneutem Login alles "clean" ist
|
||||||
|
setSelectedTab('running')
|
||||||
|
setPlayerJob(null)
|
||||||
|
setPlayerExpanded(false)
|
||||||
|
setDetailsModelKey(null)
|
||||||
|
|
||||||
|
// optional: Listen leeren (verhindert kurz sichtbare "alte" Daten beim Login-Screen)
|
||||||
|
setJobs([])
|
||||||
|
setDoneJobs([])
|
||||||
|
setDoneCount(0)
|
||||||
|
setDonePage(1)
|
||||||
|
|
||||||
|
setModelsByKey({})
|
||||||
|
setModelsCount(0)
|
||||||
|
|
||||||
|
setCbOnlineByKeyLower({})
|
||||||
|
cbOnlineByKeyLowerRef.current = {}
|
||||||
|
setPendingWatchedRooms([])
|
||||||
|
setPendingAutoStartByKey({})
|
||||||
|
|
||||||
|
setOnlineModelsCount(0)
|
||||||
|
|
||||||
|
// optional: URL-Feld leeren
|
||||||
|
setSourceUrl('')
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
void checkAuth()
|
void checkAuth()
|
||||||
}, [checkAuth])
|
}, [checkAuth])
|
||||||
@ -2155,6 +2196,7 @@ export default function App() {
|
|||||||
|
|
||||||
<div className="mt-2 flex items-stretch gap-2">
|
<div className="mt-2 flex items-stretch gap-2">
|
||||||
{showPerfMon ? <PerformanceMonitor mode="inline" className="flex-1" /> : <div className="flex-1" />}
|
{showPerfMon ? <PerformanceMonitor mode="inline" className="flex-1" /> : <div className="flex-1" />}
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
onClick={() => setCookieModalOpen(true)}
|
onClick={() => setCookieModalOpen(true)}
|
||||||
@ -2162,6 +2204,14 @@ export default function App() {
|
|||||||
>
|
>
|
||||||
Cookies
|
Cookies
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
variant="secondary"
|
||||||
|
onClick={logout}
|
||||||
|
className="px-3 shrink-0"
|
||||||
|
>
|
||||||
|
Abmelden
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2172,6 +2222,9 @@ export default function App() {
|
|||||||
<Button variant="secondary" onClick={() => setCookieModalOpen(true)} className="h-9 px-3">
|
<Button variant="secondary" onClick={() => setCookieModalOpen(true)} className="h-9 px-3">
|
||||||
Cookies
|
Cookies
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button variant="secondary" onClick={logout} className="h-9 px-3">
|
||||||
|
Abmelden
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user