Remove embedded admin UI and redirect admins to standalone ops app.

Extract admin routes from the main SPA, add plaza-api bootstrap module, and track ops pnpm lockfile.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-06-16 19:43:56 +08:00
parent f818dd0307
commit befeedfd37
20 changed files with 1681 additions and 2333 deletions
-23
View File
@@ -1,23 +0,0 @@
import { useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import type { PortalUser } from '../types';
export function RequireAdmin({
user,
children,
}: {
user: PortalUser | null;
children: React.ReactNode;
}) {
const navigate = useNavigate();
const allowed = user?.role === 'admin';
useEffect(() => {
if (!allowed) {
navigate('/', { replace: true });
}
}, [allowed, navigate]);
if (!allowed) return null;
return children;
}