Commit Graph
36 Commits
Author SHA1 Message Date
kongkx e3fcaa4d38 feat: expose MinIO operator console
CI / Typecheck, test & build (push) Successful in 3m4s
CI / Deploy to Cloudflare Workers (push) Successful in 1m33s
2026-09-06 22:57:00 +08:00
kongkx c03617a6e6 Test API documentation viewer 2026-09-06 22:18:09 +08:00
kongkxandClaude Opus 5 5b3f5f7197 docs: add CLAUDE.md, expand AGENTS.md, correct stale README
The repo had no agent-facing project guidance: AGENTS.md contained only the
generated TanStack Intent skill pointers, and README.md described a stack
this app does not use.

- CLAUDE.md (new): API client contract (envelope, ApiError, single-flight
  401 refresh, the FormData Content-Type trap), the PERM catalog mirroring
  the backend permission classes, the route + NAV_GROUPS + PERM triad that
  must be edited together to add a page, and the useListPage/DataTable
  pattern.
- AGENTS.md: gotchas above the generated block, which is left untouched —
  global query retry policy, can() vs useCan() reactivity, the gig-admin-auth
  persist key, and that jsdom is opted into per file via a
  `// @vitest-environment jsdom` pragma since there is no vitest config.
- README.md: @tanstack/react-start is not a dependency (this is a plain Vite
  SPA, no SSR); cf:deploy no longer copies a shell to index.html; the feature
  list was a milestone-1 snapshot that omitted five shipped nav groups and
  still called moderation reports a future milestone.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013MADG54Y51wZkU3ViRjeSi
2026-09-06 21:16:29 +08:00
kongkx 6932906327 replace Start prerender with Vite SPA
CI / Typecheck, test & build (push) Successful in 3m54s
CI / Deploy to Cloudflare Workers (push) Successful in 1m51s
2026-08-31 01:28:48 +08:00
kongkx 848de4e309 fix CI SPA prerender build
CI / Typecheck, test & build (push) Failing after 2m3s
CI / Deploy to Cloudflare Workers (push) Has been skipped
2026-08-31 01:22:01 +08:00
kongkx a0d0bd8b08 fix SPA prerender build
CI / Typecheck, test & build (push) Successful in 3m0s
CI / Deploy to Cloudflare Workers (push) Failing after 57s
2026-08-31 01:03:53 +08:00
kongkx 41a6391ce6 fix: handle empty BASE_URL in buildUrl to prevent Invalid URL error
CI / Typecheck, test & build (push) Successful in 2m22s
CI / Deploy to Cloudflare Workers (push) Failing after 1m6s
When VITE_API_BASE_URL is unset, BASE_URL defaults to '', which causes
new URL(path, '') to throw TypeError: Invalid URL. Fall back to
location.origin (browser/jsdom) or 'http://localhost' (SSR).
2026-08-31 00:36:52 +08:00
kongkxandClaude Opus 5 78c28ed1bd feat(resume): admin bulk resume import
Adds the dashboard surface for the backend's /api/admin/v1/resume/import-batches
endpoints, and the multipart support it needed.

Client:
- rawRequest passes a FormData body through untouched and skips Content-Type,
  so the browser sets multipart/form-data *with the boundary*. Setting it by
  hand stripped the boundary and the server saw an empty upload — verified
  against the backend: 202 with the fix, 422 VALIDATION_ERROR without it.
  This was the first admin endpoint in the codebase to accept a file.
- New api.upload(). fetch reports no upload progress, so upload UI stays
  indeterminate rather than faking a percentage.

UI (/resume/import-batches, gated on admin:resume:read; writes on :manage):
- Upload dialog with countryCode and dry-run checked by default — seeing the
  collision report before creating accounts is almost always what you want.
- Detail sheet polls every 2s and stops once the batch is terminal. Clickable
  count tiles filter the per-resume report; step statuses surface `命中缓存` /
  `复用结果` so the dedup is visible.
- Confirm a dry run, retry failed rows, and resolve a missing contact.
  IMPORT_IDENTITY_TAKEN is shown inline — a collision is expected input, not
  an error toast.
