diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..54c89c6 --- /dev/null +++ b/.env.example @@ -0,0 +1,32 @@ +# Public/local defaults only. Never put provider keys, payment signatures, or +# SMTP/SMS credentials in this file. +MIRAGENFLOW_HOST=127.0.0.1 +MIRAGENFLOW_PORT=3100 +MIRAGENFLOW_ACCESS_TOKEN_SECRET=replace-with-a-random-secret +MIRAGENFLOW_ACCESS_TOKEN_TTL_SECONDS=900 +MIRAGENFLOW_REFRESH_COOKIE=miragenflow_refresh +MIRAGENFLOW_COOKIE_SECURE=false +MIRAGENFLOW_ADMIN_EMAIL=admin@admin.com +MIRAGENFLOW_ADMIN_PASSWORD=admin +MIRAGENFLOW_ADMIN_MFA_REQUIRED=false +MIRAGENFLOW_ADMIN_MFA_SECRET= +MIRAGENFLOW_ADMIN_CAPTCHA_REQUIRED=false +# Development only: let the local super administrator execute its own approval. +# Production always requires another financial administrator. +MIRAGENFLOW_ADMIN_SELF_APPROVAL=true +MIRAGENFLOW_USER_MFA_REQUIRED=false +MIRAGENFLOW_USER_VERIFICATION_REQUIRED=false +MIRAGENFLOW_EMAIL_REGISTRATION_VERIFICATION_REQUIRED=false +MIRAGENFLOW_PHONE_REGISTRATION_VERIFICATION_REQUIRED=false +MIRAGENFLOW_CAPTCHA_REQUIRED=false +# Development only: allow provider emulators on localhost/private networks. +# Keep false in production (the production launcher forces this closed). +MIRAGENFLOW_ALLOW_LOCAL_PROVIDER_URLS=true +MIRAGENFLOW_PERSISTENCE_ADAPTER=memory +MIRAGENFLOW_QUEUE_ADAPTER=memory +DATABASE_URL= +REDIS_URL= +MIRAGENFLOW_CHANNEL_ENCRYPTION_KEY=replace-with-a-separate-random-key +MIRAGENFLOW_PAYMENT_WEBHOOK_SECRET=replace-with-a-random-webhook-secret +# Local fixture only: comma-separated channel ids to force retryable failures. +MIRAGENFLOW_FIXTURE_FAIL_CHANNELS= diff --git a/AGENTS.md b/AGENTS.md index cf9a71f..d3a4562 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,8 +21,8 @@ ## 前端规范 -- 前端使用 Vite、React、React Router、TypeScript、Ant Design、Tailwind、Zustand。 -- 编写 Ant Design 相关代码时,参考 https://ant.design/llms-full.txt 理解组件 API、示例和设计规范,并优先结合项目当前 antd 版本与既有写法。 +- 前端使用 Vite、React、React Router、TypeScript、TDesign、Tailwind、Zustand。 +- 编写 TDesign 相关代码时,优先结合项目当前锁定版本、共享 `packages/ui` Provider 和既有适配层写法;不要重新引入 Ant Design 或其他普通控件库。 - 外部服务请求统一放在 `web/src/services/api/`,由浏览器前端直连,不假设存在项目后端。 - 全局或跨页面状态优先放在 `web/src/stores/`。 - 已经放在全局 store 或全局 hook 中的状态/动作,组件需要时直接使用对应 store/hook,不要为了“纯组件”层层透传 props;避免一个组件传递过多参数。 @@ -34,11 +34,24 @@ - 不要新增只做简单转发的组件,例如只 `return {children}` 或只换个名字透传 props;直接在使用处使用真实组件或把逻辑写进当前文件。 - 页面私有 hook 放在对应页面目录下,例如 `admin/assets/use-admin-assets.ts`;只有多个页面真实复用的 hook 才放到外层 `hooks/`。 - 管理后台页面私有组件放到各自页面目录的 `components/` 下,例如 `admin/assets/components/`、`admin/prompts/components/`;不要为了单页面使用放到 `admin/components/` 共享目录。 -- 管理后台主题、背景、卡片阴影、表格配色等统一在 `web/src/lib/app-theme.ts`、`AppProviders` 或必要的全局 CSS 作用域中配置;页面私有组件不要自己写 `dark ? ...` 主题分支。 -- Ant Design 的 Dropdown、Menu、Select、Cascader、TreeSelect 等弹层背景、悬停态和选中态颜色统一通过 `web/src/lib/app-theme.ts` 的全局 Alias Token 与组件 Token 配置;不要在业务组件内为单个弹层覆盖颜色。 +- 前后台主题、背景、卡片阴影、表格配色等统一在 `web/src/lib/tdesign-theme.ts`、`AppProviders` 或必要的全局 CSS 作用域中配置;页面私有组件不要自己写 `dark ? ...` 主题分支。 +- TDesign 的 Dropdown、Menu、Select、Cascader、TreeSelect 等弹层背景、悬停态和选中态颜色统一通过 `web/src/lib/tdesign-theme.ts` 的主题变量与组件 Token 配置;不要在业务组件内为单个弹层覆盖颜色。 - 组件优先使用函数组件和现有 hooks,不新增大型状态管理方案。 -- UI 图标优先使用 `lucide-react` 或项目已经使用的 Ant Design 图标。 +- 前后台通用 UI 图标统一使用项目内本地化的 Lineicons 子集;只收录实际使用的图标,禁止引入 CDN、WebFont、完整图标目录或其他业务图标库。品牌标识、模型标识、媒体内容和画布连线等具有独立语义的视觉资产不按通用 UI 图标替换。 +- 用户端业务下拉不得使用浏览器原生 `} placeholder='请输入搜索内容' />; - -export default React.memo(Search); diff --git a/admin/src/layouts/components/Header/index.module.less b/admin/src/layouts/components/Header/index.module.less index f45eeae..449a8ef 100644 --- a/admin/src/layouts/components/Header/index.module.less +++ b/admin/src/layouts/components/Header/index.module.less @@ -9,3 +9,27 @@ justify-content: space-between; border-bottom: 1px solid var(--td-component-stroke); } + +.menuButton { + width: 40px; + height: 40px; +} + +.menuButton > svg { + width: 24px !important; + height: 24px !important; +} + +@media (max-width: 600px) { + .panel { + padding-left: 8px; + padding-right: 8px; + + :global { + .t-space { + min-width: 0; + gap: 4px; + } + } + } +} diff --git a/admin/src/layouts/components/Header/index.tsx b/admin/src/layouts/components/Header/index.tsx index c81bec2..a7f1eaa 100644 --- a/admin/src/layouts/components/Header/index.tsx +++ b/admin/src/layouts/components/Header/index.tsx @@ -1,11 +1,12 @@ import React, { memo } from 'react'; -import { Layout, Button, Space } from 'tdesign-react'; -import { ViewListIcon } from 'tdesign-icons-react'; +import { Layout } from '@miragenflow/ui/layout'; +import { Space } from '@miragenflow/ui/space'; +import { MiragenFlowButton } from '@miragenflow/ui'; +import { ViewListIcon } from 'components/LineIcons'; import { useAppDispatch, useAppSelector } from 'modules/store'; import { selectGlobal, toggleMenu } from 'modules/global'; import HeaderIcon from './HeaderIcon'; import { HeaderMenu } from '../Menu'; -import Search from './Search'; import Style from './index.module.less'; const { Header } = Layout; @@ -28,14 +29,15 @@ export default memo((props: { showMenu?: boolean }) => { } else { HeaderLeft = ( -