Initial commit: Memind H5 portal with MindSpace, Plaza, and agent jobs.

Track application source and tests; exclude local env, user workspaces, and runtime data via .gitignore.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
John
2026-06-15 15:04:43 -07:00
commit 2e14873f2d
272 changed files with 64133 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import { NavLink, Outlet } from 'react-router-dom';
const links = [
{ to: '/', label: '审核队列' },
{ to: '/reports', label: '举报处理' },
{ to: '/featured', label: '精选管理' },
{ to: '/creators', label: '创作者' },
{ to: '/analytics', label: '数据看板' },
];
export function OpsLayout() {
return (
<div className="layout">
<header>
<h1>Plaza </h1>
<p style={{ color: '#68716c' }}></p>
</header>
<nav className="nav">
{links.map((link) => (
<NavLink
key={link.to}
to={link.to}
end={link.to === '/'}
className={({ isActive }) => (isActive ? 'active' : undefined)}
>
{link.label}
</NavLink>
))}
</nav>
<Outlet />
</div>
);
}
+55
View File
@@ -0,0 +1,55 @@
import { useEffect, useState } from 'react';
import { fetchAuthStatus, fetchReviewQueue } from '../api/client';
import { mindSpaceLoginUrl } from '../lib/site';
export function RequireOps({ children }: { children: React.ReactNode }) {
const [state, setState] = useState<'loading' | 'ok' | 'denied' | 'forbidden'>('loading');
const [message, setMessage] = useState<string | null>(null);
useEffect(() => {
void (async () => {
try {
const auth = await fetchAuthStatus();
if (!auth.authenticated) {
setState('denied');
return;
}
await fetchReviewQueue('status=pending_review&limit=1');
setState('ok');
} catch (err) {
const text = err instanceof Error ? err.message : '无运营权限';
if (text.includes('未授权') || text.includes('登录')) {
setState('denied');
} else {
setMessage(text);
setState('forbidden');
}
}
})();
}, []);
if (state === 'loading') return <p></p>;
if (state === 'denied') {
return (
<div className="card">
<h2></h2>
<p> MindSpace ops_rolereviewer / editor / ops_admin</p>
<a className="btn" href={mindSpaceLoginUrl()}>
</a>
</div>
);
}
if (state === 'forbidden') {
return (
<div className="card">
<h2></h2>
<p>{message ?? '当前账号没有 Plaza 运营权限。'}</p>
<p style={{ color: '#68716c' }}>
<code>node scripts/grant-ops-role.mjs admin ops_admin</code>
</p>
</div>
);
}
return children;
}