- progress.total is 0 until unpacking finishes, so both views render 准备中…
  rather than "0 / 0", which would read as an empty batch.

types.gen.ts regenerated from the backend's admin spec.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-24 23:21:15 +08:00
kongkx 2c6fed7149 feat(sidebar): open API docs navigation link in new window
CI / Typecheck, test & build (push) Failing after 5m6s
CI / Deploy to Cloudflare Workers (push) Has been skipped
2026-08-16 20:18:47 +08:00
kongkxandClaude Opus 5 6ebf21ddd6 feat(db-studio): add gated entry to the database console
Adds 开发工具 → 数据库管理台, which exchanges the admin bearer token for a
single-use entry link (POST /api/admin/v1/internal-surfaces/db-studio/session)
and opens it in a new tab. The link sets an HttpOnly session cookie on the
console's own hostname, so it has to be opened by the browser rather than
fetched — the nginx gate in front of the console then re-checks the permission
on every request.

The tab is opened synchronously inside the click handler, before the request
resolves, or the popup blocker kills it; `noopener` is unusable there since it
makes window.open return null, so the opener is detached manually.

Gated on auth:db-studio:access. That key is `auth:`-prefixed rather than
`admin:` on purpose — PermissionSeeder syncs the admin role to every `admin:%`
key, which would grant database-owner SQL access to every admin account.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-15 09:39:51 +08:00
kongkx ae29e7b2fc feat(api-docs): render protected Scalar documentation 2026-08-12 09:05:03 +08:00
kongkx 1a5489a361 feat(users): integrate user info and services APIs into 3-tab detail panel with proper padding 2026-08-12 00:35:59 +08:00
kongkx 703d4dc583 fix confirm dialog style 2026-08-11 22:07:39 +08:00
kongkx 2e02eee66c fix(auth): handle zero-permission users gracefully and prevent redirect loops 2026-08-11 07:36:01 +08:00
kongkx 04c12ad340 feat(users): add user admin section and delegate login authorization to API 2026-08-10 23:04:41 +08:00
kongkx 88039d9ebe fix(deploy): configure pnpm allowBuilds and add Cloudflare deployment setup 2026-08-10 22:37:41 +08:00
kongkxandClaude Fable 5 ddfec7258f feat(roles): role management pages (super-admin)
- /roles — role table with create dialog and a permission-matrix sheet:
  collapsible per-module sections (selected/total counts, role's own
  modules start expanded) and a key/description filter that force-
  expands matches; super-admin role is read-only
- /admin-users — user search (Enter to run) with role assignment
  dialog; editing your own roles is blocked

Both nav items gate on auth:role:* keys, which only super-admin holds.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-12 06:42:51 +08:00
kongkxandClaude Fable 5 46056ae4b0 feat(auth): wire permission gating through menu, routes and actions
The store's can()/useCan() helpers existed but were unused. Now:
- src/auth/permissions.ts PERM catalog mirrors backend keys
- every nav item carries a permission; sidebar filter reuses can()
- requirePermission() beforeLoad guard on all child routes (direct URLs
  redirect home when the session lacks the key)
- useCan() hides/disables mutation buttons: moderation actions,
  retranslate, robot-author edit/pause, category + locale CRUD, and the
  reserved-SID assign path (admin:sid:override hint)
- 403 responses toast 无权限执行此操作; can() unit tests added

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-12 06:42:31 +08:00
kongkxandClaude Fable 5 6ed8de4de6 feat(dimzou): 文档/发布 monitoring pages
New Dimzou 内容 pages against the Dimzou admin API:
- /dimzou/documents — state filter (活跃/已归档/回收站), detail sheet
  with versions, translations and pending review counts
- /dimzou/publications — visibility filter, detail from row data

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-12 06:42:09 +08:00
kongkxandClaude Fable 5 ddf07bbf58 feat(exc): 专长交易 read-only monitoring pages
New nav group with four pages against the Exc admin API:
- /exc/demands — status/mode filters, detail sheet with related
  services, quotes and dispatch rounds
- /exc/dispatches — status/round filters
- /exc/orders — status/payment filters, detail sheet with items and
  状态流转 audit trail
