chore(ops): harden deployment and runtime setup
This commit is contained in:
parent
1d7e7c41c9
commit
c35bd5877e
30 changed files with 534 additions and 61 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { appVersion } from "@/lib/runtime/version";
|
||||
|
||||
export default function Footer() {
|
||||
return (
|
||||
|
|
@ -14,7 +15,7 @@ export default function Footer() {
|
|||
className="footer-logo"
|
||||
/>
|
||||
<p>Funktechnik Schubert – Service und technische Unterstützung für Funkgeräte, Messtechnik und Kommunikationstechnik.</p>
|
||||
<p className="copyright">© Funktechnik Schubert</p>
|
||||
<p className="copyright">© Funktechnik Schubert · v{appVersion}</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Website</h3>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import Image from "next/image";
|
|||
import { useRouter } from "next/navigation";
|
||||
import { useState, type FormEvent } from "react";
|
||||
|
||||
export default function AdminLoginForm({ nextPath = "/admin" }: { nextPath?: string }) {
|
||||
export default function AdminLoginForm({ nextPath = "/admin", adminConfigured = true }: { nextPath?: string; adminConfigured?: boolean }) {
|
||||
const router = useRouter();
|
||||
const [error, setError] = useState("");
|
||||
const [pending, setPending] = useState(false);
|
||||
|
|
@ -34,6 +34,11 @@ export default function AdminLoginForm({ nextPath = "/admin" }: { nextPath?: str
|
|||
<form className="admin-login-card" onSubmit={submit}>
|
||||
<Image src="/funktechnik_schubert_logo.jpg" alt="Funktechnik Schubert" width={1672} height={941} priority />
|
||||
<h1>Administration Login</h1>
|
||||
{!adminConfigured && (
|
||||
<p className="error">
|
||||
Admin-Zugang ist nicht konfiguriert. Bitte ADMIN_EMAIL, ADMIN_PASSWORD und ADMIN_SESSION_SECRET in der Umgebung setzen.
|
||||
</p>
|
||||
)}
|
||||
<label>
|
||||
E-Mail
|
||||
<input name="email" type="email" autoComplete="username" required />
|
||||
|
|
@ -43,7 +48,7 @@ export default function AdminLoginForm({ nextPath = "/admin" }: { nextPath?: str
|
|||
<input name="password" type="password" autoComplete="current-password" required />
|
||||
</label>
|
||||
{error && <p className="error">{error}</p>}
|
||||
<button className="button" type="submit" disabled={pending}>{pending ? "Anmeldung..." : "Anmelden"}</button>
|
||||
<button className="button" type="submit" disabled={pending || !adminConfigured}>{pending ? "Anmeldung..." : "Anmelden"}</button>
|
||||
</form>
|
||||
</main>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import Image from "next/image";
|
|||
import Link from "next/link";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import type { ReactNode } from "react";
|
||||
import { appVersion } from "@/lib/runtime/version";
|
||||
|
||||
const navItems = [
|
||||
["Dashboard", "/admin"],
|
||||
|
|
@ -40,6 +41,7 @@ export default function AdminShell({ children }: { children: ReactNode }) {
|
|||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
<p className="admin-version">v{appVersion}</p>
|
||||
<button className="admin-logout" type="button" onClick={logout}>Abmelden</button>
|
||||
</aside>
|
||||
<div className="admin-main">{children}</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue