feat(login): Hinweis-Banner wenn Server nicht erreichbar

Ergaenzt den listStudios-Fix: statt stillem Fallback sieht der User jetzt
'Server nicht erreichbar', wenn die API beim Start nicht antwortet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 15:01:22 +02:00
parent 1846a00d07
commit 5a34d0a60f
+7 -1
View File
@@ -16,7 +16,7 @@ function writeAttempts(state) {
try { sessionStorage.setItem(ATTEMPT_KEY, JSON.stringify(state)); } catch {} try { sessionStorage.setItem(ATTEMPT_KEY, JSON.stringify(state)); } catch {}
} }
export default function Login({ verifyLogin, settings, version }) { export default function Login({ verifyLogin, settings, version, cloudUnreachable = false }) {
// Backend-Modus aus localStorage (per-Device, ähnlich Dark Mode). // Backend-Modus aus localStorage (per-Device, ähnlich Dark Mode).
// Beim Wechsel wird die App neu geladen, damit der Storage-Adapter neu initialisiert. // Beim Wechsel wird die App neu geladen, damit der Storage-Adapter neu initialisiert.
const [backend, setBackend] = useState(() => localStorage.getItem("rapport_backend") || "local"); const [backend, setBackend] = useState(() => localStorage.getItem("rapport_backend") || "local");
@@ -236,6 +236,12 @@ export default function Login({ verifyLogin, settings, version }) {
<div style={{ width: 32, height: 1.5, background: "#ddd8d0", margin: "16px auto 0" }} /> <div style={{ width: 32, height: 1.5, background: "#ddd8d0", margin: "16px auto 0" }} />
</div> </div>
{cloudUnreachable && (
<div style={{ marginBottom: 18, padding: "9px 14px", background: "#fff5f0", borderRadius: 8, border: "1px solid #f5c9b0", fontSize: 11, color: "#b5621e", textAlign: "center", lineHeight: 1.5 }}>
Server nicht erreichbar. Bitte Verbindung prüfen und neu laden.
</div>
)}
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
{isCloud && studios.length > 1 && ( {isCloud && studios.length > 1 && (
<div style={{ marginBottom: 14 }}> <div style={{ marginBottom: 14 }}>