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" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||
<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">
|
||||
</head>
|
||||
<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(() => {
|
||||
void checkAuth()
|
||||
}, [checkAuth])
|
||||
@ -2152,9 +2193,10 @@ export default function App() {
|
||||
<div className="text-[11px] text-gray-500 dark:text-gray-400">
|
||||
{headerUpdatedText}
|
||||
</div>
|
||||
|
||||
|
||||
<div className="mt-2 flex items-stretch gap-2">
|
||||
{showPerfMon ? <PerformanceMonitor mode="inline" className="flex-1" /> : <div className="flex-1" />}
|
||||
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => setCookieModalOpen(true)}
|
||||
@ -2162,6 +2204,14 @@ export default function App() {
|
||||
>
|
||||
Cookies
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={logout}
|
||||
className="px-3 shrink-0"
|
||||
>
|
||||
Abmelden
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -2172,6 +2222,9 @@ export default function App() {
|
||||
<Button variant="secondary" onClick={() => setCookieModalOpen(true)} className="h-9 px-3">
|
||||
Cookies
|
||||
</Button>
|
||||
<Button variant="secondary" onClick={logout} className="h-9 px-3">
|
||||
Abmelden
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user