fast fertig

This commit is contained in:
2026-07-26 20:27:24 +02:00
parent 1370ad4ff7
commit c2fbb1b86f
19 changed files with 836 additions and 395 deletions
+3 -8
View File
@@ -15,7 +15,6 @@ export const runtime = "nodejs";
type UserRow = {
id: number;
name: string;
email: string;
role: UserRole;
created_at: string;
};
@@ -30,7 +29,9 @@ export default async function AdminUsersPage({
const params = await searchParams;
const users = db
.prepare("SELECT id, name, email, role, created_at FROM users ORDER BY name COLLATE NOCASE")
.prepare(
"SELECT id, name, role, created_at FROM users WHERE active = 1 ORDER BY name COLLATE NOCASE",
)
.all() as UserRow[];
const adminCount = users.filter((u) => u.role === "admin").length;
@@ -62,7 +63,6 @@ export default async function AdminUsersPage({
<thead>
<tr>
<th>Name</th>
<th>E-Mail</th>
<th>Rolle</th>
<th>Angelegt</th>
<th></th>
@@ -75,7 +75,6 @@ export default async function AdminUsersPage({
return (
<tr key={row.id}>
<td>{row.name}{isSelf && <span className="badge">Du</span>}</td>
<td className="mono">{row.email}</td>
<td>
<form action={changeUserRoleAction} className="inline-form">
<input type="hidden" name="id" value={row.id} />
@@ -121,10 +120,6 @@ export default async function AdminUsersPage({
Name *
<input name="name" required maxLength={100} />
</label>
<label>
E-Mail *
<input name="email" type="email" required maxLength={254} />
</label>
<label>
Passwort * (min. 10 Zeichen)
<input name="password" type="password" required minLength={10} maxLength={200} />