From f42a69c7edd2391212fc9638eb1db416b67143ac Mon Sep 17 00:00:00 2001 From: karim Date: Sun, 31 May 2026 12:40:31 +0200 Subject: [PATCH] =?UTF-8?q?cms:=20Autoren-Verwaltung=20(Admin),=20Cover-Up?= =?UTF-8?q?load,=20einheitliche=20Feldh=C3=B6hen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Admin-only Seite „Autor:innen": Nutzer anlegen/Passwort setzen/löschen via GoTrue-Admin-API (/api/users, requireAdmin). /api/me liefert isAdmin → Nav zeigt den Punkt nur Admins. - Cover-Bild: Upload-Knopf + Thumbnail (Bilder im Beitrag gingen schon über den WYSIWYG-Editor). - Editor-Metazeile: einzeilige Felder + Dropdowns einheitlich 38px hoch. Co-Authored-By: Claude Opus 4.8 --- cms/admin/src/App.jsx | 81 ++++++++++++++++++++++++++++++++++++- cms/admin/src/api.js | 5 +++ cms/admin/src/styles.css | 21 +++++++++- cms/api/src/auth.js | 6 +++ cms/api/src/index.js | 3 ++ cms/api/src/routes/users.js | 46 +++++++++++++++++++++ 6 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 cms/api/src/routes/users.js diff --git a/cms/admin/src/App.jsx b/cms/admin/src/App.jsx index 17aed88..c2469d3 100644 --- a/cms/admin/src/App.jsx +++ b/cms/admin/src/App.jsx @@ -72,13 +72,14 @@ function Dashboard({ email }) { const [current, setCurrent] = useState(null); const [query, setQuery] = useState(''); const [view, setView] = useState('content'); + const [me, setMe] = useState(null); const [msg, setMsg] = useState(null); async function refresh() { try { setEntries(await api.list()); } catch (e) { setMsg({ type: 'err', text: e.message }); } } - useEffect(() => { refresh(); }, []); + useEffect(() => { refresh(); api.getMe().then(setMe).catch(() => {}); }, []); useEffect(() => { if (!msg) return; const t = setTimeout(() => setMsg(null), 4000); return () => clearTimeout(t); }, [msg]); async function open(entry) { @@ -99,6 +100,7 @@ function Dashboard({ email }) { {email} @@ -108,6 +110,8 @@ function Dashboard({ email }) {
{view === 'profile' ? ( + ) : view === 'users' ? ( + ) : ( <>