Commit Graph
365 Commits
Author SHA1 Message Date
xiaozhu 433c68998e updata:admin.css替用 2026-08-27 15:07:25 +08:00
xiaozhu 213490f8ac fix:input边框 2026-08-26 18:38:36 +08:00
xiaozhu e326cc1a93 update:Dialog替换 2026-08-26 16:48:19 +08:00
tao.chen d7f3db1cc4 refactor: replace Toast with Sonner 2026-08-26 14:06:12 +08:00
tao.chen f99b543100 update: ScriptsPage.tsx 2026-08-26 12:01:52 +08:00
tao.chen e79787fa61 update: unify 2026-08-26 11:10:29 +08:00
tao.chen b0281a73a0 update: replace table component 2026-08-26 11:00:01 +08:00
tao.chen 32d3309ecf update: replace table component 2026-08-26 10:47:54 +08:00
tao.chen 83190ea57e update: use components 2026-08-26 10:37:06 +08:00
tao.chen fe2fdb5ece feat: add ui components 2026-08-26 10:17:53 +08:00
tao.chen b9d14bbae7 update: role_code 2026-08-26 09:55:11 +08:00
tao.chen b3066d6940 fix: literal_error 2026-08-26 09:50:56 +08:00
tao.chen 6fe2d0b42e feat: role CRUD page 2026-08-25 22:52:00 +08:00
tao.chen 5ed7e12a23 fix: soft-deleted permission readd 2026-08-25 22:49:28 +08:00
tao.chen 498f06ed39 fix: soft-deleted permission readd 2026-08-25 22:49:19 +08:00
tao.chen 90955a2c1d feat: role CRUD 2026-08-25 22:33:25 +08:00
tao.chen 38e763d08e refactor: permission 2026-08-25 21:21:28 +08:00
tao.chen e186e5e541 refactor: use shadcn sidebar 2026-08-25 20:20:14 +08:00
tao.chen 9294c7fd9f update: use Button component in SchedulePage.tsx 2026-08-25 18:17:54 +08:00
tao.chen 4557fae037 fix: build error 2026-08-25 17:06:57 +08:00
tao.chen 3c79cd3a93 feat: add shadcn/ui 2026-08-25 16:58:23 +08:00
tao.chen 6a0b62fa6b Merge remote-tracking branch 'aliyun/develop' into develop 2026-08-25 16:55:13 +08:00
xiaozhu 12111de788 update:css样式拆分 2026-08-25 16:52:10 +08:00
tao.chen e805853b28 chore: docs 2026-08-25 14:17:05 +08:00
tao.chen 76aa2dcb27 fix: notebook 2026-08-25 11:35:51 +08:00
tao.chen 799f4e2a09 Merge branch 'develop-2' into develop 2026-08-25 11:27:50 +08:00
tao.chenandClaude Fable 5 91031342b8 refactor(frontend): consolidate features & components into single tree
把 components/admin/* 和 components/platform/* 共 11 个文件
移到对应 features/<name>/ 下,components/ 只保留跨特性共享的
common/ 子目录(features/admin/* 之前和 components/admin/* 同名
共存,迫使 features/admin/AdminPages.tsx 出现 barrel,顺带消除了
barrel 副作用 CSS 丢失的隐患)。

新的目录约定:
  - features/<name>/  = 特性模块,所有页面 / Modal / state / hooks
                         / routes 都在内,无 components/<name>/ 并列
  - components/common/ = 仅放 ≥2 个特性共用的 widgets
                         (Icon、Sidebar、Toast、Topbar、WelcomePanel)

改动:
  - 11 文件 git mv (components/{admin,platform}/* → features/*)
  - 8 文件的 Icon 相对路径 '../common/Icon' → '../../components/common/Icon'
  - 2 文件补 admin.css side-effect import(UserManagementPage /
    ProjectManagementPage 之前依赖 AdminPages barrel)
  - 3 文件(引用方)更新 import:SystemAdminPage、DashboardRoute、
    ScriptsPage
  - 删除 features/admin/AdminPages.tsx barrel(无消费者)
  - 删除空目录 components/admin、components/platform

验证:
  - pnpm typecheck 通过
  - pnpm build 通过,CSS 体积 35.11 kB 与重构前一致(无样式增减)
  - routes.ts / routes/platform.tsx 路径未动,route id 不变

踩坑:
  第一轮把 '../common/Icon' 错改成 '../../../components/common/Icon',
  typecheck 报 11 个 Cannot find module。原因:features/admin/ 和
  components/admin/ 都是 depth 2,'../../X' 在两边都解析到 app/X,
  只有 '../X' 才需要多一层。正确改法是 '../../components/common/Icon'。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 11:27:26 +08:00
tao.chen baa1e04af6 refactor: scriptWorkspaceStore.ts 2026-08-25 11:12:22 +08:00
tao.chen 2ed8d7b2cc refactor: useSchedulesStore.ts 2026-08-25 10:48:29 +08:00
tao.chenandClaude Fable 5 80c92f7fd4 fix(frontend): restore login & auth-loading styles with Tailwind
提交 6b77018 把 frontend/app/app.css 从 112 行砍到 91 行,
删除了 .login-* 与 .auth-loading 选择器,但 login.tsx /
AuthContext.tsx 的类名没同步迁移,导致:

  - /login 页面无样式(背景渐变、卡片阴影、输入框焦点环全部失效)
  - AuthContext 初次加载时的旋转 spinner 无样式

两处都用 Tailwind 任意值 [..] 语法精确复刻原 CSS,精确到
原始色值(#1677ff、#eef5fb 等),不引入新的 CSS 文件,
不修改 app.css、路由配置或依赖。

Spinner 用 Tailwind 内置 animate-spin(1s)替代原 0.8s
keyframes auth-spin,视觉差异肉眼不可见,如需精确复刻可在
app.css @theme 加 --animate-auth-spin。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 10:35:27 +08:00
tao.chen 97c8fe212b update: replace Icon with lucide-react 2026-08-25 09:59:59 +08:00
tao.chen fbb4cc0f1b feat: add lucide-react Icon 2026-08-24 18:41:49 +08:00
tao.chen 27a0504079 feat: register tailwindcss plugins 2026-08-24 18:35:10 +08:00
tao.chen 6b7701852f refactor: style css -> tailwindcss 2026-08-24 18:34:43 +08:00
tao.chen 9ce0b106fa update: init tailwindcss 2026-08-24 17:34:55 +08:00
tao.chen 95b588b96c refactor: update artifact list style 2026-08-24 17:29:19 +08:00
tao.chen b8246b1e9b refactor: update artifact list style 2026-08-24 17:28:55 +08:00
tao.chen b87f58be60 update: delete schedule 2026-08-24 15:26:25 +08:00
tao.chen de6d975fe9 chore: remove print 2026-08-24 15:02:26 +08:00
tao.chen ce8020e68c chore: web volumes 2026-08-24 13:58:24 +08:00
tao.chen b8a1e462ca chore: web volumes 2026-08-24 13:57:46 +08:00
tao.chen f09c1912fa chore: initialContent 2026-08-24 11:30:14 +08:00
tao.chen e02c66a7a6 chore: web volumes 2026-08-24 11:26:58 +08:00
tao.chen ba8a6ff79a chore: encrypt_secret.py 2026-08-24 11:05:01 +08:00
tao.chen 8ff399712f chore: encrypt_secret.py 2026-08-24 10:59:07 +08:00
tao.chen ddb87f66ee chore: remove boto3 2026-08-24 10:37:29 +08:00
tao.chen 24f40b5dd7 test(common.storage): cover async-only registry + factory contract
The drop-sync refactor is now contractually enforced:

* create_storage({"mode": "sync"|"async"|<any>}) raises StorageConfigError
  -- the regression we most want to catch is someone "restoring" the
  sync shape by re-introducing mode= handling.
* create_storage() preserves caller's dict, returns an AsyncStorageBackend
  subclass, and wraps constructor TypeError into a useful StorageConfigError.
* build_storage_config emits no mode key on either local or s3 branch.
* register_backend() refuses to silently overwrite a different class on
  the same name (collision guard), and accepts same-class re-registration.
* registry surfaces the built-in local + s3 classes after import; the
  conflict-test cleanup pattern avoids leaking global state across tests.

Adds [tool.pytest.ini_options] (asyncio_mode=auto, testpaths=tests) so
uv run --package common pytest common/tests works from the workspace root.

17 new tests, all green. Backend suite still 136 passed.
2026-08-24 10:30:22 +08:00
tao.chen 6050880c98 refactor(common.storage): drop sync storage abstraction and example_usage
The async-only direction was already the only one used in production:
* create_storage never accepted mode=sync; build_storage_config always
  emitted mode=async; zero callers referenced StorageBackend / SyncData
  / S3StorageBackend.sync / LocalStorageBackend.sync anywhere.
* Drop the parallel sync base class, the sync concrete classes in
  backends/local.py and backends/s3.py, and the boto3 dependency.
* Drop example_usage.py (zero importers; demonstration code, not part
  of the public surface).
* Rename LocalAsyncStorageBackend -> LocalStorageBackend,
  S3AsyncStorageBackend -> S3StorageBackend to reflect the single
  remaining class per type.
* Tighten create_storage: any mode=... key now raises StorageConfigError
  with the new pointer (settings.storage_backend controls behavior).
* Cleanup call sites: schedule.application.service.build_object_store
  no longer passes mode=async to create_storage.
* Cosmetic touch-ups in backend/services/storage.py and
  common/config.py docstrings where they still said "boto3" instead of
  "S3 client".

Public API surface preserved: AsyncStorageBackend / ObjectMeta /
create_storage / build_storage_config / register_backend all keep
their names and call signatures. backend tests: 136 passed.
2026-08-24 10:29:08 +08:00
tao.chen 8fa6203303 fix: schedule result api 2026-08-21 19:42:42 +08:00
tao.chenandClaude b493907775 feat(scripts): 跨 owner 懒加载目录树 + 跨用户可见 workspace/public
修两个后端接口问题:
1) /api/v1/workspace-directories 返回为空,目录树结构消失
2) 同 workspace 内脚本/数据互相可见但默认排除 private

后端改动
--------
* list_scripts / list_resources / list_workspace_directories 新增
  owner_user_id 可选 query 参数;缺省 = 当前请求者本人(scope 到
  workspace/{me}/...),传值时 scope 到该 owner 的子树。前端根加载
  默认只见自己一级,其他成员以折叠分组呈现。
* visibility 过滤统一:非 admin 请求者只返回 owner==me 或
  visibility ∈ {workspace, public};admin 跳过。owner=me 含自己
  的 private,owner=other 只剩其 workspace/public,排除他人 private。
* create_workspace_directory 两个分支 visibility 默认 'public'
  (非 private),使跨 owner 目录树可见;响应新增 owner_user_id 字段。
* platform.list_members 鉴权从 system_admin_context 放宽为
  系统管理员或该 workspace 活跃成员(让普通用户也能渲染同
  workspace 成员名册,用于跨 owner 分组)。
* main.py 注册 platform 模块(随 list_members 改动补齐导入)。
* .env.example 同步 common/config.py 26 个字段。

前端改动
--------
* ScriptExplorer.memberScriptGroups 改由 members 列表播种分组,
  display_name 取 members.display_name;inferredDirectories 现在按
  owner_user_id 标记,统一跨 owner 目录渲染。删除脚本目录页头与
  树分组标题的工作副本数量角标。
* WorkspaceTree 新增 ownerUserId 透传到 store.toggleExpanded;
  仅"我"的分组 mount 时 auto-expand,他人分组默认折叠,展开才
  调 loadOwnerGroup / owner-scoped loadScripts / loadChildren。
* scriptWorkspaceStore 引入 namespaced cache key
  (ownerCacheKey = `${ownerUserId ?? me}:${path}`),loadedScriptPaths
  / loadedChildPaths / loadedOwnerGroups 全部按 owner 隔离;
  toggleExpanded 用 loadPath === undefined 区分 group 头与真实
  目录,修"他人子目录点击不触发接口"的 loadPath 前缀误判 bug。
* api.ts / AuthContext 透传 ownerUserId 给 listScripts /
  listResources / listWorkspaceDirectories。

文档
----
* API.md: §3.2 创建目录 visibility 默认 public + 响应加 owner_user_id;
  §3.3.1 GET directories 加 owner_user_id 参数 + 响应字段;
  §3.4 GET scripts 改写为 owner 作用域 + visibility 过滤语义;
  §五.1 GET data-resources 新增,同一套统一语义;
  §7 intro 例外 — GET members 对系统管理员或 workspace 活跃成员开放。
* DEVELOP.md: Code layout 重写以反映 backend api/services/clients/
  schemas 拆分 + schedule domain/scheduling/application/execution/
  infrastructure 拆分 + common 子包(auth/storage/backends);
  Configuration 系统补全 26 个 settings 字段;新增
  "Owner-scoping + visibility (cross-owner browsing)" 小节;
  Per-service dev 注释用 uv run 的源布局要求;Add a new DAG endpoint /
  storage bucket 路径改为 backend/src/backend/api/* 与 services/*。

测试
----
* test_list_scripts_parent_path.py /
  test_resources.py 补充 owner_user_id 参数化直接调用 + LIKE
  前缀断言(workspace/{owner}/... 前缀)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-21 19:26:53 +08:00