Commit Graph

5 Commits

Author SHA1 Message Date
john 67348db026 Fix ops admin back link and local /admin-api proxy.
Use SPA root for the return-to-ops nav and proxy /admin-api in Vite dev so super-admin API calls work locally.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 08:59:07 +08:00
john 7357157cb2 Add super-admin section to ops SPA (role=admin gated)
New pages under /ops/admin: Summary dashboard, Users (list + edit +
recharge + create), LLM provider keys management, Billing ledger and
usage records.

Shared AuthContext (lib/auth.tsx) fetches /auth/status once and
supplies user/role to RequireOps, RequireAdmin, and OpsLayout.
OpsLayout shows a ⚙ 超管 nav link for admins. RequireOps now grants
admin users access without an extra ops-role probe.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 21:11:25 +08:00
john b5c600ad81 Split back-office into standalone memind_adm service
Carve the platform super-admin API (/admin-api) and plaza operations console
API (/api/ops/v1) out of the public server.mjs into their own process, so the
user-facing fleet can no longer be taken down or scaled by back-office traffic.

Architecture (split-ready, single process for now):
- admin-routes.mjs: createAdminApi / createOpsApi route factories (DI, single
  source of truth; the route logic moved verbatim out of server.mjs).
- admin-bootstrap.mjs: lean service container (user-auth, LLM providers, minimal
  plaza graph) with no user-facing daemons.
- admin-server.mjs: standalone entry with a console registry. ADMIN_CONSOLES
  selects which consoles a process mounts (default both), so splitting into two
  processes later is a config change, not a code change.
- admin-guard.mjs (+ tests): per-console host / IP-CIDR allowlists, letting the
  super-admin surface be locked down harder than moderation.

server.mjs no longer serves or mounts either surface. user-auth.mjs gains
pagination on listUsers/listUsageRecords/listBillingLedger to back the admin
dashboards. dev.mjs launches memind_adm; the ops SPA proxies /api to it while
/auth stays on the portal. Sessions are read from the shared cookie
(H5_COOKIE_DOMAIN=.tkmind.cn); login stays on the main domain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 20:55:23 +08:00
john befeedfd37 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>
2026-06-16 19:43:56 +08:00
John 2e14873f2d 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>
2026-06-15 15:04:43 -07:00