- /exc/providers — status/verified filters, detail sheet with dispatch
  settings and status logs

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-11 14:54:58 +08:00
kongkxandClaude Fable 5 f5a7249969 feat(moderation): resource-centric reported comments/events pages
Rework 内容审核 pages around reported resources instead of individual
reports, matching the new backend endpoints: rows group all reports on
one comment/event, with a slide-over listing report details and
per-row actions 通过并屏蔽 (approve) / 驳回举报 (reject) / 撤销屏蔽
(revert). Filters: 待处理 / 已屏蔽 / 全部.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-11 14:20:37 +08:00
kongkxandClaude Fable 5 999d5353fd feat(moderation): comment/event report and dimzou translation pages
New 内容审核 nav group covering the remaining admin API groups:
- /comment-reports — status filter; hide/delete comment or dismiss
- /event-reports — status filter; hide/delete/resolve/dismiss
- /dimzou-translations — language/status filters, draft block progress,
  requeue machine translation

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-11 13:28:28 +08:00
kongkx ebe7665620 feat(studio): reflect account-voice / series-scope field split
Robot-author edit form and detail drop positioning/target_readers (now
series-level); persona + styles stay (routed to the account profile via the
admin API). Series detail shows positioning/target_readers. Types updated;
admin API types regenerated.
2026-07-11 08:42:39 +08:00
kongkx 9c308c28da feat(studio/articles): show drafting_model (LLM used for draft)
Adds drafting_model to the article type and surfaces it in the detail sheet
(provider / model line + raw JSON block). Regenerates admin API types.
2026-07-08 22:33:22 +08:00
kongkx 3f3a8347eb feat(studio/articles): Dimzou draft preview
Adds a 预览 action (enabled once an article has a Dimzou document) opening a
sheet that fetches and renders the draft — cover, title, summary, and body HTML
(typography/prose). Re-enables the @tailwindcss/typography plugin for prose.
2026-07-08 22:23:49 +08:00
kongkx a84e5dcb54 feat(studio/robot-authors): manual edit form
Adds an "编辑" action opening a sheet form to edit a robot author's status,
persona, positioning, target readers, and the article/image/publishing style
objects (JSON-validated as objects). Saves via the existing admin PUT endpoint,
then refetches the enriched list.
2026-07-08 22:12:34 +08:00
kongkx a809e8bb6b feat(studio/robot-authors): category filter + display_name & category columns
- searchable CategoryPicker (Popover+Command) reusable across studio pages,
  plus useCategoryOptions hook (shared tree query + id→name resolver)
- filter bar with category + status filters and a reset action
- new columns: account (avatar + display_name + uid), category name; persona
  demoted to a secondary column; display_name/category surfaced in detail sheet
2026-07-08 22:01:57 +08:00
kongkx 27fb6bbcd0 docs: project README (setup, scripts, architecture) 2026-07-07 22:48:36 +08:00
kongkx 64fb00590f test(api): client envelope/refresh/error tests; docs: README; fix: synchronous single-flight refresh reset 2026-07-07 22:47:02 +08:00
kongkx 61cb549e72 feat(studio): authors/series/articles/subtopics/briefs/style-presets + agent tokens (show-once) 2026-07-07 22:30:27 +08:00
kongkx 36df03baad feat(system): SID rules/lucky-numbers/assign, locales CRUD, devices list, robot session tokens 2026-07-07 22:23:21 +08:00
kongkx 21ef5c1c37 feat(categories): tree browser, CRUD dialog, pending approval queue with merge 2026-07-07 22:19:07 +08:00
kongkx eb617ce436 feat: api client, auth store, login, authed shell, data-table + CRUD kit 2026-07-07 22:15:08 +08:00
kongkx 95a3dee29f feat: admin OpenAPI type generation (gen:api) + envelope/entity types 2026-07-07 22:07:05 +08:00
kongkx 2cdb4c5a23 chore: shadcn/ui (24 components), tailwind v4 tokens, query/table/form/i18n deps 2026-07-07 22:04:43 +08:00
kongkx 0ca06fa00b chore: scaffold TanStack Start project 2026-07-07 21:52:49 +08:00