feat: 合并代码后 系统设置 ui样式优化、bug修复、全局统一图标对齐等

This commit is contained in:
zhanjunhao
2026-11-10 17:27:36 +08:00
parent 23824dad32
commit 425077f94b
195 changed files with 3546 additions and 1984 deletions
+2
View File
@@ -4,6 +4,8 @@
## Ant Design 依赖统一(2026-11-10) ## Ant Design 依赖统一(2026-11-10)
按钮组和操作按钮的通用图标优先使用 `src/components/common/icons/ActionIcons.js`(基于 `@ant-design/icons`,兼容既有 size / color / ref);旧 `components/ui/icons` 已复用该入口。无准确对应项的专业图标及品牌图标保留。按钮内图标与文字整体居中,公共对齐见 `src/styles/action-icons.css`;不改业务回调、权限或加载/禁用条件。本条覆盖旧页面规范中按钮图标沿用 Lucide 的约定,非按钮装饰不批量替换。
通用 UI 使用 `antd`;旧 `src/components/ui` 是 Ant Design 契约适配层,保留值回调、Form API 和分页语义。模型品牌图标使用 `src/assets/brand-icons/` 的固定版本本地 SVG:首页与 `helpers/render.jsx` 只导入 `primitives`,完整变体仍经 `LobeHubIcon` 懒加载;头像容器使用 Ant `Avatar`,主题复用现有 Theme Context。不得重装 `@lobehub/icons`、`@lobehub/ui`、Radix UI、Floating UI、leva、antd-style 或 react-layout-kit。生成资产须通过脚本维护并保留 MIT 许可证及 hash。运行 `npm run check:ui` 检查源码、完整 lock 图和资产 hash;专用图表、流程画布、编辑器与引导保留。方案、风险和验证结果见 `docs/ui/ANTD_UNIFICATION_PLAN.md`;证据仅放忽略目录 `report/ui-unification/`。 通用 UI 使用 `antd`;旧 `src/components/ui` 是 Ant Design 契约适配层,保留值回调、Form API 和分页语义。模型品牌图标使用 `src/assets/brand-icons/` 的固定版本本地 SVG:首页与 `helpers/render.jsx` 只导入 `primitives`,完整变体仍经 `LobeHubIcon` 懒加载;头像容器使用 Ant `Avatar`,主题复用现有 Theme Context。不得重装 `@lobehub/icons`、`@lobehub/ui`、Radix UI、Floating UI、leva、antd-style 或 react-layout-kit。生成资产须通过脚本维护并保留 MIT 许可证及 hash。运行 `npm run check:ui` 检查源码、完整 lock 图和资产 hash;专用图表、流程画布、编辑器与引导保留。方案、风险和验证结果见 `docs/ui/ANTD_UNIFICATION_PLAN.md`;证据仅放忽略目录 `report/ui-unification/`。
## 三中心表格列设置统一(2026-11-07) ## 三中心表格列设置统一(2026-11-07)
+2
View File
@@ -4,6 +4,8 @@
## Ant Design 依赖统一(2026-11-10) ## Ant Design 依赖统一(2026-11-10)
按钮组和操作按钮的通用图标优先使用 `src/components/common/icons/ActionIcons.js`(基于 `@ant-design/icons`,兼容既有 size / color / ref);旧 `components/ui/icons` 已复用该入口。无准确对应项的专业图标及品牌图标保留。按钮内图标与文字整体居中,公共对齐见 `src/styles/action-icons.css`;不改业务回调、权限或加载/禁用条件。本条覆盖旧页面规范中按钮图标沿用 Lucide 的约定,非按钮装饰不批量替换。
通用 UI 使用 `antd`;旧 `src/components/ui` 是 Ant Design 契约适配层,保留值回调、Form API 和分页语义。模型品牌图标使用 `src/assets/brand-icons/` 的固定版本本地 SVG:首页与 `helpers/render.jsx` 只导入 `primitives`,完整变体仍经 `LobeHubIcon` 懒加载;头像容器使用 Ant `Avatar`,主题复用现有 Theme Context。不得重装 `@lobehub/icons`、`@lobehub/ui`、Radix UI、Floating UI、leva、antd-style 或 react-layout-kit。生成资产须通过脚本维护并保留 MIT 许可证及 hash。运行 `npm run check:ui` 检查源码、完整 lock 图和资产 hash;专用图表、流程画布、编辑器与引导保留。方案、风险和验证结果见 `docs/ui/ANTD_UNIFICATION_PLAN.md`;证据仅放忽略目录 `report/ui-unification/`。 通用 UI 使用 `antd`;旧 `src/components/ui` 是 Ant Design 契约适配层,保留值回调、Form API 和分页语义。模型品牌图标使用 `src/assets/brand-icons/` 的固定版本本地 SVG:首页与 `helpers/render.jsx` 只导入 `primitives`,完整变体仍经 `LobeHubIcon` 懒加载;头像容器使用 Ant `Avatar`,主题复用现有 Theme Context。不得重装 `@lobehub/icons`、`@lobehub/ui`、Radix UI、Floating UI、leva、antd-style 或 react-layout-kit。生成资产须通过脚本维护并保留 MIT 许可证及 hash。运行 `npm run check:ui` 检查源码、完整 lock 图和资产 hash;专用图表、流程画布、编辑器与引导保留。方案、风险和验证结果见 `docs/ui/ANTD_UNIFICATION_PLAN.md`;证据仅放忽略目录 `report/ui-unification/`。
## 三中心表格列设置统一(2026-11-07) ## 三中心表格列设置统一(2026-11-07)
+24
View File
@@ -121,3 +121,27 @@
| 差异检查 | `git diff --check` 通过 | | 差异检查 | `git diff --check` 通过 |
资源控制:重任务串行、单测并发为 1,Node 堆上限 2,944MB;开始前检查 CPU、物理内存及提交空间,CPU 高时延后启动,运行中每约 10 秒采样,低物理内存或提交空间时停止本任务。构建输出至系统临时目录,关闭压缩体积统计;构建进程采样工作集最高 2,475MB,可用物理内存最低 10,646MB,可用提交空间最低 15,944MB,未触发内存停止阈值。测试和浏览器记录的是包装进程工作集,不将其视为整个子进程树的内存峰值;未结束其他任务的进程。 资源控制:重任务串行、单测并发为 1,Node 堆上限 2,944MB;开始前检查 CPU、物理内存及提交空间,CPU 高时延后启动,运行中每约 10 秒采样,低物理内存或提交空间时停止本任务。构建输出至系统临时目录,关闭压缩体积统计;构建进程采样工作集最高 2,475MB,可用物理内存最低 10,646MB,可用提交空间最低 15,944MB,未触发内存停止阈值。测试和浏览器记录的是包装进程工作集,不将其视为整个子进程树的内存峰值;未结束其他任务的进程。
## 10. 操作按钮图标统一(2026-11-10 后续)
按本轮要求,按钮组与操作按钮优先使用 Ant Design 图标,保留没有准确对应项的旧图标。此规则覆盖旧页面规范中按钮图标沿用 Lucide 的约定;导航、说明、品牌、图表和专业功能装饰不进行整库替换,继续保留 Lucide 依赖。
- 新增 `components/common/icons/ActionIcons.js`,使用 `@ant-design/icons` 公共导出,兼容旧 `size` 预设、数字尺寸、颜色、样式、className、DOM ref 和事件;收藏星标仍区分空心与实心,右上箭头保留方向。旧 `components/ui/icons.jsx` 保留原导出名称并接到该入口。将已在 Ant Design 依赖图中的 `@ant-design/icons` 声明为直接依赖,本次没有新增安装包或改变锁定版本。
- 首轮扫描覆盖 188 个文件、576 处按钮图标;459 处直接 Lucide 用法和 97 处旧兼容图标映射到 Ant Design。20 处专业/组合图形保留,例如 Sparkles、ImagePlus、Dices、Wand2、UserCheck、FileUp、Cpu 等,不用语义不符的近似图标替代。比较、实验、清除和侧栏展开分别使用 DiffOutlined、ExperimentOutlined、ClearOutlined、MenuUnfoldOutlined。完整位置清单保存在本地审计记录。
- 补充处理静态扫描不易识别的入口:富文本加粗、斜体、下划线、列表、撤销/重做与清除格式,主题切换的太阳/月亮,模板按钮的图片图标,以及密钥复制按钮的手写剪贴板 SVG。富文本引用和图片加号保留原图标,编辑器实现和命令保持原样。
- `styles/action-icons.css` 统一 Ant 按钮图标容器与旧原生操作按钮的对齐:图标与文字垂直居中,内容组在按钮内水平居中,单图标按钮双向居中。原生按钮默认规则放在 Tailwind components 层,保留页面布局、响应式隐藏及明确的间距;Ant 规则在层外,不新增 `!important` 或颜色值。已有局部 Lucide 尺寸规则同时支持新图标。
- AST 对照覆盖 151 个源码文件:API 调用及按钮处理、禁用、加载、链接与提交属性保持一致;只对新旧图标 JSX 别名做归一化,不放宽请求或回调比较。测试加载器接入实际图标模块;旧图标 ref 测试更新为 Ant/保留图标契约,并修正旧禁用原因测试的翻译插值 mock,保留原因和时间断言。
浏览器使用单个离屏有头 Chrome Context,覆盖 1920×1000 / 393×851 与浅/深色四种组合:136 项按钮几何对齐检查通过,覆盖大小、按钮组、链接、原生/兼容按钮、纯图标、加载、禁用和保留图标;另验证 Tooltip DOM ref、点击回调、收藏切换及实际 Quill 工具栏加粗操作。10 个富文本按钮均居中,其中 8 个使用 Ant 图标。浏览器运行错误与业务写请求均为 0。此为实际组件的隔离验证,不代表真实账号全站像素或业务验收。
本轮不执行生产构建或生产环境测试。快照、脚本、截图、单测/静态检查日志及 CPU/内存采样仅保存在忽略目录 `report/ui-unification/button-icons/`;重任务串行、单测并发 1、Node 堆上限 2,944MB,未结束其他任务进程。
| 检查 | 本轮结果 |
| ------------- | ------------------------------------------------------------------ |
| 全量串行单测 | 662/662 通过,失败、跳过和取消均为 0,约 159 秒 |
| 全仓 ESLint | 0 错误、0 警告,零警告门禁通过 |
| 全仓 Prettier | 所有匹配文件通过 |
| UI 审计 | 源码、完整 lock 图和品牌 SVG 资产 hash 检查通过 |
| 浏览器 | 浅深色 × 桌面/移动端,136 项对齐检查、真实组件交互和富文本加粗通过 |
| 源码契约 | 151 个文件的 API 与操作处理属性对照通过,图标 JSX 别名单独归一化 |
| 差异检查 | `git diff --check` 通过 |
+1
View File
@@ -8,6 +8,7 @@
"name": "react-template", "name": "react-template",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@ant-design/icons": "^5.6.1",
"@dagrejs/dagre": "^1.1.4", "@dagrejs/dagre": "^1.1.4",
"@visactor/react-vchart": "~1.8.8", "@visactor/react-vchart": "~1.8.8",
"@visactor/vchart": "~1.8.8", "@visactor/vchart": "~1.8.8",
+3 -2
View File
@@ -4,6 +4,7 @@
"private": true, "private": true,
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@ant-design/icons": "^5.6.1",
"@dagrejs/dagre": "^1.1.4", "@dagrejs/dagre": "^1.1.4",
"@visactor/react-vchart": "~1.8.8", "@visactor/react-vchart": "~1.8.8",
"@visactor/vchart": "~1.8.8", "@visactor/vchart": "~1.8.8",
@@ -82,6 +83,7 @@
"@playwright/test": "^1.64.1", "@playwright/test": "^1.64.1",
"@vitejs/plugin-react": "^4.2.1", "@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"esbuild": "0.21.5",
"eslint": "8.57.0", "eslint": "8.57.0",
"eslint-plugin-header": "^3.1.1", "eslint-plugin-header": "^3.1.1",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
@@ -91,8 +93,7 @@
"postcss": "^8.5.3", "postcss": "^8.5.3",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"tailwindcss": "^3", "tailwindcss": "^3",
"vite": "5.4.21", "vite": "5.4.21"
"esbuild": "0.21.5"
}, },
"proxy": "http://localhost:3000", "proxy": "http://localhost:3000",
"engines": { "engines": {
@@ -17,15 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { ChevronDown as ActionChevronDown } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { ChevronDown } from 'lucide-react';
import './collapsible-panel.css'; import './collapsible-panel.css';
const CollapsibleHeader = ({ icon, title, isOpen, onToggle, extra }) => ( const CollapsibleHeader = ({ icon, title, isOpen, onToggle, extra }) => (
<button <button
type='button' type='button'
aria-expanded={isOpen} aria-expanded={isOpen}
className='w-full text-left flex items-center justify-between gap-2 cursor-pointer select-none px-5 py-4 bg-white dark:bg-gray-800 rounded-xl shadow-sm hover:shadow-md transition-all border border-gray-100 dark:border-gray-700' className='app-action-button w-full text-left flex items-center justify-between gap-2 cursor-pointer select-none px-5 py-4 bg-white dark:bg-gray-800 rounded-xl shadow-sm hover:shadow-md transition-all border border-gray-100 dark:border-gray-700'
onClick={onToggle} onClick={onToggle}
> >
<span className='flex items-center gap-2 min-w-0 flex-wrap'> <span className='flex items-center gap-2 min-w-0 flex-wrap'>
@@ -35,7 +35,7 @@ const CollapsibleHeader = ({ icon, title, isOpen, onToggle, extra }) => (
</span> </span>
{extra} {extra}
</span> </span>
<ChevronDown <ActionChevronDown
aria-hidden='true' aria-hidden='true'
className={`w-5 h-5 flex-shrink-0 text-gray-400 transition-transform duration-300 ${isOpen ? 'rotate-180' : ''}`} className={`w-5 h-5 flex-shrink-0 text-gray-400 transition-transform duration-300 ${isOpen ? 'rotate-180' : ''}`}
/> />
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { import {
Button, Button,
@@ -27,7 +28,7 @@ import {
Tag, Tag,
Typography, Typography,
} from '@/components/ui'; } from '@/components/ui';
import { ClipboardList, Download } from 'lucide-react'; import { ClipboardList } from 'lucide-react';
import { ChangeText, OrgNameCell, ReasonTags, SectionCard } from './shared'; import { ChangeText, OrgNameCell, ReasonTags, SectionCard } from './shared';
import { import {
daysSince, daysSince,
@@ -471,7 +472,7 @@ export const ActionCenter = ({ lists, activeTab, onTabChange, cny, t }) => (
tabBarExtraContent={ tabBarExtraContent={
<Button <Button
size='small' size='small'
icon={<Download className='w-3.5 h-3.5' />} icon={<ActionDownload className='w-3.5 h-3.5' />}
disabled={lists[activeTab].length === 0} disabled={lists[activeTab].length === 0}
onClick={() => onClick={() =>
exportList(activeTab, lists[activeTab], cny, t, lists.atRisk) exportList(activeTab, lists[activeTab], cny, t, lists.atRisk)
@@ -17,13 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Banner, Button, Card, Tag, Tooltip } from '@/components/ui'; import { Banner, Button, Card, Tag, Tooltip } from '@/components/ui';
import { import {
AlertOctagon, AlertOctagon,
AlertTriangle, AlertTriangle,
CheckCircle2, CheckCircle2,
Download,
Info, Info,
Lightbulb, Lightbulb,
} from 'lucide-react'; } from 'lucide-react';
@@ -58,7 +58,7 @@ export const ReportHeader = ({ report, onExport, t }) => {
</div> </div>
</div> </div>
<Button <Button
icon={<Download className='w-4 h-4' />} icon={<ActionDownload className='w-4 h-4' />}
onClick={onExport} onClick={onExport}
disabled={!report.orgs?.length} disabled={!report.orgs?.length}
> >
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { import {
Button, Button,
@@ -27,7 +28,7 @@ import {
Tag, Tag,
Typography, Typography,
} from '@/components/ui'; } from '@/components/ui';
import { Download, Search, Table2, UserCog } from 'lucide-react'; import { Search, Table2, UserCog } from 'lucide-react';
import { ChangeText, OrgNameCell, SectionCard } from './shared'; import { ChangeText, OrgNameCell, SectionCard } from './shared';
import { import {
ALERT_LEVELS, ALERT_LEVELS,
@@ -429,7 +430,7 @@ export const OrgDetailTable = ({ report, filter, setFilter, cny, t }) => {
) : null} ) : null}
<Button <Button
className='ml-auto' className='ml-auto'
icon={<Download className='w-4 h-4' />} icon={<ActionDownload className='w-4 h-4' />}
onClick={onExport} onClick={onExport}
disabled={rows.length === 0} disabled={rows.length === 0}
> >
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { MessageCircle as ActionMessageCircle } from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Avatar } from '@/components/ui'; import { Avatar } from '@/components/ui';
import { MessageCircle, ScanLine } from 'lucide-react'; import { MessageCircle, ScanLine } from 'lucide-react';
@@ -177,9 +178,9 @@ const AuthCustomerServiceFloat = () => {
) : agent.wecom_url ? ( ) : agent.wecom_url ? (
<button <button
onClick={() => window.open(agent.wecom_url, '_blank')} onClick={() => window.open(agent.wecom_url, '_blank')}
className='w-full flex items-center justify-center gap-1.5 px-3 py-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white text-xs font-medium rounded-lg transition-colors' className='app-action-button w-full flex items-center justify-center gap-1.5 px-3 py-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white text-xs font-medium rounded-lg transition-colors'
> >
<MessageCircle size={12} /> <ActionMessageCircle size={12} />
{t('联系客服')} {t('联系客服')}
</button> </button>
) : null} ) : null}
+5 -4
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { ArrowRight as ActionArrowRight } from '@/components/common/icons/ActionIcons';
import React, { import React, {
useContext, useContext,
useEffect, useEffect,
@@ -66,7 +67,7 @@ import DiscordIcon from '../common/logo/DiscordIcon';
import TwoFAVerification from './TwoFAVerification'; import TwoFAVerification from './TwoFAVerification';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import AuthBackground from '../common/AuthBackground'; import AuthBackground from '../common/AuthBackground';
import { ArrowRight, Shield, Smartphone, QrCode } from 'lucide-react'; import { Shield, Smartphone, QrCode } from 'lucide-react';
import GlassCard from './GlassCard'; import GlassCard from './GlassCard';
import AuthCardHeader from './AuthCardHeader'; import AuthCardHeader from './AuthCardHeader';
import AuthLoginTabs from './AuthLoginTabs'; import AuthLoginTabs from './AuthLoginTabs';
@@ -741,7 +742,7 @@ const LoginForm = () => {
{/* 邮箱登录按钮 */} {/* 邮箱登录按钮 */}
<button <button
onClick={handleEmailLoginClick} onClick={handleEmailLoginClick}
className='group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 overflow-hidden' className='app-action-button group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 overflow-hidden'
> >
{/* 闪光效果 */} {/* 闪光效果 */}
<div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' /> <div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' />
@@ -750,7 +751,7 @@ const LoginForm = () => {
<span className='relative z-10 font-medium text-sm'> <span className='relative z-10 font-medium text-sm'>
{t('邮箱/用户名 登录')} {t('邮箱/用户名 登录')}
</span> </span>
<ArrowRight <ActionArrowRight
size={16} size={16}
className='relative z-10 group-hover:translate-x-1 transition-transform' className='relative z-10 group-hover:translate-x-1 transition-transform'
/> />
@@ -946,7 +947,7 @@ const LoginForm = () => {
className='auth-login-submit' className='auth-login-submit'
> >
<span className='font-semibold'>{t('登 录')}</span> <span className='font-semibold'>{t('登 录')}</span>
<ArrowRight size={16} /> <ActionArrowRight size={16} />
</Button> </Button>
<Button <Button
+8 -3
View File
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { Button, Toast, Banner } from '@/components/ui'; import { Button, Toast, Banner } from '@/components/ui';
import { Copy } from 'lucide-react';
import { copy as copyText } from '../../helpers/utils'; import { copy as copyText } from '../../helpers/utils';
/** /**
@@ -69,7 +69,7 @@ const OrgCredentialResult = ({ creds, onLogin }) => {
<Button <Button
size='small' size='small'
theme='borderless' theme='borderless'
icon={<Copy size={14} />} icon={<ActionCopy size={14} />}
onClick={() => copy(value)} onClick={() => copy(value)}
aria-label={t('复制')} aria-label={t('复制')}
/> />
@@ -98,7 +98,12 @@ const OrgCredentialResult = ({ creds, onLogin }) => {
<Row label={t('登录名')} value={creds.owner_login_name} mono /> <Row label={t('登录名')} value={creds.owner_login_name} mono />
<Row label={t('初始密码')} value={creds.initial_password} mono /> <Row label={t('初始密码')} value={creds.initial_password} mono />
</div> </div>
<Button size='large' block icon={<Copy size={14} />} onClick={copyAll}> <Button
size='large'
block
icon={<ActionCopy size={14} />}
onClick={copyAll}
>
{t('复制全部凭证')} {t('复制全部凭证')}
</Button> </Button>
{onLogin && ( {onLogin && (
+6 -5
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { ArrowRight as ActionArrowRight } from '@/components/common/icons/ActionIcons';
import React, { import React, {
useContext, useContext,
useEffect, useEffect,
@@ -64,7 +65,7 @@ import AuthBackground from '../common/AuthBackground';
import GlassCard from './GlassCard'; import GlassCard from './GlassCard';
import AuthCardHeader from './AuthCardHeader'; import AuthCardHeader from './AuthCardHeader';
import AuthLoginTabs from './AuthLoginTabs'; import AuthLoginTabs from './AuthLoginTabs';
import { ArrowRight, Shield, Smartphone, QrCode } from 'lucide-react'; import { Shield, Smartphone, QrCode } from 'lucide-react';
import AgreementModal from '../common/DocumentRenderer/AgreementModal'; import AgreementModal from '../common/DocumentRenderer/AgreementModal';
import { import {
isMiniProgramWebView, isMiniProgramWebView,
@@ -606,7 +607,7 @@ const RegisterForm = () => {
<button <button
onClick={handleEmailRegisterClick} onClick={handleEmailRegisterClick}
disabled={emailRegisterLoading} disabled={emailRegisterLoading}
className='group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 overflow-hidden' className='app-action-button group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 overflow-hidden'
> >
{/* 闪光效果 */} {/* 闪光效果 */}
<div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' /> <div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' />
@@ -615,7 +616,7 @@ const RegisterForm = () => {
<span className='relative z-10 font-medium text-sm'> <span className='relative z-10 font-medium text-sm'>
{t('使用 用户名 注册')} {t('使用 用户名 注册')}
</span> </span>
<ArrowRight <ActionArrowRight
size={16} size={16}
className='relative z-10 group-hover:translate-x-1 transition-transform' className='relative z-10 group-hover:translate-x-1 transition-transform'
/> />
@@ -835,7 +836,7 @@ const RegisterForm = () => {
registerLoading || registerLoading ||
((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms)
} }
className='group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to disabled:from-gray-400 disabled:to-gray-500 text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 disabled:cursor-not-allowed disabled:hover:translate-y-0 overflow-hidden' className='app-action-button group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to disabled:from-gray-400 disabled:to-gray-500 text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 disabled:cursor-not-allowed disabled:hover:translate-y-0 overflow-hidden'
> >
{/* 闪光效果 */} {/* 闪光效果 */}
<div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' /> <div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' />
@@ -847,7 +848,7 @@ const RegisterForm = () => {
<span className='relative z-10 font-semibold'> <span className='relative z-10 font-semibold'>
{t('注 册')} {t('注 册')}
</span> </span>
<ArrowRight <ActionArrowRight
size={16} size={16}
className='relative z-10 group-hover:translate-x-1 transition-transform' className='relative z-10 group-hover:translate-x-1 transition-transform'
/> />
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { X as ActionX } from '@/components/common/icons/ActionIcons';
import React, { useState, useCallback } from 'react'; import React, { useState, useCallback } from 'react';
import { Modal } from '@/components/ui'; import { Modal } from '@/components/ui';
import { X, Shield, Scale, ScrollText, ExternalLink } from 'lucide-react'; import { Shield, Scale, ScrollText, ExternalLink } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import DocumentRenderer from './index'; import DocumentRenderer from './index';
import { useIsMobile } from '../../../hooks/common/useIsMobile'; import { useIsMobile } from '../../../hooks/common/useIsMobile';
@@ -137,10 +138,10 @@ const AgreementModal = ({ visible, type, onClose }) => {
</a> </a>
<button <button
onClick={onClose} onClick={onClose}
className='p-1.5 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100/80 dark:hover:bg-gray-800/80 transition-colors' className='app-action-button p-1.5 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100/80 dark:hover:bg-gray-800/80 transition-colors'
aria-label={t('关闭')} aria-label={t('关闭')}
> >
<X size={16} /> <ActionX size={16} />
</button> </button>
</div> </div>
</div> </div>
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
ChevronUp as ActionChevronUp,
ArrowLeft as ActionArrowLeft,
Printer as ActionPrinter,
} from '@/components/common/icons/ActionIcons';
import { writeClipboardText } from '../../../helpers/clipboard'; import { writeClipboardText } from '../../../helpers/clipboard';
import React, { useEffect, useState, useCallback, useRef } from 'react'; import React, { useEffect, useState, useCallback, useRef } from 'react';
import { API, showError } from '../../../helpers'; import { API, showError } from '../../../helpers';
@@ -26,11 +31,8 @@ import {
Shield, Shield,
ScrollText, ScrollText,
ExternalLink, ExternalLink,
ChevronUp,
ArrowLeft,
BookOpen, BookOpen,
Scale, Scale,
Printer,
} from 'lucide-react'; } from 'lucide-react';
import { useNavigate, useLocation } from 'react-router-dom'; import { useNavigate, useLocation } from 'react-router-dom';
@@ -509,12 +511,20 @@ const DocumentRenderer = ({
<button <button
onClick={scrollToTop} onClick={scrollToTop}
className={`sticky bottom-3 ml-auto block p-2 bg-white/95 dark:bg-gray-800/95 backdrop-blur-md rounded-full shadow-lg border border-gray-200 dark:border-gray-700 hover:shadow-xl hover:-translate-y-0.5 hover:bg-white dark:hover:bg-gray-800 transition-all duration-200 ${ className={[
'app-action-button',
`sticky bottom-3 ml-auto block p-2 bg-white/95 dark:bg-gray-800/95 backdrop-blur-md rounded-full shadow-lg border border-gray-200 dark:border-gray-700 hover:shadow-xl hover:-translate-y-0.5 hover:bg-white dark:hover:bg-gray-800 transition-all duration-200 ${
showBackToTop ? 'opacity-100' : 'opacity-0 pointer-events-none' showBackToTop ? 'opacity-100' : 'opacity-0 pointer-events-none'
}`} }`,
]
.filter(Boolean)
.join(' ')}
aria-label={t('返回顶部')} aria-label={t('返回顶部')}
> >
<ChevronUp size={16} className='text-gray-600 dark:text-gray-300' /> <ActionChevronUp
size={16}
className='text-gray-600 dark:text-gray-300'
/>
</button> </button>
</div> </div>
); );
@@ -549,9 +559,9 @@ const DocumentRenderer = ({
<div className='max-w-3xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between gap-2'> <div className='max-w-3xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between gap-2'>
<button <button
onClick={smartBack} onClick={smartBack}
className='group inline-flex items-center gap-1.5 px-2.5 py-1.5 -ml-2 text-sm font-medium text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800/80 rounded-md transition-colors shrink-0' className='app-action-button group inline-flex items-center gap-1.5 px-2.5 py-1.5 -ml-2 text-sm font-medium text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800/80 rounded-md transition-colors shrink-0'
> >
<ArrowLeft <ActionArrowLeft
size={15} size={15}
className='transition-transform group-hover:-translate-x-0.5' className='transition-transform group-hover:-translate-x-0.5'
/> />
@@ -573,11 +583,11 @@ const DocumentRenderer = ({
{/* 打印按钮 */} {/* 打印按钮 */}
<button <button
onClick={() => window.print()} onClick={() => window.print()}
className='inline-flex items-center justify-center w-8 h-8 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800/80 rounded-md transition-colors shrink-0' className='app-action-button inline-flex items-center justify-center w-8 h-8 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800/80 rounded-md transition-colors shrink-0'
aria-label={t('打印')} aria-label={t('打印')}
title={t('打印')} title={t('打印')}
> >
<Printer size={15} /> <ActionPrinter size={15} />
</button> </button>
</div> </div>
</header> </header>
@@ -612,9 +622,9 @@ const DocumentRenderer = ({
<div className='mt-8 flex justify-center doc-no-print'> <div className='mt-8 flex justify-center doc-no-print'>
<button <button
onClick={smartBack} onClick={smartBack}
className='group inline-flex items-center gap-2 px-5 py-2 text-sm bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800/80 border border-gray-200 dark:border-gray-800 hover:border-gray-300 dark:hover:border-gray-700 rounded-lg text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white shadow-sm transition-all' className='app-action-button group inline-flex items-center gap-2 px-5 py-2 text-sm bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800/80 border border-gray-200 dark:border-gray-800 hover:border-gray-300 dark:hover:border-gray-700 rounded-lg text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white shadow-sm transition-all'
> >
<ArrowLeft <ActionArrowLeft
size={14} size={14}
className='transition-transform group-hover:-translate-x-0.5' className='transition-transform group-hover:-translate-x-0.5'
/> />
@@ -627,14 +637,22 @@ const DocumentRenderer = ({
{/* 返回顶部 FAB */} {/* 返回顶部 FAB */}
<button <button
onClick={scrollToTop} onClick={scrollToTop}
className={`fixed bottom-6 right-6 z-50 p-2.5 bg-white/95 dark:bg-gray-800/95 backdrop-blur-md rounded-full shadow-lg border border-gray-200 dark:border-gray-700 hover:shadow-xl hover:-translate-y-0.5 hover:bg-white dark:hover:bg-gray-800 transition-all duration-200 doc-no-print ${ className={[
'app-action-button',
`fixed bottom-6 right-6 z-50 p-2.5 bg-white/95 dark:bg-gray-800/95 backdrop-blur-md rounded-full shadow-lg border border-gray-200 dark:border-gray-700 hover:shadow-xl hover:-translate-y-0.5 hover:bg-white dark:hover:bg-gray-800 transition-all duration-200 doc-no-print ${
showBackToTop showBackToTop
? 'opacity-100 translate-y-0' ? 'opacity-100 translate-y-0'
: 'opacity-0 translate-y-2 pointer-events-none' : 'opacity-0 translate-y-2 pointer-events-none'
}`} }`,
]
.filter(Boolean)
.join(' ')}
aria-label={t('返回顶部')} aria-label={t('返回顶部')}
> >
<ChevronUp size={18} className='text-gray-600 dark:text-gray-300' /> <ActionChevronUp
size={18}
className='text-gray-600 dark:text-gray-300'
/>
</button> </button>
</div> </div>
); );
+16 -12
View File
@@ -30,16 +30,15 @@ For commercial licensing, please contact support@quantumnous.com
* 页面只需 usePageGuide({...配置}) 后把三个组件放到对应位置; * 页面只需 usePageGuide({...配置}) 后把三个组件放到对应位置;
* steps[].done 传布尔值即启用进度跟踪,不传则渲染为纯阅读步骤。 * steps[].done 传布尔值即启用进度跟踪,不传则渲染为纯阅读步骤。
*/ */
import {
BookOpenText as ActionBookOpenText,
Compass as ActionCompass,
ChevronDown as ActionChevronDown,
} from '@/components/common/icons/ActionIcons';
import React, { useCallback, useEffect, useMemo, useState } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Button, SideSheet } from '@/components/ui'; import { Button, SideSheet } from '@/components/ui';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import { CheckCircle2, Loader2 } from 'lucide-react';
BookOpenText,
CheckCircle2,
ChevronDown,
Compass,
Loader2,
} from 'lucide-react';
import './page-guide.css'; import './page-guide.css';
const seenKey = (guideKey) => `page-guide-seen-${guideKey}`; const seenKey = (guideKey) => `page-guide-seen-${guideKey}`;
@@ -162,7 +161,7 @@ export const PageGuideTrigger = ({ guide, className = '' }) => {
<Button <Button
theme='borderless' theme='borderless'
className={`page-guide-trigger ${className}`} className={`page-guide-trigger ${className}`}
icon={<BookOpenText size={16} />} icon={<ActionBookOpenText size={16} />}
onClick={() => guide.open()} onClick={() => guide.open()}
> >
{t('使用指引')} {t('使用指引')}
@@ -178,10 +177,12 @@ export const PageGuidePill = ({ guide, className = '' }) => {
return ( return (
<button <button
type='button' type='button'
className={`page-guide-pill ${className}`} className={['app-action-button', `page-guide-pill ${className}`]
.filter(Boolean)
.join(' ')}
onClick={() => guide.open(progress.nextIndex)} onClick={() => guide.open(progress.nextIndex)}
> >
<Compass size={14} className='page-guide-pill-icon' /> <ActionCompass size={14} className='page-guide-pill-icon' />
<span className='page-guide-pill-dots' aria-hidden='true'> <span className='page-guide-pill-dots' aria-hidden='true'>
{config.steps.map((step, index) => ( {config.steps.map((step, index) => (
<i <i
@@ -286,7 +287,7 @@ export const PageGuideDrawer = ({ guide }) => {
> >
<button <button
type='button' type='button'
className='page-guide-step-head' className='app-action-button page-guide-step-head'
aria-expanded={isOpen} aria-expanded={isOpen}
aria-controls={isOpen ? detailId : undefined} aria-controls={isOpen ? detailId : undefined}
onClick={() => setExpanded(isOpen ? -1 : index)} onClick={() => setExpanded(isOpen ? -1 : index)}
@@ -313,7 +314,10 @@ export const PageGuideDrawer = ({ guide }) => {
</strong> </strong>
{step.detail && <small>{step.detail}</small>} {step.detail && <small>{step.detail}</small>}
</span> </span>
<ChevronDown size={15} className='page-guide-step-arrow' /> <ActionChevronDown
size={15}
className='page-guide-step-arrow'
/>
</button> </button>
{isOpen && ( {isOpen && (
<div className='page-guide-step-detail' id={detailId}> <div className='page-guide-step-detail' id={detailId}>
+606
View File
@@ -0,0 +1,606 @@
/*
Copyright (C) 2025 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React, { forwardRef } from 'react';
import {
AccountBookOutlined,
DiffOutlined,
ExperimentOutlined,
ClearOutlined,
MenuUnfoldOutlined,
BoldOutlined,
ItalicOutlined,
UnderlineOutlined,
OrderedListOutlined,
SunOutlined,
MoonOutlined,
AppstoreOutlined,
ArrowDownOutlined,
ArrowLeftOutlined,
ArrowRightOutlined,
ArrowUpOutlined,
AudioMutedOutlined,
AudioOutlined,
BankOutlined,
BarChartOutlined,
BellOutlined,
BlockOutlined,
BookOutlined,
BorderOutlined,
CaretRightOutlined,
CheckCircleOutlined,
CheckOutlined,
CheckSquareOutlined,
ClockCircleOutlined,
CloseCircleOutlined,
CloseOutlined,
CloudServerOutlined,
CloudUploadOutlined,
CodeOutlined,
CompassOutlined,
ControlOutlined,
CopyOutlined,
CreditCardOutlined,
CustomerServiceOutlined,
DeleteOutlined,
DislikeOutlined,
DownOutlined,
DownloadOutlined,
EditOutlined,
ExclamationCircleOutlined,
ExpandAltOutlined,
ExportOutlined,
EyeInvisibleOutlined,
EyeOutlined,
FastForwardOutlined,
FieldTimeOutlined,
FileDoneOutlined,
FileOutlined,
FileTextOutlined,
FilterOutlined,
FontSizeOutlined,
GiftOutlined,
GithubOutlined,
GlobalOutlined,
HistoryOutlined,
HomeOutlined,
InfoCircleOutlined,
KeyOutlined,
LayoutOutlined,
LeftOutlined,
LikeOutlined,
LineChartOutlined,
LinkOutlined,
LockOutlined,
MailOutlined,
MenuOutlined,
MessageOutlined,
MinusOutlined,
MoreOutlined,
MutedOutlined,
PaperClipOutlined,
PictureOutlined,
PlayCircleOutlined,
PlusOutlined,
PrinterOutlined,
QuestionCircleOutlined,
ReadOutlined,
RedoOutlined,
ReloadOutlined,
RightOutlined,
RobotOutlined,
RocketOutlined,
SafetyCertificateOutlined,
SafetyOutlined,
SaveOutlined,
ScheduleOutlined,
SearchOutlined,
SendOutlined,
SettingOutlined,
ShareAltOutlined,
SoundOutlined,
StarFilled,
StarOutlined,
StopOutlined,
SwapOutlined,
TeamOutlined,
ThunderboltOutlined,
UndoOutlined,
UnorderedListOutlined,
UpOutlined,
UploadOutlined,
UserAddOutlined,
UserOutlined,
VideoCameraOutlined,
WalletOutlined,
WarningOutlined,
ZoomInOutlined,
ZoomOutOutlined,
} from '@ant-design/icons';
// Keep existing icon props and DOM refs while rendering the Ant Design glyph.
const createActionIcon = (Icon, displayName, options = {}) => {
const Component = forwardRef(function ActionIcon(
{
size,
color,
className = '',
style,
strokeWidth,
absoluteStrokeWidth,
fill,
...props
},
ref,
) {
const fontSize =
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] ?? size;
const Glyph =
fill && fill !== 'none' && options.filled ? options.filled : Icon;
return React.createElement(Glyph, {
...props,
ref,
rotate: props.rotate ?? options.rotate,
className: ['app-action-icon', className].filter(Boolean).join(' '),
style: { fontSize, color, ...style },
});
});
Component.displayName = displayName;
return Component;
};
export const Search = /* @__PURE__ */ createActionIcon(
SearchOutlined,
'Search',
);
export const Plus = /* @__PURE__ */ createActionIcon(PlusOutlined, 'Plus');
export const RefreshCw = /* @__PURE__ */ createActionIcon(
ReloadOutlined,
'RefreshCw',
);
export const RefreshCcw = /* @__PURE__ */ createActionIcon(
ReloadOutlined,
'RefreshCcw',
);
export const RotateCcw = /* @__PURE__ */ createActionIcon(
UndoOutlined,
'RotateCcw',
);
export const RotateCw = /* @__PURE__ */ createActionIcon(
RedoOutlined,
'RotateCw',
);
export const Trash2 = /* @__PURE__ */ createActionIcon(
DeleteOutlined,
'Trash2',
);
export const X = /* @__PURE__ */ createActionIcon(CloseOutlined, 'X');
export const Download = /* @__PURE__ */ createActionIcon(
DownloadOutlined,
'Download',
);
export const Upload = /* @__PURE__ */ createActionIcon(
UploadOutlined,
'Upload',
);
export const Copy = /* @__PURE__ */ createActionIcon(CopyOutlined, 'Copy');
export const ClipboardCopy = /* @__PURE__ */ createActionIcon(
CopyOutlined,
'ClipboardCopy',
);
export const Check = /* @__PURE__ */ createActionIcon(CheckOutlined, 'Check');
export const ChevronDown = /* @__PURE__ */ createActionIcon(
DownOutlined,
'ChevronDown',
);
export const ChevronUp = /* @__PURE__ */ createActionIcon(
UpOutlined,
'ChevronUp',
);
export const ChevronLeft = /* @__PURE__ */ createActionIcon(
LeftOutlined,
'ChevronLeft',
);
export const ChevronRight = /* @__PURE__ */ createActionIcon(
RightOutlined,
'ChevronRight',
);
export const ArrowRight = /* @__PURE__ */ createActionIcon(
ArrowRightOutlined,
'ArrowRight',
);
export const ArrowLeft = /* @__PURE__ */ createActionIcon(
ArrowLeftOutlined,
'ArrowLeft',
);
export const ArrowUp = /* @__PURE__ */ createActionIcon(
ArrowUpOutlined,
'ArrowUp',
);
export const ArrowDown = /* @__PURE__ */ createActionIcon(
ArrowDownOutlined,
'ArrowDown',
);
export const ArrowUpRight = /* @__PURE__ */ createActionIcon(
ArrowUpOutlined,
'ArrowUpRight',
{
rotate: 45,
},
);
export const Eye = /* @__PURE__ */ createActionIcon(EyeOutlined, 'Eye');
export const EyeOff = /* @__PURE__ */ createActionIcon(
EyeInvisibleOutlined,
'EyeOff',
);
export const Save = /* @__PURE__ */ createActionIcon(SaveOutlined, 'Save');
export const ExternalLink = /* @__PURE__ */ createActionIcon(
ExportOutlined,
'ExternalLink',
);
export const Star = /* @__PURE__ */ createActionIcon(StarOutlined, 'Star', {
filled: StarFilled,
});
export const Globe = /* @__PURE__ */ createActionIcon(GlobalOutlined, 'Globe');
export const Pencil = /* @__PURE__ */ createActionIcon(EditOutlined, 'Pencil');
export const Edit = /* @__PURE__ */ createActionIcon(EditOutlined, 'Edit');
export const Wallet = /* @__PURE__ */ createActionIcon(
WalletOutlined,
'Wallet',
);
export const Settings = /* @__PURE__ */ createActionIcon(
SettingOutlined,
'Settings',
);
export const Settings2 = /* @__PURE__ */ createActionIcon(
SettingOutlined,
'Settings2',
);
export const SlidersHorizontal = /* @__PURE__ */ createActionIcon(
ControlOutlined,
'SlidersHorizontal',
);
export const MoreHorizontal = /* @__PURE__ */ createActionIcon(
MoreOutlined,
'MoreHorizontal',
);
export const Ellipsis = /* @__PURE__ */ createActionIcon(
MoreOutlined,
'Ellipsis',
);
export const Zap = /* @__PURE__ */ createActionIcon(ThunderboltOutlined, 'Zap');
export const MessageCircle = /* @__PURE__ */ createActionIcon(
MessageOutlined,
'MessageCircle',
);
export const Send = /* @__PURE__ */ createActionIcon(SendOutlined, 'Send');
export const Ban = /* @__PURE__ */ createActionIcon(StopOutlined, 'Ban');
export const ShieldCheck = /* @__PURE__ */ createActionIcon(
SafetyCertificateOutlined,
'ShieldCheck',
);
export const Shield = /* @__PURE__ */ createActionIcon(
SafetyOutlined,
'Shield',
);
export const Lock = /* @__PURE__ */ createActionIcon(LockOutlined, 'Lock');
export const LockKeyhole = /* @__PURE__ */ createActionIcon(
LockOutlined,
'LockKeyhole',
);
export const History = /* @__PURE__ */ createActionIcon(
HistoryOutlined,
'History',
);
export const Code2 = /* @__PURE__ */ createActionIcon(CodeOutlined, 'Code2');
export const Code = /* @__PURE__ */ createActionIcon(CodeOutlined, 'Code');
export const KeyRound = /* @__PURE__ */ createActionIcon(
KeyOutlined,
'KeyRound',
);
export const Filter = /* @__PURE__ */ createActionIcon(
FilterOutlined,
'Filter',
);
export const Headphones = /* @__PURE__ */ createActionIcon(
CustomerServiceOutlined,
'Headphones',
);
export const Mic = /* @__PURE__ */ createActionIcon(AudioOutlined, 'Mic');
export const MicOff = /* @__PURE__ */ createActionIcon(
AudioMutedOutlined,
'MicOff',
);
export const Square = /* @__PURE__ */ createActionIcon(
BorderOutlined,
'Square',
);
export const CheckCircle2 = /* @__PURE__ */ createActionIcon(
CheckCircleOutlined,
'CheckCircle2',
);
export const CheckCircle = /* @__PURE__ */ createActionIcon(
CheckCircleOutlined,
'CheckCircle',
);
export const CircleCheck = /* @__PURE__ */ createActionIcon(
CheckCircleOutlined,
'CircleCheck',
);
export const LayoutGrid = /* @__PURE__ */ createActionIcon(
AppstoreOutlined,
'LayoutGrid',
);
export const Play = /* @__PURE__ */ createActionIcon(
CaretRightOutlined,
'Play',
);
export const CirclePlay = /* @__PURE__ */ createActionIcon(
PlayCircleOutlined,
'CirclePlay',
);
export const HelpCircle = /* @__PURE__ */ createActionIcon(
QuestionCircleOutlined,
'HelpCircle',
);
export const CircleHelp = /* @__PURE__ */ createActionIcon(
QuestionCircleOutlined,
'CircleHelp',
);
export const AlertCircle = /* @__PURE__ */ createActionIcon(
ExclamationCircleOutlined,
'AlertCircle',
);
export const CircleAlert = /* @__PURE__ */ createActionIcon(
ExclamationCircleOutlined,
'CircleAlert',
);
export const AlertTriangle = /* @__PURE__ */ createActionIcon(
WarningOutlined,
'AlertTriangle',
);
export const TriangleAlert = /* @__PURE__ */ createActionIcon(
WarningOutlined,
'TriangleAlert',
);
export const Layers = /* @__PURE__ */ createActionIcon(BlockOutlined, 'Layers');
export const UserPlus = /* @__PURE__ */ createActionIcon(
UserAddOutlined,
'UserPlus',
);
export const UserRound = /* @__PURE__ */ createActionIcon(
UserOutlined,
'UserRound',
);
export const User = /* @__PURE__ */ createActionIcon(UserOutlined, 'User');
export const Users = /* @__PURE__ */ createActionIcon(TeamOutlined, 'Users');
export const Printer = /* @__PURE__ */ createActionIcon(
PrinterOutlined,
'Printer',
);
export const Paperclip = /* @__PURE__ */ createActionIcon(
PaperClipOutlined,
'Paperclip',
);
export const ZoomOut = /* @__PURE__ */ createActionIcon(
ZoomOutOutlined,
'ZoomOut',
);
export const ZoomIn = /* @__PURE__ */ createActionIcon(
ZoomInOutlined,
'ZoomIn',
);
export const FileText = /* @__PURE__ */ createActionIcon(
FileTextOutlined,
'FileText',
);
export const File = /* @__PURE__ */ createActionIcon(FileOutlined, 'File');
export const FastForward = /* @__PURE__ */ createActionIcon(
FastForwardOutlined,
'FastForward',
);
export const Volume1 = /* @__PURE__ */ createActionIcon(
SoundOutlined,
'Volume1',
);
export const Volume2 = /* @__PURE__ */ createActionIcon(
SoundOutlined,
'Volume2',
);
export const VolumeX = /* @__PURE__ */ createActionIcon(
MutedOutlined,
'VolumeX',
);
export const Receipt = /* @__PURE__ */ createActionIcon(
AccountBookOutlined,
'Receipt',
);
export const ReceiptText = /* @__PURE__ */ createActionIcon(
AccountBookOutlined,
'ReceiptText',
);
export const BarChart3 = /* @__PURE__ */ createActionIcon(
BarChartOutlined,
'BarChart3',
);
export const ChartColumn = /* @__PURE__ */ createActionIcon(
BarChartOutlined,
'ChartColumn',
);
export const ChartLine = /* @__PURE__ */ createActionIcon(
LineChartOutlined,
'ChartLine',
);
export const Bell = /* @__PURE__ */ createActionIcon(BellOutlined, 'Bell');
export const Bot = /* @__PURE__ */ createActionIcon(RobotOutlined, 'Bot');
export const ThumbsUp = /* @__PURE__ */ createActionIcon(
LikeOutlined,
'ThumbsUp',
);
export const ThumbsDown = /* @__PURE__ */ createActionIcon(
DislikeOutlined,
'ThumbsDown',
);
export const Rows = /* @__PURE__ */ createActionIcon(
UnorderedListOutlined,
'Rows',
);
export const Layout = /* @__PURE__ */ createActionIcon(
LayoutOutlined,
'Layout',
);
export const Image = /* @__PURE__ */ createActionIcon(PictureOutlined, 'Image');
export const Share2 = /* @__PURE__ */ createActionIcon(
ShareAltOutlined,
'Share2',
);
export const Rocket = /* @__PURE__ */ createActionIcon(
RocketOutlined,
'Rocket',
);
export const BookOpen = /* @__PURE__ */ createActionIcon(
ReadOutlined,
'BookOpen',
);
export const BookOpenText = /* @__PURE__ */ createActionIcon(
ReadOutlined,
'BookOpenText',
);
export const Menu = /* @__PURE__ */ createActionIcon(MenuOutlined, 'Menu');
export const UploadCloud = /* @__PURE__ */ createActionIcon(
CloudUploadOutlined,
'UploadCloud',
);
export const Building2 = /* @__PURE__ */ createActionIcon(
BankOutlined,
'Building2',
);
export const FileCheck2 = /* @__PURE__ */ createActionIcon(
FileDoneOutlined,
'FileCheck2',
);
export const OctagonX = /* @__PURE__ */ createActionIcon(
CloseCircleOutlined,
'OctagonX',
);
export const Home = /* @__PURE__ */ createActionIcon(HomeOutlined, 'Home');
export const ArrowRightLeft = /* @__PURE__ */ createActionIcon(
SwapOutlined,
'ArrowRightLeft',
);
export const Maximize2 = /* @__PURE__ */ createActionIcon(
ExpandAltOutlined,
'Maximize2',
);
export const CheckSquare = /* @__PURE__ */ createActionIcon(
CheckSquareOutlined,
'CheckSquare',
);
export const ListFilter = /* @__PURE__ */ createActionIcon(
FilterOutlined,
'ListFilter',
);
export const CalendarClock = /* @__PURE__ */ createActionIcon(
ScheduleOutlined,
'CalendarClock',
);
export const CreditCard = /* @__PURE__ */ createActionIcon(
CreditCardOutlined,
'CreditCard',
);
export const Link = /* @__PURE__ */ createActionIcon(LinkOutlined, 'Link');
export const Mail = /* @__PURE__ */ createActionIcon(MailOutlined, 'Mail');
export const Github = /* @__PURE__ */ createActionIcon(
GithubOutlined,
'Github',
);
export const Gift = /* @__PURE__ */ createActionIcon(GiftOutlined, 'Gift');
export const Minus = /* @__PURE__ */ createActionIcon(MinusOutlined, 'Minus');
export const Video = /* @__PURE__ */ createActionIcon(
VideoCameraOutlined,
'Video',
);
export const Server = /* @__PURE__ */ createActionIcon(
CloudServerOutlined,
'Server',
);
export const Bookmark = /* @__PURE__ */ createActionIcon(
BookOutlined,
'Bookmark',
);
export const Info = /* @__PURE__ */ createActionIcon(
InfoCircleOutlined,
'Info',
);
export const Timer = /* @__PURE__ */ createActionIcon(
FieldTimeOutlined,
'Timer',
);
export const Type = /* @__PURE__ */ createActionIcon(FontSizeOutlined, 'Type');
export const Clock = /* @__PURE__ */ createActionIcon(
ClockCircleOutlined,
'Clock',
);
export const Compass = /* @__PURE__ */ createActionIcon(
CompassOutlined,
'Compass',
);
// Keep composite upload/user-check and heartbeat glyphs without an exact Ant equivalent.
export { Activity, FileUp, UserCheck } from 'lucide-react';
export const Bold = /* @__PURE__ */ createActionIcon(BoldOutlined, 'Bold');
export const Italic = /* @__PURE__ */ createActionIcon(
ItalicOutlined,
'Italic',
);
export const Underline = /* @__PURE__ */ createActionIcon(
UnderlineOutlined,
'Underline',
);
export const List = /* @__PURE__ */ createActionIcon(
UnorderedListOutlined,
'List',
);
export const ListOrdered = /* @__PURE__ */ createActionIcon(
OrderedListOutlined,
'ListOrdered',
);
export const Undo2 = /* @__PURE__ */ createActionIcon(UndoOutlined, 'Undo2');
export const Redo2 = /* @__PURE__ */ createActionIcon(RedoOutlined, 'Redo2');
export const Sun = /* @__PURE__ */ createActionIcon(SunOutlined, 'Sun');
export const Moon = /* @__PURE__ */ createActionIcon(MoonOutlined, 'Moon');
export const GitCompare = /* @__PURE__ */ createActionIcon(
DiffOutlined,
'GitCompare',
);
export const TestTube2 = /* @__PURE__ */ createActionIcon(
ExperimentOutlined,
'TestTube2',
);
export const Eraser = /* @__PURE__ */ createActionIcon(ClearOutlined, 'Eraser');
export const PanelLeftOpen = /* @__PURE__ */ createActionIcon(
MenuUnfoldOutlined,
'PanelLeftOpen',
);
export const LayoutTemplate = /* @__PURE__ */ createActionIcon(
LayoutOutlined,
'LayoutTemplate',
);
@@ -16,18 +16,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
X as ActionX,
ArrowRight as ActionArrowRight,
} from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Modal, Button, Typography } from '@/components/ui'; import { Modal, Button, Typography } from '@/components/ui';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import { Gift, Sparkles, Wallet, KeyRound, Star } from 'lucide-react';
Gift,
ArrowRight,
Sparkles,
X,
Wallet,
KeyRound,
Star,
} from 'lucide-react';
import { renderQuota } from '../../../helpers'; import { renderQuota } from '../../../helpers';
const { Text } = Typography; const { Text } = Typography;
@@ -65,10 +61,10 @@ const NewUserGiftModal = ({ visible, onClose, quota }) => {
{/* 关闭按钮 */} {/* 关闭按钮 */}
<button <button
onClick={onClose} onClick={onClose}
className='absolute top-3.5 right-3.5 z-20 w-7 h-7 rounded-full bg-white/20 hover:bg-white/35 flex items-center justify-center transition-colors duration-150' className='app-action-button absolute top-3.5 right-3.5 z-20 w-7 h-7 rounded-full bg-white/20 hover:bg-white/35 flex items-center justify-center transition-colors duration-150'
aria-label={t('关闭')} aria-label={t('关闭')}
> >
<X size={14} className='text-white' /> <ActionX size={14} className='text-white' />
</button> </button>
{/* 头部 */} {/* 头部 */}
@@ -158,7 +154,7 @@ const NewUserGiftModal = ({ visible, onClose, quota }) => {
> >
<span className='flex items-center justify-center gap-2 text-white'> <span className='flex items-center justify-center gap-2 text-white'>
{t('马上试一试')} {t('马上试一试')}
<ArrowRight size={16} /> <ActionArrowRight size={16} />
</span> </span>
</Button> </Button>
<p className='text-gray-400 dark:text-gray-500 text-xs text-center mt-2.5 leading-relaxed'> <p className='text-gray-400 dark:text-gray-500 text-xs text-center mt-2.5 leading-relaxed'>
@@ -17,6 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
X as ActionX,
ChevronRight as ActionChevronRight,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useContext } from 'react'; import React, { useState, useEffect, useContext } from 'react';
import { Modal, RadioGroup, Radio, Button, Typography } from '@/components/ui'; import { Modal, RadioGroup, Radio, Button, Typography } from '@/components/ui';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -28,15 +32,7 @@ import {
showError, showError,
showWarning, showWarning,
} from '../../../helpers'; } from '../../../helpers';
import { import { Sparkles, Briefcase, Cpu, UserCircle, LogOut } from 'lucide-react';
Sparkles,
Briefcase,
Cpu,
ChevronRight,
UserCircle,
X,
LogOut,
} from 'lucide-react';
import { UserContext } from '../../../context/User'; import { UserContext } from '../../../context/User';
const { Title, Text } = Typography; const { Title, Text } = Typography;
@@ -148,10 +144,10 @@ const UserSurveyModal = ({ visible, onClose, onSuccess }) => {
{/* 关闭按钮 */} {/* 关闭按钮 */}
<button <button
onClick={handleCloseClick} onClick={handleCloseClick}
className='absolute top-4 right-4 z-10 p-2 rounded-full bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 transition-colors duration-200 group' className='app-action-button absolute top-4 right-4 z-10 p-2 rounded-full bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 transition-colors duration-200 group'
title={t('暂不填写')} title={t('暂不填写')}
> >
<X <ActionX
size={18} size={18}
className='text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200' className='text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200'
/> />
@@ -326,7 +322,7 @@ const UserSurveyModal = ({ visible, onClose, onSuccess }) => {
> >
<span className='flex items-center justify-center gap-2'> <span className='flex items-center justify-center gap-2'>
{t('开始使用')} {t('开始使用')}
<ChevronRight size={18} /> <ActionChevronRight size={18} />
</span> </span>
</Button> </Button>
</div> </div>
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Settings as ActionSettings } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Alert, Button, Checkbox, Modal, Tooltip, theme } from 'antd'; import { Alert, Button, Checkbox, Modal, Tooltip, theme } from 'antd';
import { Settings } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import './column-settings.css'; import './column-settings.css';
@@ -53,7 +53,7 @@ export function ColumnSettingsButton({ onClick, open = false }) {
aria-label={t('列设置')} aria-label={t('列设置')}
aria-haspopup='dialog' aria-haspopup='dialog'
aria-expanded={open} aria-expanded={open}
icon={<Settings size={16} />} icon={<ActionSettings size={16} />}
onClick={onClick} onClick={onClick}
/> />
</Tooltip> </Tooltip>
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Search as ActionSearch } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button } from 'antd'; import { Button } from 'antd';
import { Search } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import './filter-search-button.css'; import './filter-search-button.css';
@@ -37,7 +37,7 @@ export default function FilterSearchButton({
onClick={onClick} onClick={onClick}
size='middle' size='middle'
loading={loading} loading={loading}
icon={<Search size={14} />} icon={<ActionSearch size={14} />}
> >
{t('搜索')} {t('搜索')}
</Button> </Button>
@@ -10,7 +10,7 @@
justify-content: center; justify-content: center;
} }
.console-page .filter-search-button .lucide { .console-page .filter-search-button :is(.lucide, .app-action-icon) {
display: block; display: block;
width: 14px; width: 14px;
height: 14px; height: 14px;
+2 -10
View File
@@ -21,6 +21,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { Card, Button, Typography, Tag } from '@/components/ui'; import { Card, Button, Typography, Tag } from '@/components/ui';
import { copy, showError, showSuccess } from '../../../helpers'; import { copy, showError, showSuccess } from '../../../helpers';
import { Copy } from '../icons/ActionIcons';
/** /**
* 解析密钥数据,支持多种格式 * 解析密钥数据,支持多种格式
@@ -175,16 +176,7 @@ const ChannelKeyDisplay = ({
size='small' size='small'
type='primary' type='primary'
theme='outline' theme='outline'
icon={ icon={<Copy size={12} />}
<svg
className='w-3 h-3'
fill='currentColor'
viewBox='0 0 20 20'
>
<path d='M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z' />
<path d='M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z' />
</svg>
}
onClick={() => handleCopyKey(keyItem.content)} onClick={() => handleCopyKey(keyItem.content)}
> >
{t('复制')} {t('复制')}
+3 -3
View File
@@ -31,12 +31,11 @@ import {
Underline, Underline,
List, List,
ListOrdered, ListOrdered,
Quote,
Undo2, Undo2,
Redo2, Redo2,
Eraser, Eraser,
ImagePlus, } from '../icons/ActionIcons';
} from 'lucide-react'; import { Quote, ImagePlus } from 'lucide-react';
import { import {
articleImageSource, articleImageSource,
ARTICLE_IMAGE_TYPES, ARTICLE_IMAGE_TYPES,
@@ -470,6 +469,7 @@ export default function RichTextEditor({
</button> </button>
))} ))}
<button <button
className='app-action-button'
type='button' type='button'
title='插入正文图片(单张不超过 2 MB)' title='插入正文图片(单张不超过 2 MB)'
aria-label='插入正文图片' aria-label='插入正文图片'
@@ -25,13 +25,41 @@ import './module-alignment.css';
// Labels belong to the module; this wrapper only supplies the shared layout. // Labels belong to the module; this wrapper only supplies the shared layout.
export function ConsoleFilterField({ label, children }) { export function ConsoleFilterField({ label, children }) {
const id = useId(); const generatedId = useId();
const isElement = React.isValidElement(children);
const isGroup =
!isElement ||
children.type === React.Fragment ||
(typeof children.type === 'string' &&
![
'input',
'select',
'textarea',
'button',
'meter',
'output',
'progress',
].includes(children.type));
const id = (isElement && children.props.id) || generatedId;
// Composite filters need a group name, not a label pointing at a container.
if (isGroup) {
return (
<div
className='console-module-field'
role='group'
aria-labelledby={generatedId}
>
<span className='console-module-field-label' id={generatedId}>
{label}
</span>
{children}
</div>
);
}
return ( return (
<div className='console-module-field'> <div className='console-module-field'>
<label htmlFor={id}>{label}</label> <label htmlFor={id}>{label}</label>
{React.isValidElement(children) {React.cloneElement(children, { id })}
? React.cloneElement(children, { id })
: children}
</div> </div>
); );
} }
+13 -3
View File
@@ -31,6 +31,7 @@ import {
theme, theme,
} from 'antd'; } from 'antd';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import TableEmpty from '../common/table/TableEmpty';
import { import {
ConsoleSearchContext, ConsoleSearchContext,
useConsolePage, useConsolePage,
@@ -41,13 +42,17 @@ const classes = (base, extra) => [base, extra].filter(Boolean).join(' ');
export function ConsoleAlert({ className, style, type = 'info', ...props }) { export function ConsoleAlert({ className, style, type = 'info', ...props }) {
const { token } = theme.useToken(); const { token } = theme.useToken();
const semantic = type[0].toUpperCase() + type.slice(1); const isSettings = useConsolePage()?.page.key === 'setting';
const semantic = isSettings ? 'Info' : type[0].toUpperCase() + type.slice(1);
return ( return (
<Alert <Alert
{...props} {...props}
type={type} type={type}
showIcon showIcon
className={classes('console-alert', className)} className={classes(
isSettings ? 'console-alert console-alert--settings' : 'console-alert',
className,
)}
style={{ style={{
...style, ...style,
marginBlock: style?.marginBlock ?? '0 16px', marginBlock: style?.marginBlock ?? '0 16px',
@@ -56,6 +61,9 @@ export function ConsoleAlert({ className, style, type = 'info', ...props }) {
background: token[`color${semantic}Bg`], background: token[`color${semantic}Bg`],
borderColor: token[`color${semantic}Border`], borderColor: token[`color${semantic}Border`],
color: token.colorText, color: token.colorText,
...(isSettings
? { '--settings-alert-icon-color': token.colorInfo }
: {}),
}} }}
/> />
); );
@@ -135,15 +143,17 @@ export const ConsoleTable = forwardRef(function ConsoleTable(
{ className, scroll, locale, size = 'middle', ...props }, { className, scroll, locale, size = 'middle', ...props },
ref, ref,
) { ) {
const isSettings = useConsolePage()?.page.key === 'setting';
return ( return (
<Table <Table
{...props} {...props}
ref={ref} ref={ref}
size={size} size={isSettings ? 'middle' : size}
scroll={{ x: 'max-content', ...scroll }} scroll={{ x: 'max-content', ...scroll }}
locale={{ locale={{
emptyText: <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />, emptyText: <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />,
...locale, ...locale,
...(isSettings ? { emptyText: <TableEmpty /> } : {}),
}} }}
className={classes('console-table', className)} className={classes('console-table', className)}
/> />
+1 -1
View File
@@ -244,7 +244,7 @@
margin-bottom: var(--console-space-2); margin-bottom: var(--console-space-2);
} }
.console-page .ant-tabs-tab .lucide, .console-page .ant-tabs-tab .lucide,
.console-page .ant-btn .lucide { .console-page .ant-btn :is(.lucide, .app-action-icon) {
width: 16px; width: 16px;
height: 16px; height: 16px;
} }
+4 -2
View File
@@ -14,12 +14,14 @@
} }
.console-page .console-module-filter-grid .ant-form-item-label > label, .console-page .console-module-filter-grid .ant-form-item-label > label,
.console-module-field > label { .console-module-field > label,
.console-module-field-label {
color: var(--console-muted); color: var(--console-muted);
font-size: 13px; font-size: 13px;
} }
.console-module-field > label { .console-module-field > label,
.console-module-field-label {
display: block; display: block;
margin-bottom: 8px; margin-bottom: 8px;
line-height: 22px; line-height: 22px;
+60 -37
View File
@@ -17,6 +17,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { LayoutTemplate as ActionLayoutTemplate } from '@/components/common/icons/ActionIcons';
import { Image as TemplateImageIcon } from '@/components/common/icons/ActionIcons';
import {
ChevronDown as ActionChevronDown,
Lock as ActionLock,
Wallet as ActionWallet,
ChevronUp as ActionChevronUp,
ArrowLeft as ActionArrowLeft,
Settings2 as ActionSettings2,
History as ActionHistory,
MoreHorizontal as ActionMoreHorizontal,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, { import React, {
useCallback, useCallback,
useContext, useContext,
@@ -38,23 +51,13 @@ import {
} from '@/components/ui'; } from '@/components/ui';
import { import {
AlertCircle, AlertCircle,
ArrowLeft,
Bell, Bell,
BellOff, BellOff,
ChevronDown,
ChevronUp,
Clapperboard, Clapperboard,
History,
ImageIcon,
ImagePlus, ImagePlus,
LayoutTemplate,
Lock, Lock,
MoreHorizontal,
Settings2,
Sparkles, Sparkles,
Wand2, Wand2,
Wallet,
X,
} from 'lucide-react'; } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
@@ -330,7 +333,12 @@ const ParamChip = ({
trigger={ trigger={
<button <button
type='button' type='button'
className={`cs-chip cs-param-chip${open ? ' is-active' : ''}`} className={[
'app-action-button',
`cs-chip cs-param-chip${open ? ' is-active' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-haspopup='dialog' aria-haspopup='dialog'
aria-expanded={open} aria-expanded={open}
aria-label={`${label}:${text}`} aria-label={`${label}:${text}`}
@@ -338,7 +346,7 @@ const ParamChip = ({
onClick={() => setOpen((v) => !v)} onClick={() => setOpen((v) => !v)}
> >
<span className='cs-chip-text'>{text}</span> <span className='cs-chip-text'>{text}</span>
<ChevronDown size={12} aria-hidden /> <ActionChevronDown size={12} aria-hidden />
</button> </button>
} }
> >
@@ -369,7 +377,7 @@ const TemplatePicker = ({ kind, isMobile, onApply }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const list = useMemo(() => templatesOf(kind), [kind]); const list = useMemo(() => templatesOf(kind), [kind]);
const Icon = kind === 'video' ? Clapperboard : ImageIcon; const Icon = kind === 'video' ? Clapperboard : TemplateImageIcon;
if (!list.length) return null; if (!list.length) return null;
return ( return (
<DockPopover <DockPopover
@@ -382,12 +390,17 @@ const TemplatePicker = ({ kind, isMobile, onApply }) => {
trigger={ trigger={
<button <button
type='button' type='button'
className={`cs-chip cs-tool${open ? ' is-active' : ''}`} className={[
'app-action-button',
`cs-chip cs-tool${open ? ' is-active' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-haspopup='dialog' aria-haspopup='dialog'
aria-expanded={open} aria-expanded={open}
onClick={() => setOpen((v) => !v)} onClick={() => setOpen((v) => !v)}
> >
<LayoutTemplate size={14} aria-hidden /> <ActionLayoutTemplate size={14} aria-hidden />
<span>{t('模板')}</span> <span>{t('模板')}</span>
</button> </button>
} }
@@ -1014,7 +1027,7 @@ const CreationDock = ({ form, compare = null }) => {
<Button <Button
type='warning' type='warning'
theme='solid' theme='solid'
icon={<Lock size={16} aria-hidden />} icon={<ActionLock size={16} aria-hidden />}
onClick={() => navigate(TOPUP_PATH)} onClick={() => navigate(TOPUP_PATH)}
> >
{t('升级')} {t('升级')}
@@ -1026,7 +1039,7 @@ const CreationDock = ({ form, compare = null }) => {
<Button <Button
type='warning' type='warning'
theme='solid' theme='solid'
icon={<Wallet size={16} aria-hidden />} icon={<ActionWallet size={16} aria-hidden />}
onClick={() => navigate(TOPUP_PATH)} onClick={() => navigate(TOPUP_PATH)}
> >
{t('去充值')} {t('去充值')}
@@ -1088,7 +1101,12 @@ const CreationDock = ({ form, compare = null }) => {
<div className='cs-dock cs-dock--collapsed' ref={dockRef}> <div className='cs-dock cs-dock--collapsed' ref={dockRef}>
<button <button
type='button' type='button'
className={`cs-collapsed-prompt${prompt ? '' : ' is-placeholder'}`} className={[
'app-action-button',
`cs-collapsed-prompt${prompt ? '' : ' is-placeholder'}`,
]
.filter(Boolean)
.join(' ')}
data-guide='prompt' data-guide='prompt'
onClick={expand} onClick={expand}
aria-label={t('展开创作台')} aria-label={t('展开创作台')}
@@ -1100,7 +1118,7 @@ const CreationDock = ({ form, compare = null }) => {
? t('描述你想要的画面…') ? t('描述你想要的画面…')
: t('描述你想要的视频画面与运动…'))} : t('描述你想要的视频画面与运动…'))}
</span> </span>
<ChevronUp size={14} aria-hidden /> <ActionChevronUp size={14} aria-hidden />
</button> </button>
<div className='cs-collapsed-model'>{modelPicker}</div> <div className='cs-collapsed-model'>{modelPicker}</div>
{generateButton(true)} {generateButton(true)}
@@ -1139,14 +1157,14 @@ const CreationDock = ({ form, compare = null }) => {
> >
<button <button
type='button' type='button'
className='cs-chip cs-mode-chip' className='app-action-button cs-chip cs-mode-chip'
aria-haspopup='menu' aria-haspopup='menu'
aria-label={t('生成模式:{{mode}}', { aria-label={t('生成模式:{{mode}}', {
mode: t(modeLabels[mode] || mode), mode: t(modeLabels[mode] || mode),
})} })}
> >
<span>{t(modeLabels[mode] || mode)}</span> <span>{t(modeLabels[mode] || mode)}</span>
<ChevronDown size={12} aria-hidden /> <ActionChevronDown size={12} aria-hidden />
</button> </button>
</Dropdown> </Dropdown>
) : modeOptions.length === 1 ? ( ) : modeOptions.length === 1 ? (
@@ -1239,11 +1257,11 @@ const CreationDock = ({ form, compare = null }) => {
<span className='cs-dock-head-title'>{t('创作')}</span> <span className='cs-dock-head-title'>{t('创作')}</span>
<button <button
type='button' type='button'
className='cs-icon-btn' className='app-action-button cs-icon-btn'
onClick={collapse} onClick={collapse}
aria-label={t('收起创作台')} aria-label={t('收起创作台')}
> >
<ChevronDown size={16} aria-hidden /> <ActionChevronDown size={16} aria-hidden />
</button> </button>
</div> </div>
) : null} ) : null}
@@ -1294,7 +1312,7 @@ const CreationDock = ({ form, compare = null }) => {
{movable ? ( {movable ? (
<button <button
type='button' type='button'
className='cs-slot-move' className='app-action-button cs-slot-move'
onClick={() => onClick={() =>
handleMoveRef(entry.index, entry.index - 1) handleMoveRef(entry.index, entry.index - 1)
} }
@@ -1303,7 +1321,7 @@ const CreationDock = ({ form, compare = null }) => {
})} })}
title={t('前移')} title={t('前移')}
> >
<ArrowLeft size={12} aria-hidden /> <ActionArrowLeft size={12} aria-hidden />
</button> </button>
) : null} ) : null}
</div> </div>
@@ -1329,7 +1347,7 @@ const CreationDock = ({ form, compare = null }) => {
<> <>
<button <button
type='button' type='button'
className='cs-chip cs-tool' className='app-action-button cs-chip cs-tool'
disabled={localUploadBlocked} disabled={localUploadBlocked}
title={uploadBlockedReason || undefined} title={uploadBlockedReason || undefined}
onClick={() => addInputRef.current?.click()} onClick={() => addInputRef.current?.click()}
@@ -1431,12 +1449,17 @@ const CreationDock = ({ form, compare = null }) => {
trigger={ trigger={
<button <button
type='button' type='button'
className={`cs-chip${advancedOpen ? ' is-active' : ''}`} className={[
'app-action-button',
`cs-chip${advancedOpen ? ' is-active' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-haspopup='dialog' aria-haspopup='dialog'
aria-expanded={advancedOpen} aria-expanded={advancedOpen}
onClick={() => setAdvancedOpen((v) => !v)} onClick={() => setAdvancedOpen((v) => !v)}
> >
<Settings2 size={14} aria-hidden /> <ActionSettings2 size={14} aria-hidden />
{t('高级')} {t('高级')}
</button> </button>
} }
@@ -1479,11 +1502,11 @@ const CreationDock = ({ form, compare = null }) => {
> >
<button <button
type='button' type='button'
className='cs-chip cs-tool' className='app-action-button cs-chip cs-tool'
aria-haspopup='menu' aria-haspopup='menu'
title={t('提示词历史')} title={t('提示词历史')}
> >
<History size={14} aria-hidden /> <ActionHistory size={14} aria-hidden />
<span>{t('历史')}</span> <span>{t('历史')}</span>
</button> </button>
</Dropdown> </Dropdown>
@@ -1495,7 +1518,7 @@ const CreationDock = ({ form, compare = null }) => {
/> />
<button <button
type='button' type='button'
className='cs-chip cs-tool' className='app-action-button cs-chip cs-tool'
onClick={handleOptimize} onClick={handleOptimize}
aria-busy={optimizing || undefined} aria-busy={optimizing || undefined}
title={ title={
@@ -1550,12 +1573,12 @@ const CreationDock = ({ form, compare = null }) => {
> >
<button <button
type='button' type='button'
className='cs-chip cs-tool cs-icon-chip' className='app-action-button cs-chip cs-tool cs-icon-chip'
aria-haspopup='menu' aria-haspopup='menu'
aria-label={t('更多')} aria-label={t('更多')}
title={t('更多')} title={t('更多')}
> >
<MoreHorizontal size={14} aria-hidden /> <ActionMoreHorizontal size={14} aria-hidden />
{notify.enabled ? ( {notify.enabled ? (
<span className='cs-dot' aria-hidden /> <span className='cs-dot' aria-hidden />
) : null} ) : null}
@@ -1593,11 +1616,11 @@ const CreationDock = ({ form, compare = null }) => {
</span> </span>
<button <button
type='button' type='button'
className='cs-icon-btn' className='app-action-button cs-icon-btn'
onClick={clearAdjustments} onClick={clearAdjustments}
aria-label={t('关闭提示')} aria-label={t('关闭提示')}
> >
<X size={14} aria-hidden /> <ActionX size={14} aria-hidden />
</button> </button>
</div> </div>
) : null} ) : null}
@@ -1624,11 +1647,11 @@ const CreationDock = ({ form, compare = null }) => {
) : null} ) : null}
<button <button
type='button' type='button'
className='cs-icon-btn' className='app-action-button cs-icon-btn'
onClick={clearError} onClick={clearError}
aria-label={t('关闭提示')} aria-label={t('关闭提示')}
> >
<X size={14} aria-hidden /> <ActionX size={14} aria-hidden />
</button> </button>
</div> </div>
) : null} ) : null}
@@ -17,9 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Lock as ActionLock,
ChevronDown as ActionChevronDown,
} from '@/components/common/icons/ActionIcons';
import React, { useCallback, useEffect, useRef, useState } from 'react'; import React, { useCallback, useEffect, useRef, useState } from 'react';
import { Popover, SideSheet } from '@/components/ui'; import { Popover, SideSheet } from '@/components/ui';
import { ChevronDown, Lock } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useIsMobile } from '../../../hooks/common/useIsMobile'; import { useIsMobile } from '../../../hooks/common/useIsMobile';
import ModelPickerPanel from './ModelPickerPanel'; import ModelPickerPanel from './ModelPickerPanel';
@@ -127,16 +130,21 @@ const ModelPicker = ({
<button <button
ref={triggerRef} ref={triggerRef}
type='button' type='button'
className={`mp-trigger${comparing ? ' is-compare' : ''} ${className}`} className={[
'app-action-button',
`mp-trigger${comparing ? ' is-compare' : ''} ${className}`,
]
.filter(Boolean)
.join(' ')}
aria-haspopup='listbox' aria-haspopup='listbox'
aria-expanded={open} aria-expanded={open}
aria-label={t('选择模型:{{name}}', { name: label })} aria-label={t('选择模型:{{name}}', { name: label })}
disabled={disabled} disabled={disabled}
onClick={() => setOpen((v) => !v)} onClick={() => setOpen((v) => !v)}
> >
{selected?.level_locked ? <Lock size={13} aria-hidden /> : null} {selected?.level_locked ? <ActionLock size={13} aria-hidden /> : null}
<span className='mp-trigger-name'>{label}</span> <span className='mp-trigger-name'>{label}</span>
<ChevronDown size={14} aria-hidden className='mp-trigger-caret' /> <ActionChevronDown size={14} aria-hidden className='mp-trigger-caret' />
</button> </button>
); );
@@ -17,9 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Code2 as ActionCode2,
ChevronDown as ActionChevronDown,
Copy as ActionCopy,
KeyRound as ActionKeyRound,
} from '@/components/common/icons/ActionIcons';
import React, { useContext, useMemo, useState } from 'react'; import React, { useContext, useMemo, useState } from 'react';
import { Button } from '@/components/ui'; import { Button } from '@/components/ui';
import { ChevronDown, Code2, Copy, KeyRound } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { StatusContext } from '../../../context/Status'; import { StatusContext } from '../../../context/Status';
@@ -84,15 +89,15 @@ const ApiCodePanel = ({ task }) => {
<section className='wf-api'> <section className='wf-api'>
<button <button
type='button' type='button'
className='wf-api-toggle' className='app-action-button wf-api-toggle'
aria-expanded={open} aria-expanded={open}
aria-controls={panelId} aria-controls={panelId}
onClick={toggle} onClick={toggle}
> >
<Code2 size={14} aria-hidden='true' /> <ActionCode2 size={14} aria-hidden='true' />
<span className='wf-api-title'>{t('获取 API 代码')}</span> <span className='wf-api-title'>{t('获取 API 代码')}</span>
<span className='wf-api-badge'>{t('API 同价')}</span> <span className='wf-api-badge'>{t('API 同价')}</span>
<ChevronDown <ActionChevronDown
size={14} size={14}
aria-hidden='true' aria-hidden='true'
className={`wf-api-caret${open ? ' is-open' : ''}`} className={`wf-api-caret${open ? ' is-open' : ''}`}
@@ -125,7 +130,7 @@ const ApiCodePanel = ({ task }) => {
<Button <Button
size='small' size='small'
theme='borderless' theme='borderless'
icon={<Copy size={12} aria-hidden='true' />} icon={<ActionCopy size={12} aria-hidden='true' />}
onClick={async () => { onClick={async () => {
if (await copy(code)) showSuccess(t('已复制')); if (await copy(code)) showSuccess(t('已复制'));
}} }}
@@ -155,7 +160,7 @@ const ApiCodePanel = ({ task }) => {
<Button <Button
size='small' size='small'
theme='solid' theme='solid'
icon={<KeyRound size={12} aria-hidden='true' />} icon={<ActionKeyRound size={12} aria-hidden='true' />}
onClick={() => navigate(KEY_MANAGEMENT_FROM_STUDIO)} onClick={() => navigate(KEY_MANAGEMENT_FROM_STUDIO)}
> >
{t('创建密钥')} {t('创建密钥')}
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { GitCompare as ActionGitCompare } from '@/components/common/icons/ActionIcons';
import {
Star as ActionStar,
Filter as ActionFilter,
} from '@/components/common/icons/ActionIcons';
import React, { import React, {
useEffect, useEffect,
useMemo, useMemo,
@@ -31,7 +36,7 @@ import {
Select, Select,
SideSheet, SideSheet,
} from '@/components/ui'; } from '@/components/ui';
import { Filter, GitCompare, Search, Star } from 'lucide-react'; import { Search } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useIsMobile } from '../../../hooks/common/useIsMobile'; import { useIsMobile } from '../../../hooks/common/useIsMobile';
import { import {
@@ -149,7 +154,7 @@ const Controls = ({ kind, api, facets, vertical, input, setInput }) => {
<Button <Button
theme={filters.favoritesOnly ? 'solid' : 'light'} theme={filters.favoritesOnly ? 'solid' : 'light'}
type={filters.favoritesOnly ? 'warning' : 'tertiary'} type={filters.favoritesOnly ? 'warning' : 'tertiary'}
icon={<Star size={14} aria-hidden='true' />} icon={<ActionStar size={14} aria-hidden='true' />}
aria-pressed={filters.favoritesOnly} aria-pressed={filters.favoritesOnly}
onClick={() => setFilters({ favoritesOnly: !filters.favoritesOnly })} onClick={() => setFilters({ favoritesOnly: !filters.favoritesOnly })}
> >
@@ -182,7 +187,7 @@ const FilterBar = ({ kind, api, selecting, onToggleSelecting }) => {
<Button <Button
theme={selecting ? 'solid' : 'light'} theme={selecting ? 'solid' : 'light'}
type={selecting ? 'primary' : 'tertiary'} type={selecting ? 'primary' : 'tertiary'}
icon={<GitCompare size={14} aria-hidden='true' />} icon={<ActionGitCompare size={14} aria-hidden='true' />}
aria-pressed={selecting} aria-pressed={selecting}
aria-label={t('多选对比')} aria-label={t('多选对比')}
title={t('多选对比')} title={t('多选对比')}
@@ -240,7 +245,7 @@ const FilterBar = ({ kind, api, selecting, onToggleSelecting }) => {
<Button <Button
theme='light' theme='light'
type='tertiary' type='tertiary'
icon={<Filter size={16} aria-hidden='true' />} icon={<ActionFilter size={16} aria-hidden='true' />}
aria-label={t('筛选')} aria-label={t('筛选')}
aria-expanded={open} aria-expanded={open}
onClick={() => setOpen((v) => !v)} onClick={() => setOpen((v) => !v)}
+18 -11
View File
@@ -17,17 +17,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
RefreshCw as ActionRefreshCw,
Check as ActionCheck,
Star as ActionStar,
MoreHorizontal as ActionMoreHorizontal,
} from '@/components/common/icons/ActionIcons';
import React, { memo, useEffect, useRef, useState } from 'react'; import React, { memo, useEffect, useRef, useState } from 'react';
import { Button, Dropdown } from '@/components/ui'; import { Button, Dropdown } from '@/components/ui';
import { import {
AlertCircle, AlertCircle,
Check,
Clapperboard, Clapperboard,
Image as ImageIcon, Image as ImageIcon,
LayoutGrid, LayoutGrid,
MoreHorizontal,
RefreshCw,
Star,
} from 'lucide-react'; } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { renderQuota } from '../../../helpers'; import { renderQuota } from '../../../helpers';
@@ -98,7 +100,7 @@ export const ResultImage = ({ task, index, onRefresh, className, alt }) => {
<Button <Button
size='small' size='small'
theme='borderless' theme='borderless'
icon={<RefreshCw size={12} aria-hidden='true' />} icon={<ActionRefreshCw size={12} aria-hidden='true' />}
loading={busy} loading={busy}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
@@ -372,7 +374,7 @@ const WorkCard = ({
> >
<button <button
type='button' type='button'
className='wf-media' className='app-action-button wf-media'
style={{ aspectRatio: String(ratio) }} style={{ aspectRatio: String(ratio) }}
onClick={handleMediaClick} onClick={handleMediaClick}
aria-label={mediaLabel} aria-label={mediaLabel}
@@ -402,7 +404,7 @@ const WorkCard = ({
) : null} ) : null}
{selecting && selectable ? ( {selecting && selectable ? (
<span className='wf-check' aria-hidden='true'> <span className='wf-check' aria-hidden='true'>
{selected ? <Check size={14} /> : null} {selected ? <ActionCheck size={14} /> : null}
</span> </span>
) : null} ) : null}
</button> </button>
@@ -422,13 +424,18 @@ const WorkCard = ({
{!active ? ( {!active ? (
<button <button
type='button' type='button'
className={`wf-icon-btn${task.favorited ? ' is-on' : ''}`} className={[
'app-action-button',
`wf-icon-btn${task.favorited ? ' is-on' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-pressed={task.favorited} aria-pressed={task.favorited}
aria-label={task.favorited ? t('取消收藏') : t('收藏')} aria-label={task.favorited ? t('取消收藏') : t('收藏')}
title={task.favorited ? t('取消收藏') : t('收藏')} title={task.favorited ? t('取消收藏') : t('收藏')}
onClick={() => onFavorite?.(task)} onClick={() => onFavorite?.(task)}
> >
<Star <ActionStar
size={15} size={15}
aria-hidden='true' aria-hidden='true'
fill={task.favorited ? 'currentColor' : 'none'} fill={task.favorited ? 'currentColor' : 'none'}
@@ -456,11 +463,11 @@ const WorkCard = ({
> >
<button <button
type='button' type='button'
className='wf-icon-btn' className='app-action-button wf-icon-btn'
aria-label={t('更多操作')} aria-label={t('更多操作')}
title={t('更多操作')} title={t('更多操作')}
> >
<MoreHorizontal size={15} aria-hidden='true' /> <ActionMoreHorizontal size={15} aria-hidden='true' />
</button> </button>
</Dropdown> </Dropdown>
) : null} ) : null}
@@ -17,9 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Star as ActionStar,
Copy as ActionCopy,
} from '@/components/common/icons/ActionIcons';
import React, { useEffect, useRef, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import { Button, SideSheet, Spin } from '@/components/ui'; import { Button, SideSheet, Spin } from '@/components/ui';
import { Copy, Star } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { ERROR_ACTIONS } from '../../../helpers/creationError'; import { ERROR_ACTIONS } from '../../../helpers/creationError';
@@ -292,7 +295,7 @@ const WorkDetailDrawer = ({
{!active ? ( {!active ? (
<Button <Button
icon={ icon={
<Star <ActionStar
size={14} size={14}
aria-hidden='true' aria-hidden='true'
fill={task.favorited ? 'currentColor' : 'none'} fill={task.favorited ? 'currentColor' : 'none'}
@@ -329,7 +332,7 @@ const WorkDetailDrawer = ({
<Button <Button
size='small' size='small'
theme='borderless' theme='borderless'
icon={<Copy size={12} aria-hidden='true' />} icon={<ActionCopy size={12} aria-hidden='true' />}
onClick={async () => { onClick={async () => {
if (await copy(task.prompt)) showSuccess(t('已复制')); if (await copy(task.prompt)) showSuccess(t('已复制'));
}} }}
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Image as TemplateImageIcon } from '@/components/common/icons/ActionIcons';
import React, { import React, {
useCallback, useCallback,
useEffect, useEffect,
@@ -31,7 +32,6 @@ import {
Dices, Dices,
Download, Download,
Film, Film,
ImageIcon,
ImagePlus, ImagePlus,
PenLine, PenLine,
RotateCcw, RotateCcw,
@@ -144,7 +144,7 @@ const useNow = (enabled) => {
const TemplateWall = ({ kind, onApply, onStart }) => { const TemplateWall = ({ kind, onApply, onStart }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const groups = useMemo(() => templateGroupsOf(kind), [kind]); const groups = useMemo(() => templateGroupsOf(kind), [kind]);
const Icon = kind === 'video' ? Clapperboard : ImageIcon; const Icon = kind === 'video' ? Clapperboard : TemplateImageIcon;
return ( return (
<div className='wf-wall'> <div className='wf-wall'>
<div className='wf-wall-head'> <div className='wf-wall-head'>
+9 -5
View File
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
RotateCcw as ActionRotateCcw,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
import { Spin, Tooltip } from '@/components/ui'; import { Spin, Tooltip } from '@/components/ui';
import { ImagePlus, RotateCcw, X } from 'lucide-react'; import { ImagePlus } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import './creation-params.css'; import './creation-params.css';
@@ -204,13 +208,13 @@ const ImageSlot = ({
{onRetry ? ( {onRetry ? (
<button <button
type='button' type='button'
className='cp-slot-action' className='app-action-button cp-slot-action'
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
onRetry(); onRetry();
}} }}
> >
<RotateCcw size={14} aria-hidden='true' /> <ActionRotateCcw size={14} aria-hidden='true' />
<span>{t('重试')}</span> <span>{t('重试')}</span>
</button> </button>
) : null} ) : null}
@@ -224,7 +228,7 @@ const ImageSlot = ({
{status !== 'empty' && onRemove && !disabled ? ( {status !== 'empty' && onRemove && !disabled ? (
<button <button
type='button' type='button'
className='cp-slot-remove' className='app-action-button cp-slot-remove'
aria-label={t('移除{{label}}', { label: labelText })} aria-label={t('移除{{label}}', { label: labelText })}
title={t('移除')} title={t('移除')}
onClick={(e) => { onClick={(e) => {
@@ -232,7 +236,7 @@ const ImageSlot = ({
onRemove(); onRemove();
}} }}
> >
<X size={14} aria-hidden='true' /> <ActionX size={14} aria-hidden='true' />
</button> </button>
) : null} ) : null}
+1 -1
View File
@@ -81,7 +81,7 @@ const SeedInput = ({ param, value, onChange, disabledReason }) => {
/> />
<button <button
type='button' type='button'
className='cp-icon-btn' className='app-action-button cp-icon-btn'
disabled={disabled} disabled={disabled}
aria-label={t('随机生成一个种子并锁定')} aria-label={t('随机生成一个种子并锁定')}
title={t('随机生成一个种子并锁定')} title={t('随机生成一个种子并锁定')}
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { MessageCircle as ActionMessageCircle } from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Avatar, Button } from '@/components/ui'; import { Avatar, Button } from '@/components/ui';
import { import {
@@ -213,7 +214,7 @@ const CustomerServiceQRCard = ({ agent }) => {
theme='light' theme='light'
type='tertiary' type='tertiary'
size='small' size='small'
icon={<MessageCircle size={12} />} icon={<ActionMessageCircle size={12} />}
onClick={() => window.open(agent.wecom_url, '_blank')} onClick={() => window.open(agent.wecom_url, '_blank')}
className='w-full !rounded-lg mt-2 !text-xs' className='w-full !rounded-lg mt-2 !text-xs'
> >
@@ -234,7 +235,7 @@ const CustomerServiceQRCard = ({ agent }) => {
<Button <Button
theme='solid' theme='solid'
type='primary' type='primary'
icon={<MessageCircle size={14} />} icon={<ActionMessageCircle size={14} />}
onClick={() => window.open(agent.wecom_url, '_blank')} onClick={() => window.open(agent.wecom_url, '_blank')}
className='w-full !bg-gradient-to-r !from-brand-from !to-brand-to hover:!from-brand-from hover:!to-brand-to !rounded-xl' className='w-full !bg-gradient-to-r !from-brand-from !to-brand-to hover:!from-brand-from hover:!to-brand-to !rounded-xl'
> >
+19 -14
View File
@@ -16,15 +16,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Headphones as ActionHeadphones,
ChevronLeft as ActionChevronLeft,
ChevronRight as ActionChevronRight,
X as ActionX,
RefreshCw as ActionRefreshCw,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useCallback, useRef } from 'react'; import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Avatar, Tag, Spin, Empty, Button, Divider, theme } from 'antd'; import { Avatar, Tag, Spin, Empty, Button, Divider, theme } from 'antd';
import {
X,
RefreshCw,
Headphones,
ChevronLeft,
ChevronRight,
} from 'lucide-react';
import { API } from '../../helpers'; import { API } from '../../helpers';
import { getServerURL } from '../../helpers/config'; import { getServerURL } from '../../helpers/config';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -287,7 +288,7 @@ const CustomerServiceFloat = () => {
title={t('联系客服')} title={t('联系客服')}
aria-label={t('联系客服')} aria-label={t('联系客服')}
onClick={handleExpand} onClick={handleExpand}
icon={<Headphones size={16} strokeWidth={2} />} icon={<ActionHeadphones size={16} strokeWidth={2} />}
/> />
<Button <Button
className='cs-float-tab-action' className='cs-float-tab-action'
@@ -296,7 +297,7 @@ const CustomerServiceFloat = () => {
aria-label={t('展开')} aria-label={t('展开')}
aria-expanded={false} aria-expanded={false}
onClick={() => setIsCollapsed(false)} onClick={() => setIsCollapsed(false)}
icon={<ChevronLeft size={16} strokeWidth={2} />} icon={<ActionChevronLeft size={16} strokeWidth={2} />}
/> />
</div> </div>
) : ( ) : (
@@ -308,7 +309,11 @@ const CustomerServiceFloat = () => {
aria-expanded={true} aria-expanded={true}
onClick={() => setIsCollapsed(true)} onClick={() => setIsCollapsed(true)}
> >
<ChevronRight size={16} strokeWidth={2} aria-hidden='true' /> <ActionChevronRight
size={16}
strokeWidth={2}
aria-hidden='true'
/>
</Button> </Button>
))} ))}
<div <div
@@ -326,9 +331,9 @@ const CustomerServiceFloat = () => {
aria-label={isOpen ? t('关闭客服') : t('联系客服')} aria-label={isOpen ? t('关闭客服') : t('联系客服')}
icon={ icon={
isOpen ? ( isOpen ? (
<X size={22} strokeWidth={1.5} /> <ActionX size={22} strokeWidth={1.5} />
) : ( ) : (
<Headphones size={22} strokeWidth={1.5} /> <ActionHeadphones size={22} strokeWidth={1.5} />
) )
} }
/> />
@@ -356,7 +361,7 @@ const CustomerServiceFloat = () => {
className='cs-close-btn' className='cs-close-btn'
onClick={handleClose} onClick={handleClose}
aria-label={t('关闭')} aria-label={t('关闭')}
icon={<X size={16} strokeWidth={1.5} />} icon={<ActionX size={16} strokeWidth={1.5} />}
/> />
</div> </div>
</div> </div>
@@ -370,7 +375,7 @@ const CustomerServiceFloat = () => {
<div className='cs-error'> <div className='cs-error'>
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={error} /> <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={error} />
<Button <Button
icon={<RefreshCw size={14} />} icon={<ActionRefreshCw size={14} />}
onClick={fetchAllocatedAgent} onClick={fetchAllocatedAgent}
> >
{t('重新获取')} {t('重新获取')}
+6 -3
View File
@@ -17,9 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Search as ActionSearch,
RefreshCw as ActionRefreshCw,
} from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button } from '@/components/ui'; import { Button } from '@/components/ui';
import { RefreshCw, Search } from 'lucide-react';
const DashboardHeader = ({ const DashboardHeader = ({
getGreeting, getGreeting,
@@ -42,13 +45,13 @@ const DashboardHeader = ({
<div className='flex gap-3'> <div className='flex gap-3'>
<Button <Button
type='tertiary' type='tertiary'
icon={<Search size={16} />} icon={<ActionSearch size={16} />}
onClick={showSearchModal} onClick={showSearchModal}
className={`bg-green-500 hover:bg-green-600 ${ICON_BUTTON_CLASS}`} className={`bg-green-500 hover:bg-green-600 ${ICON_BUTTON_CLASS}`}
/> />
<Button <Button
type='tertiary' type='tertiary'
icon={<RefreshCw size={16} />} icon={<ActionRefreshCw size={16} />}
onClick={refresh} onClick={refresh}
loading={loading} loading={loading}
className={`bg-blue-500 hover:bg-blue-600 ${ICON_BUTTON_CLASS}`} className={`bg-blue-500 hover:bg-blue-600 ${ICON_BUTTON_CLASS}`}
+3 -2
View File
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { RefreshCw as ActionRefreshCw } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Card, Button, Spin, Tabs, TabPane, Tag, Empty } from '@/components/ui'; import { Card, Button, Spin, Tabs, TabPane, Tag, Empty } from '@/components/ui';
import { Gauge, RefreshCw } from 'lucide-react'; import { Gauge } from 'lucide-react';
import { import {
IllustrationConstruction, IllustrationConstruction,
IllustrationConstructionDark, IllustrationConstructionDark,
@@ -49,7 +50,7 @@ const UptimePanel = ({
{t('服务可用性')} {t('服务可用性')}
</div> </div>
<Button <Button
icon={<RefreshCw size={14} />} icon={<ActionRefreshCw size={14} />}
onClick={loadUptimeData} onClick={loadUptimeData}
loading={uptimeLoading} loading={uptimeLoading}
size='small' size='small'
-1
View File
@@ -80,7 +80,6 @@ const Dashboard = () => {
dashboardData.consumeQuota, dashboardData.consumeQuota,
dashboardData.consumeTokens, dashboardData.consumeTokens,
dashboardData.times, dashboardData.times,
dashboardData.trendData,
dashboardData.performanceMetrics, dashboardData.performanceMetrics,
dashboardData.navigate, dashboardData.navigate,
dashboardData.t, dashboardData.t,
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
X as ActionX,
Search as ActionSearch,
} from '@/components/common/icons/ActionIcons';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { Modal, Form, Button } from '@/components/ui'; import { Modal, Form, Button } from '@/components/ui';
import { Filter, Calendar, Clock, User, Search, X } from 'lucide-react'; import { Filter, Calendar, Clock, User } from 'lucide-react';
const SearchModal = ({ const SearchModal = ({
searchModalVisible, searchModalVisible,
@@ -65,7 +69,7 @@ const SearchModal = ({
onClick={handleCloseModal} onClick={handleCloseModal}
className='!rounded-xl !px-5 !h-10 !bg-gray-100 dark:!bg-gray-700 !border-0 hover:!bg-gray-200 dark:hover:!bg-gray-600 !transition-all' className='!rounded-xl !px-5 !h-10 !bg-gray-100 dark:!bg-gray-700 !border-0 hover:!bg-gray-200 dark:hover:!bg-gray-600 !transition-all'
style={{ color: '#4b5563' }} style={{ color: '#4b5563' }}
icon={<X size={16} style={{ color: '#4b5563' }} />} icon={<ActionX size={16} style={{ color: '#4b5563' }} />}
> >
{t('取消')} {t('取消')}
</Button> </Button>
@@ -74,7 +78,7 @@ const SearchModal = ({
onClick={handleSearchConfirm} onClick={handleSearchConfirm}
className='!rounded-xl !px-5 !h-10 !bg-gradient-to-r !from-blue-500 !to-brand-to !border-0 hover:!opacity-90 !transition-all !shadow-lg !shadow-blue-500/25' className='!rounded-xl !px-5 !h-10 !bg-gradient-to-r !from-blue-500 !to-brand-to !border-0 hover:!opacity-90 !transition-all !shadow-lg !shadow-blue-500/25'
style={{ color: '#ffffff' }} style={{ color: '#ffffff' }}
icon={<Search size={16} style={{ color: '#ffffff' }} />} icon={<ActionSearch size={16} style={{ color: '#ffffff' }} />}
> >
{t('查询')} {t('查询')}
</Button> </Button>
+3 -2
View File
@@ -16,9 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { X as ActionX } from '@/components/common/icons/ActionIcons';
import React, { useContext, useMemo, useRef, useState, useEffect } from 'react'; import React, { useContext, useMemo, useRef, useState, useEffect } from 'react';
import { StatusContext } from '../../context/Status'; import { StatusContext } from '../../context/Status';
import { Megaphone, X } from 'lucide-react'; import { Megaphone } from 'lucide-react';
import { Button } from 'antd'; import { Button } from 'antd';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useMarquee } from '../../hooks/common/useMarquee'; import { useMarquee } from '../../hooks/common/useMarquee';
@@ -145,7 +146,7 @@ const Marquee = () => {
size='small' size='small'
className='marquee-close flex-shrink-0 ml-4 z-10' className='marquee-close flex-shrink-0 ml-4 z-10'
aria-label={t('关闭')} aria-label={t('关闭')}
icon={<X size={14} aria-hidden />} icon={<ActionX size={14} aria-hidden />}
onClick={dismiss} onClick={dismiss}
/> />
</div> </div>
+13 -5
View File
@@ -17,12 +17,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
ChevronDown as ActionChevronDown,
ChevronRight as ActionChevronRight,
ChevronLeft as ActionChevronLeft,
} from '@/components/common/icons/ActionIcons';
import { consoleMenuPaths, getConsoleMenuKeys } from '../console/consoleRoutes'; import { consoleMenuPaths, getConsoleMenuKeys } from '../console/consoleRoutes';
import React, { useContext, useEffect, useMemo, useState } from 'react'; import React, { useContext, useEffect, useMemo, useState } from 'react';
import { Link, useLocation } from 'react-router-dom'; import { Link, useLocation } from 'react-router-dom';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { getLucideIcon } from '../../helpers/render'; import { getLucideIcon } from '../../helpers/render';
import { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-react';
import '../../styles/center-layout.css'; import '../../styles/center-layout.css';
import { useSidebarCollapsed } from '../../hooks/common/useSidebarCollapsed'; import { useSidebarCollapsed } from '../../hooks/common/useSidebarCollapsed';
import { useSidebar } from '../../hooks/common/useSidebar'; import { useSidebar } from '../../hooks/common/useSidebar';
@@ -419,7 +423,7 @@ const SiderBar = ({ onNavigate = () => {}, forceExpanded = false }) => {
{!collapsed && ( {!collapsed && (
<button <button
type='button' type='button'
className='ui-org-group-toggle' className='app-action-button ui-org-group-toggle'
aria-expanded={!foldedGroups.includes(key)} aria-expanded={!foldedGroups.includes(key)}
onClick={() => onClick={() =>
setFoldedGroups((previous) => setFoldedGroups((previous) =>
@@ -430,7 +434,7 @@ const SiderBar = ({ onNavigate = () => {}, forceExpanded = false }) => {
} }
> >
<span>{label}</span> <span>{label}</span>
<ChevronDown <ActionChevronDown
size={13} size={13}
className={foldedGroups.includes(key) ? 'is-folded' : ''} className={foldedGroups.includes(key) ? 'is-folded' : ''}
aria-hidden='true' aria-hidden='true'
@@ -555,11 +559,15 @@ const SiderBar = ({ onNavigate = () => {}, forceExpanded = false }) => {
{!forceExpanded && ( {!forceExpanded && (
<button <button
type='button' type='button'
className='ui-center-sidebar-collapse' className='app-action-button ui-center-sidebar-collapse'
onClick={toggleCollapsed} onClick={toggleCollapsed}
aria-label={collapsed ? t('展开导航') : t('收起导航')} aria-label={collapsed ? t('展开导航') : t('收起导航')}
> >
{collapsed ? <ChevronRight size={16} /> : <ChevronLeft size={16} />} {collapsed ? (
<ActionChevronRight size={16} />
) : (
<ActionChevronLeft size={16} />
)}
{!collapsed && <span>{t('收起导航')}</span>} {!collapsed && <span>{t('收起导航')}</span>}
</button> </button>
)} )}
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Globe as ActionGlobe } from '@/components/common/icons/ActionIcons';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Button as AntButton } from 'antd'; import { Button as AntButton } from 'antd';
import { Dropdown } from '@/components/ui'; import { Dropdown } from '@/components/ui';
import { Globe } from 'lucide-react';
import { CN, GB, JP, KR, TH, VN } from 'country-flag-icons/react/3x2'; import { CN, GB, JP, KR, TH, VN } from 'country-flag-icons/react/3x2';
import { normalizeLanguage } from '../../../i18n/language'; import { normalizeLanguage } from '../../../i18n/language';
import { orderEnabledLanguages } from '../../../i18n/catalog'; import { orderEnabledLanguages } from '../../../i18n/catalog';
@@ -80,7 +80,7 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
> >
<AntButton <AntButton
type='text' type='text'
icon={<Globe size={16} strokeWidth={1.5} aria-hidden />} icon={<ActionGlobe size={16} strokeWidth={1.5} aria-hidden />}
aria-label={t('common.changeLanguage')} aria-label={t('common.changeLanguage')}
className='ui-header-icon-action' className='ui-header-icon-action'
/> />
@@ -17,10 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Compass as ActionCompass } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom'; import { useLocation, useNavigate } from 'react-router-dom';
import { Button, Dropdown } from '@/components/ui'; import { Button, Dropdown } from '@/components/ui';
import { Compass, ExternalLink } from 'lucide-react'; import { ExternalLink } from 'lucide-react';
import { isNavigationPathActive } from '../../console/consoleRoutes'; import { isNavigationPathActive } from '../../console/consoleRoutes';
/** /**
@@ -138,7 +139,7 @@ const MobileNavMenu = ({ mainNavLinks, userState, t }) => {
aria-label={t('主导航')} aria-label={t('主导航')}
aria-haspopup='menu' aria-haspopup='menu'
aria-expanded={visible} aria-expanded={visible}
icon={<Compass size={16} />} icon={<ActionCompass size={16} />}
className='!ml-1 !px-2 !h-8 max-w-[9rem] !rounded-xl !text-current hover:!bg-brand/10 dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !transition-all !duration-200 active:!scale-95 [&_.ant-btn-content]:min-w-0' className='!ml-1 !px-2 !h-8 max-w-[9rem] !rounded-xl !text-current hover:!bg-brand/10 dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !transition-all !duration-200 active:!scale-95 [&_.ant-btn-content]:min-w-0'
> >
<span className='ml-1 text-[13px] font-semibold truncate'> <span className='ml-1 text-[13px] font-semibold truncate'>
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Volume1 as ActionVolume1 } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Badge, Button, Tooltip } from 'antd'; import { Badge, Button, Tooltip } from 'antd';
import { Volume1 } from 'lucide-react';
// 系统公告入口:34px text 按钮、16px 喇叭图标。 // 系统公告入口:34px text 按钮、16px 喇叭图标。
// 显隐(rightActions.notifications)、点击(打开 NoticeModal)与未读数均沿用原逻辑。 // 显隐(rightActions.notifications)、点击(打开 NoticeModal)与未读数均沿用原逻辑。
@@ -30,7 +30,7 @@ const NotificationButton = ({ unreadCount, onNoticeOpen, t }) => (
type='text' type='text'
className='ui-header-icon-action' className='ui-header-icon-action'
aria-label={t('系统公告')} aria-label={t('系统公告')}
icon={<Volume1 size={16} strokeWidth={1.5} aria-hidden />} icon={<ActionVolume1 size={16} strokeWidth={1.5} aria-hidden />}
onClick={onNoticeOpen} onClick={onNoticeOpen}
/> />
</Badge> </Badge>
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
import React from 'react'; import React from 'react';
import { Button, Tooltip } from 'antd'; import { Button, Tooltip } from 'antd';
import { Moon, Sun } from 'lucide-react'; import { Moon, Sun } from '../../common/icons/ActionIcons';
import { useActualTheme } from '../../../context/Theme'; import { useActualTheme } from '../../../context/Theme';
const ThemeToggle = ({ onThemeToggle, t }) => { const ThemeToggle = ({ onThemeToggle, t }) => {
+3 -2
View File
@@ -17,11 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { ChevronDown as ActionChevronDown } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Link, useLocation } from 'react-router-dom'; import { Link, useLocation } from 'react-router-dom';
import { Avatar, Button as AntButton, Dropdown as AntDropdown } from 'antd'; import { Avatar, Button as AntButton, Dropdown as AntDropdown } from 'antd';
import { Button } from '@/components/ui'; import { Button } from '@/components/ui';
import { ChevronDown, UserRound, KeyRound, LogOut } from 'lucide-react'; import { UserRound, KeyRound, LogOut } from 'lucide-react';
import { getUserAvatarUrl, isAuthPagePath } from '../../../helpers'; import { getUserAvatarUrl, isAuthPagePath } from '../../../helpers';
import SkeletonWrapper from '../components/SkeletonWrapper'; import SkeletonWrapper from '../components/SkeletonWrapper';
import { isHeaderModuleEnabled } from '../../../constants/headerNavModules'; import { isHeaderModuleEnabled } from '../../../constants/headerNavModules';
@@ -183,7 +184,7 @@ const UserArea = ({
{avatarInitial} {avatarInitial}
</Avatar> </Avatar>
<span className='ui-header-account-name'>{displayName}</span> <span className='ui-header-account-name'>{displayName}</span>
<ChevronDown <ActionChevronDown
size={10} size={10}
strokeWidth={1.5} strokeWidth={1.5}
aria-hidden aria-hidden
+16 -17
View File
@@ -17,6 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
EyeOff as ActionEyeOff,
Eye as ActionEye,
X as ActionX,
ArrowDown as ActionArrowDown,
} from '@/components/common/icons/ActionIcons';
import React, { useContext } from 'react'; import React, { useContext } from 'react';
import { import {
Card, Card,
@@ -31,7 +37,6 @@ import {
import { import {
MessageSquare, MessageSquare,
Eye, Eye,
EyeOff,
Sparkles, Sparkles,
Brain, Brain,
Code2, Code2,
@@ -44,8 +49,6 @@ import {
Layers, Layers,
Paintbrush, Paintbrush,
Upload, Upload,
ArrowDown,
X,
ListChecks, ListChecks,
} from 'lucide-react'; } from 'lucide-react';
import { useChatScroll } from '../../hooks/playground/useChatScroll'; import { useChatScroll } from '../../hooks/playground/useChatScroll';
@@ -597,7 +600,7 @@ const ChatArea = ({
type='button' type='button'
onClick={onEnterSelectionMode} onClick={onEnterSelectionMode}
aria-label={t('多选导出')} aria-label={t('多选导出')}
className='flex items-center gap-2 cursor-pointer px-4 py-2 rounded-xl bg-white/80 dark:bg-neutral-800/80 backdrop-blur-md border border-gray-200/60 dark:border-neutral-700/60 shadow-[0_2px_8px_rgba(0,0,0,0.04)] hover:shadow-[0_4px_16px_rgba(139,92,246,0.12)] hover:border-brand-from/80 dark:hover:border-brand-deep/60 transition-all duration-300' className='app-action-button flex items-center gap-2 cursor-pointer px-4 py-2 rounded-xl bg-white/80 dark:bg-neutral-800/80 backdrop-blur-md border border-gray-200/60 dark:border-neutral-700/60 shadow-[0_2px_8px_rgba(0,0,0,0.04)] hover:shadow-[0_4px_16px_rgba(139,92,246,0.12)] hover:border-brand-from/80 dark:hover:border-brand-deep/60 transition-all duration-300'
> >
<ListChecks size={14} className='text-brand flex-shrink-0' /> <ListChecks size={14} className='text-brand flex-shrink-0' />
<span className='text-sm font-medium text-gray-700 dark:text-gray-200'> <span className='text-sm font-medium text-gray-700 dark:text-gray-200'>
@@ -626,7 +629,11 @@ const ChatArea = ({
<div className='flex items-center gap-2'> <div className='flex items-center gap-2'>
<Button <Button
icon={ icon={
showDebugPanel ? <EyeOff size={14} /> : <Eye size={14} /> showDebugPanel ? (
<ActionEyeOff size={14} />
) : (
<ActionEye size={14} />
)
} }
onClick={onToggleDebugPanel} onClick={onToggleDebugPanel}
theme='borderless' theme='borderless'
@@ -935,10 +942,10 @@ const ChatArea = ({
<button <button
type='button' type='button'
onClick={() => setLongConvHintDismissed(true)} onClick={() => setLongConvHintDismissed(true)}
className='flex-shrink-0 text-amber-500 hover:text-amber-700 dark:hover:text-amber-300' className='app-action-button flex-shrink-0 text-amber-500 hover:text-amber-700 dark:hover:text-amber-300'
aria-label={t('关闭提示')} aria-label={t('关闭提示')}
> >
<X size={14} /> <ActionX size={14} />
</button> </button>
</div> </div>
)} )}
@@ -982,18 +989,10 @@ const ChatArea = ({
type='button' type='button'
onClick={() => scrollToBottom()} onClick={() => scrollToBottom()}
style={{ bottom: 'calc(var(--composer-height, 90px) + 14px)' }} style={{ bottom: 'calc(var(--composer-height, 90px) + 14px)' }}
className=' className='app-action-button \n absolute z-30 left-1/2 -translate-x-1/2\n flex items-center gap-1.5 px-3 py-1.5 rounded-full\n bg-white/95 dark:bg-neutral-800/95 backdrop-blur-sm\n border border-gray-200/80 dark:border-neutral-700/80\n text-xs font-medium text-gray-700 dark:text-gray-200\n shadow-md hover:shadow-lg hover:scale-105 active:scale-95\n transition-all duration-200\n '
absolute z-30 left-1/2 -translate-x-1/2
flex items-center gap-1.5 px-3 py-1.5 rounded-full
bg-white/95 dark:bg-neutral-800/95 backdrop-blur-sm
border border-gray-200/80 dark:border-neutral-700/80
text-xs font-medium text-gray-700 dark:text-gray-200
shadow-md hover:shadow-lg hover:scale-105 active:scale-95
transition-all duration-200
'
title={t('回到最新消息')} title={t('回到最新消息')}
> >
<ArrowDown size={13} className='text-brand' /> <ActionArrowDown size={13} className='text-brand' />
{t('回到最新')} {t('回到最新')}
</button> </button>
)} )}
+11 -3
View File
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Copy as ActionCopy,
ChevronUp as ActionChevronUp,
ChevronDown as ActionChevronDown,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useMemo, useCallback } from 'react'; import React, { useState, useMemo, useCallback } from 'react';
import { Button, Tooltip, Toast } from '@/components/ui'; import { Button, Tooltip, Toast } from '@/components/ui';
import { Copy, ChevronDown, ChevronUp } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { copy } from '../../helpers'; import { copy } from '../../helpers';
@@ -256,7 +260,7 @@ const CodeViewer = ({ content, title, language = 'json' }) => {
> >
<Tooltip content={copied ? t('已复制') : t('复制代码')}> <Tooltip content={copied ? t('已复制') : t('复制代码')}>
<Button <Button
icon={<Copy size={14} />} icon={<ActionCopy size={14} />}
onClick={handleCopy} onClick={handleCopy}
size='small' size='small'
theme='borderless' theme='borderless'
@@ -319,7 +323,11 @@ const CodeViewer = ({ content, title, language = 'json' }) => {
<Tooltip content={isExpanded ? t('收起内容') : t('显示完整内容')}> <Tooltip content={isExpanded ? t('收起内容') : t('显示完整内容')}>
<Button <Button
icon={ icon={
isExpanded ? <ChevronUp size={14} /> : <ChevronDown size={14} /> isExpanded ? (
<ActionChevronUp size={14} />
) : (
<ActionChevronDown size={14} />
)
} }
onClick={handleToggleExpand} onClick={handleToggleExpand}
size='small' size='small'
+11 -5
View File
@@ -17,9 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Settings2 as ActionSettings2,
RotateCcw as ActionRotateCcw,
Download as ActionDownload,
Upload as ActionUpload,
} from '@/components/common/icons/ActionIcons';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { Button, Typography, Toast, Modal, Dropdown } from '@/components/ui'; import { Button, Typography, Toast, Modal, Dropdown } from '@/components/ui';
import { Download, Upload, RotateCcw, Settings2 } from 'lucide-react'; import { Download, Upload, RotateCcw } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import {
exportConfig, exportConfig,
@@ -205,7 +211,7 @@ const ConfigManager = ({
menu={dropdownItems} menu={dropdownItems}
> >
<Button <Button
icon={<Settings2 size={14} />} icon={<ActionSettings2 size={14} />}
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
size='small' size='small'
@@ -233,7 +239,7 @@ const ConfigManager = ({
{getConfigStatus()} {getConfigStatus()}
</Typography.Text> </Typography.Text>
<Button <Button
icon={<RotateCcw size={12} />} icon={<ActionRotateCcw size={12} />}
size='small' size='small'
theme='borderless' theme='borderless'
type='danger' type='danger'
@@ -245,7 +251,7 @@ const ConfigManager = ({
{/* 导出和导入按钮 */} {/* 导出和导入按钮 */}
<div className='flex gap-2'> <div className='flex gap-2'>
<Button <Button
icon={<Download size={12} />} icon={<ActionDownload size={12} />}
size='small' size='small'
theme='solid' theme='solid'
type='primary' type='primary'
@@ -256,7 +262,7 @@ const ConfigManager = ({
</Button> </Button>
<Button <Button
icon={<Upload size={12} />} icon={<ActionUpload size={12} />}
size='small' size='small'
theme='outline' theme='outline'
type='primary' type='primary'
+71 -34
View File
@@ -17,21 +17,23 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
AlertTriangle as ActionAlertTriangle,
RotateCw as ActionRotateCw,
X as ActionX,
Paperclip as ActionPaperclip,
MicOff as ActionMicOff,
Mic as ActionMic,
Globe as ActionGlobe,
} from '@/components/common/icons/ActionIcons';
import React, { useRef, useEffect, useCallback, useContext } from 'react'; import React, { useRef, useEffect, useCallback, useContext } from 'react';
import { Toast, Tooltip, Modal } from '@/components/ui'; import { Toast, Tooltip, Modal } from '@/components/ui';
import { import {
Globe,
Paperclip,
X,
FileText, FileText,
Image as ImageIcon, Image as ImageIcon,
Paintbrush, Paintbrush,
RotateCw,
AlertCircle, AlertCircle,
AlertTriangle,
Loader2, Loader2,
Mic,
MicOff,
} from 'lucide-react'; } from 'lucide-react';
import { useSpeechRecognition } from '../../hooks/playground/useSpeechRecognition'; import { useSpeechRecognition } from '../../hooks/playground/useSpeechRecognition';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -242,9 +244,9 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => {
aria-label={t('查看 {{old}} 格式转换说明', { aria-label={t('查看 {{old}} 格式转换说明', {
old: legacyFormat.old, old: legacyFormat.old,
})} })}
className='absolute -top-1 -right-1 w-4 h-4 flex items-center justify-center bg-amber-500 rounded-full ring-1 ring-white dark:ring-neutral-900 cursor-pointer hover:bg-amber-600 transition-colors z-10' className='app-action-button absolute -top-1 -right-1 w-4 h-4 flex items-center justify-center bg-amber-500 rounded-full ring-1 ring-white dark:ring-neutral-900 cursor-pointer hover:bg-amber-600 transition-colors z-10'
> >
<AlertTriangle size={9} className='text-white' /> <ActionAlertTriangle size={9} className='text-white' />
</button> </button>
</Tooltip> </Tooltip>
)} )}
@@ -295,10 +297,10 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => {
e.stopPropagation(); e.stopPropagation();
onRetry(file.id); onRetry(file.id);
}} }}
className='w-5 h-5 flex items-center justify-center rounded text-red-500 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors' className='app-action-button w-5 h-5 flex items-center justify-center rounded text-red-500 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors'
title={t('重试上传')} title={t('重试上传')}
> >
<RotateCw size={11} /> <ActionRotateCw size={11} />
</button> </button>
)} )}
<button <button
@@ -306,10 +308,10 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => {
e.stopPropagation(); e.stopPropagation();
handleRemoveWithUndo({ file, onRemove, onRestore, t }); handleRemoveWithUndo({ file, onRemove, onRestore, t });
}} }}
className='w-5 h-5 flex items-center justify-center rounded text-gray-400 hover:text-red-500 hover:bg-gray-100 dark:hover:bg-neutral-700 transition-colors' className='app-action-button w-5 h-5 flex items-center justify-center rounded text-gray-400 hover:text-red-500 hover:bg-gray-100 dark:hover:bg-neutral-700 transition-colors'
title={isUploading ? t('取消上传') : t('移除')} title={isUploading ? t('取消上传') : t('移除')}
> >
<X size={11} /> <ActionX size={11} />
</button> </button>
</div> </div>
@@ -719,14 +721,19 @@ const CustomInputRender = (props) => {
fileInputRef.current?.click(); fileInputRef.current?.click();
}} }}
disabled={uploadDisabled} disabled={uploadDisabled}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl bg-gray-50 dark:bg-neutral-800 border border-gray-200/60 dark:border-neutral-700/60 transition-all duration-300 flex-shrink-0 ${ className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl bg-gray-50 dark:bg-neutral-800 border border-gray-200/60 dark:border-neutral-700/60 transition-all duration-300 flex-shrink-0 ${
uploadDisabled uploadDisabled
? 'opacity-40 cursor-not-allowed text-gray-300 dark:text-neutral-600' ? 'opacity-40 cursor-not-allowed text-gray-300 dark:text-neutral-600'
: 'text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/30 hover:border-blue-200 dark:hover:border-blue-800 hover:scale-105 active:scale-95' : 'text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/30 hover:border-blue-200 dark:hover:border-blue-800 hover:scale-105 active:scale-95'
}`} }`,
]
.filter(Boolean)
.join(' ')}
style={{ boxShadow: '0 1px 3px rgba(0,0,0,0.04)' }} style={{ boxShadow: '0 1px 3px rgba(0,0,0,0.04)' }}
> >
<Paperclip size={16} /> <ActionPaperclip size={16} />
</button> </button>
</Tooltip> </Tooltip>
); );
@@ -818,11 +825,16 @@ const CustomInputRender = (props) => {
e.stopPropagation(); e.stopPropagation();
speech.toggle(); speech.toggle();
}} }}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${ className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
speech.isListening speech.isListening
? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse' ? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30' : 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30'
}`} }`,
]
.filter(Boolean)
.join(' ')}
style={{ style={{
boxShadow: speech.isListening boxShadow: speech.isListening
? undefined ? undefined
@@ -830,9 +842,9 @@ const CustomInputRender = (props) => {
}} }}
> >
{speech.isListening ? ( {speech.isListening ? (
<MicOff size={16} /> <ActionMicOff size={16} />
) : ( ) : (
<Mic size={16} /> <ActionMic size={16} />
)} )}
</button> </button>
</Tooltip> </Tooltip>
@@ -851,18 +863,23 @@ const CustomInputRender = (props) => {
e.stopPropagation(); e.stopPropagation();
onToggleWebSearch && onToggleWebSearch(); onToggleWebSearch && onToggleWebSearch();
}} }}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${ className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
enableWebSearch enableWebSearch
? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10' ? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30' : 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30'
}`} }`,
]
.filter(Boolean)
.join(' ')}
style={{ style={{
boxShadow: enableWebSearch boxShadow: enableWebSearch
? undefined ? undefined
: '0 1px 3px rgba(0,0,0,0.04)', : '0 1px 3px rgba(0,0,0,0.04)',
}} }}
> >
<Globe size={16} /> <ActionGlobe size={16} />
</button> </button>
</Tooltip> </Tooltip>
)} )}
@@ -883,11 +900,16 @@ const CustomInputRender = (props) => {
onToggleImageGenMode && onToggleImageGenMode(); onToggleImageGenMode && onToggleImageGenMode();
}} }}
disabled={isImageGenerating} disabled={isImageGenerating}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${ className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
imageGenMode imageGenMode
? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10' ? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30' : 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30'
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`} } ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`,
]
.filter(Boolean)
.join(' ')}
style={{ style={{
boxShadow: imageGenMode boxShadow: imageGenMode
? undefined ? undefined
@@ -939,11 +961,16 @@ const CustomInputRender = (props) => {
e.stopPropagation(); e.stopPropagation();
speech.toggle(); speech.toggle();
}} }}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${ className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
speech.isListening speech.isListening
? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse' ? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30' : 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30'
}`} }`,
]
.filter(Boolean)
.join(' ')}
style={{ style={{
boxShadow: speech.isListening boxShadow: speech.isListening
? undefined ? undefined
@@ -951,9 +978,9 @@ const CustomInputRender = (props) => {
}} }}
> >
{speech.isListening ? ( {speech.isListening ? (
<MicOff size={16} /> <ActionMicOff size={16} />
) : ( ) : (
<Mic size={16} /> <ActionMic size={16} />
)} )}
</button> </button>
</Tooltip> </Tooltip>
@@ -972,18 +999,23 @@ const CustomInputRender = (props) => {
e.stopPropagation(); e.stopPropagation();
onToggleWebSearch && onToggleWebSearch(); onToggleWebSearch && onToggleWebSearch();
}} }}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${ className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
enableWebSearch enableWebSearch
? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10' ? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30' : 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30'
}`} }`,
]
.filter(Boolean)
.join(' ')}
style={{ style={{
boxShadow: enableWebSearch boxShadow: enableWebSearch
? undefined ? undefined
: '0 1px 3px rgba(0,0,0,0.04)', : '0 1px 3px rgba(0,0,0,0.04)',
}} }}
> >
<Globe size={16} /> <ActionGlobe size={16} />
</button> </button>
</Tooltip> </Tooltip>
)} )}
@@ -1004,11 +1036,16 @@ const CustomInputRender = (props) => {
onToggleImageGenMode && onToggleImageGenMode(); onToggleImageGenMode && onToggleImageGenMode();
}} }}
disabled={isImageGenerating} disabled={isImageGenerating}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${ className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
imageGenMode imageGenMode
? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10' ? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30' : 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30'
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`} } ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`,
]
.filter(Boolean)
.join(' ')}
style={{ style={{
boxShadow: imageGenMode boxShadow: imageGenMode
? undefined ? undefined
@@ -17,10 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Edit as ActionEdit } from '@/components/common/icons/ActionIcons';
import { useEffectEvent } from '../../hooks/common/useEffectEvent'; import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { TextArea, Typography, Button, Switch, Banner } from '@/components/ui'; import { TextArea, Typography, Button, Switch, Banner } from '@/components/ui';
import { Code, Edit, Check, X, AlertTriangle } from 'lucide-react'; import { Code, Check, X, AlertTriangle } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const CustomRequestEditor = ({ const CustomRequestEditor = ({
@@ -170,7 +171,7 @@ const CustomRequestEditor = ({
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
size='small' size='small'
icon={<Edit size={14} />} icon={<ActionEdit size={14} />}
onClick={formatJson} onClick={formatJson}
disabled={!isValid} disabled={!isValid}
className='!rounded-lg' className='!rounded-lg'
+3 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { X as ActionX } from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { import {
Card, Card,
@@ -26,7 +27,7 @@ import {
Button, Button,
Dropdown, Dropdown,
} from '@/components/ui'; } from '@/components/ui';
import { Code, Zap, Clock, X, Eye, Send } from 'lucide-react'; import { Code, Zap, Clock, Eye, Send } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import CodeViewer from './CodeViewer'; import CodeViewer from './CodeViewer';
import SSEViewer from './SSEViewer'; import SSEViewer from './SSEViewer';
@@ -119,7 +120,7 @@ const DebugPanel = ({
{styleState.isMobile && onCloseDebugPanel && ( {styleState.isMobile && onCloseDebugPanel && (
<Button <Button
icon={<X size={16} />} icon={<ActionX size={16} />}
onClick={onCloseDebugPanel} onClick={onCloseDebugPanel}
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
+36 -11
View File
@@ -17,9 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
ExternalLink as ActionExternalLink,
Download as ActionDownload,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, { useCallback, useMemo } from 'react'; import React, { useCallback, useMemo } from 'react';
import { Modal, Toast } from '@/components/ui'; import { Modal, Toast } from '@/components/ui';
import { Download, ExternalLink, X, FileText } from 'lucide-react'; import { FileText } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
// 体验中心消息气泡里"点击附件 chip 弹出预览"的统一入口。 // 体验中心消息气泡里"点击附件 chip 弹出预览"的统一入口。
@@ -110,20 +115,30 @@ const FilePreviewModal = ({ visible, file, onClose }) => {
</span> </span>
</div> </div>
<div className='flex items-center gap-1.5'> <div className='flex items-center gap-1.5'>
<button onClick={handleOpenInNewTab} className={btnClass}> <button
<ExternalLink size={14} /> onClick={handleOpenInNewTab}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionExternalLink size={14} />
{t('新窗口打开')} {t('新窗口打开')}
</button> </button>
<button onClick={handleDownload} className={btnClass}> <button
<Download size={14} /> onClick={handleDownload}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionDownload size={14} />
{t('下载')} {t('下载')}
</button> </button>
<button <button
onClick={onClose} onClick={onClose}
className='w-9 h-9 flex items-center justify-center rounded-lg bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all' className='app-action-button w-9 h-9 flex items-center justify-center rounded-lg bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all'
title={t('关闭')} title={t('关闭')}
> >
<X size={20} /> <ActionX size={20} />
</button> </button>
</div> </div>
</div> </div>
@@ -156,12 +171,22 @@ const FilePreviewModal = ({ visible, file, onClose }) => {
)} )}
</div> </div>
<div className='flex items-center gap-2 mt-2'> <div className='flex items-center gap-2 mt-2'>
<button onClick={handleOpenInNewTab} className={btnClass}> <button
<ExternalLink size={14} /> onClick={handleOpenInNewTab}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionExternalLink size={14} />
{t('新窗口打开')} {t('新窗口打开')}
</button> </button>
<button onClick={handleDownload} className={btnClass}> <button
<Download size={14} /> onClick={handleDownload}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionDownload size={14} />
{t('下载')} {t('下载')}
</button> </button>
</div> </div>
+13 -3
View File
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Settings as ActionSettings,
EyeOff as ActionEyeOff,
Eye as ActionEye,
} from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button } from '@/components/ui'; import { Button } from '@/components/ui';
import { Settings, Eye, EyeOff } from 'lucide-react';
const FloatingButtons = ({ const FloatingButtons = ({
styleState, styleState,
@@ -36,7 +40,7 @@ const FloatingButtons = ({
{/* 设置按钮(体验模式下设置面板不渲染,按钮也隐藏,避免出现死按钮) */} {/* 设置按钮(体验模式下设置面板不渲染,按钮也隐藏,避免出现死按钮) */}
{!showSettings && !hideSettingsButton && ( {!showSettings && !hideSettingsButton && (
<Button <Button
icon={<Settings size={18} />} icon={<ActionSettings size={18} />}
style={{ style={{
position: 'fixed', position: 'fixed',
right: 16, right: 16,
@@ -62,7 +66,13 @@ const FloatingButtons = ({
{/* 调试按钮 */} {/* 调试按钮 */}
{!showSettings && ( {!showSettings && (
<Button <Button
icon={showDebugPanel ? <EyeOff size={18} /> : <Eye size={18} />} icon={
showDebugPanel ? (
<ActionEyeOff size={18} />
) : (
<ActionEye size={18} />
)
}
onClick={onToggleDebugPanel} onClick={onToggleDebugPanel}
theme='solid' theme='solid'
type={showDebugPanel ? 'danger' : 'primary'} type={showDebugPanel ? 'danger' : 'primary'}
+43 -11
View File
@@ -17,9 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
ZoomOut as ActionZoomOut,
ZoomIn as ActionZoomIn,
RotateCw as ActionRotateCw,
Download as ActionDownload,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useCallback, useEffect } from 'react'; import React, { useState, useCallback, useEffect } from 'react';
import { Modal } from '@/components/ui'; import { Modal } from '@/components/ui';
import { Download, ZoomIn, ZoomOut, X, RotateCw } from 'lucide-react';
const ImagePreviewModal = ({ visible, imageUrl, onClose }) => { const ImagePreviewModal = ({ visible, imageUrl, onClose }) => {
const [scale, setScale] = useState(1); const [scale, setScale] = useState(1);
@@ -92,25 +98,51 @@ const ImagePreviewModal = ({ visible, imageUrl, onClose }) => {
}} }}
> >
<div className='flex items-center gap-1.5'> <div className='flex items-center gap-1.5'>
<button onClick={handleZoomOut} className={btnClass}> <button
<ZoomOut size={18} /> onClick={handleZoomOut}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionZoomOut size={18} />
</button> </button>
<span className='text-white/70 text-sm min-w-[48px] text-center'> <span className='text-white/70 text-sm min-w-[48px] text-center'>
{Math.round(scale * 100)}% {Math.round(scale * 100)}%
</span> </span>
<button onClick={handleZoomIn} className={btnClass}> <button
<ZoomIn size={18} /> onClick={handleZoomIn}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionZoomIn size={18} />
</button> </button>
<button onClick={handleResetZoom} className={btnClass} title='Reset'> <button
<RotateCw size={16} /> onClick={handleResetZoom}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
title='Reset'
>
<ActionRotateCw size={16} />
</button> </button>
</div> </div>
<div className='flex items-center gap-1.5'> <div className='flex items-center gap-1.5'>
<button onClick={handleDownload} className={btnClass}> <button
<Download size={18} /> onClick={handleDownload}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionDownload size={18} />
</button> </button>
<button onClick={handleClose} className={btnClass}> <button
<X size={20} /> onClick={handleClose}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionX size={20} />
</button> </button>
</div> </div>
</div> </div>
+7 -3
View File
@@ -17,10 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Plus as ActionPlus,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Input, Typography, Button, Switch } from '@/components/ui'; import { Input, Typography, Button, Switch } from '@/components/ui';
import { IconFile } from '@/components/ui/icons'; import { IconFile } from '@/components/ui/icons';
import { Plus, X, Image } from 'lucide-react'; import { Image } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const ImageUrlInput = ({ const ImageUrlInput = ({
@@ -77,7 +81,7 @@ const ImageUrlInput = ({
disabled={disabled} disabled={disabled}
/> />
<Button <Button
icon={<Plus size={14} />} icon={<ActionPlus size={14} />}
size='small' size='small'
theme='solid' theme='solid'
type='primary' type='primary'
@@ -124,7 +128,7 @@ const ImageUrlInput = ({
/> />
</div> </div>
<Button <Button
icon={<X size={12} />} icon={<ActionX size={12} />}
size='small' size='small'
theme='borderless' theme='borderless'
type='danger' type='danger'
+12 -6
View File
@@ -17,9 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
RefreshCw as ActionRefreshCw,
Copy as ActionCopy,
Edit as ActionEdit,
UserCheck as ActionUserCheck,
Trash2 as ActionTrash2,
} from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button, Tooltip } from '@/components/ui'; import { Button, Tooltip } from '@/components/ui';
import { RefreshCw, Copy, Trash2, UserCheck, Edit } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const MessageActions = ({ const MessageActions = ({
@@ -57,7 +63,7 @@ const MessageActions = ({
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
size='small' size='small'
icon={<RefreshCw size={styleState.isMobile ? 12 : 14} />} icon={<ActionRefreshCw size={styleState.isMobile ? 12 : 14} />}
onClick={() => !shouldDisableActions && onMessageReset(message)} onClick={() => !shouldDisableActions && onMessageReset(message)}
disabled={shouldDisableActions} disabled={shouldDisableActions}
className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-blue-600 hover:!bg-blue-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`} className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-blue-600 hover:!bg-blue-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
@@ -72,7 +78,7 @@ const MessageActions = ({
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
size='small' size='small'
icon={<Copy size={styleState.isMobile ? 12 : 14} />} icon={<ActionCopy size={styleState.isMobile ? 12 : 14} />}
onClick={() => onMessageCopy(message)} onClick={() => onMessageCopy(message)}
className={`!rounded-full !text-gray-400 hover:!text-green-600 hover:!bg-green-50 ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`} className={`!rounded-full !text-gray-400 hover:!text-green-600 hover:!bg-green-50 ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
aria-label={t('复制')} aria-label={t('复制')}
@@ -89,7 +95,7 @@ const MessageActions = ({
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
size='small' size='small'
icon={<Edit size={styleState.isMobile ? 12 : 14} />} icon={<ActionEdit size={styleState.isMobile ? 12 : 14} />}
onClick={() => !shouldDisableActions && onMessageEdit(message)} onClick={() => !shouldDisableActions && onMessageEdit(message)}
disabled={shouldDisableActions} disabled={shouldDisableActions}
className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-yellow-600 hover:!bg-yellow-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`} className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-yellow-600 hover:!bg-yellow-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
@@ -113,7 +119,7 @@ const MessageActions = ({
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
size='small' size='small'
icon={<UserCheck size={styleState.isMobile ? 12 : 14} />} icon={<ActionUserCheck size={styleState.isMobile ? 12 : 14} />}
onClick={() => onClick={() =>
!shouldDisableActions && onRoleToggle && onRoleToggle(message) !shouldDisableActions && onRoleToggle && onRoleToggle(message)
} }
@@ -137,7 +143,7 @@ const MessageActions = ({
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
size='small' size='small'
icon={<Trash2 size={styleState.isMobile ? 12 : 14} />} icon={<ActionTrash2 size={styleState.isMobile ? 12 : 14} />}
onClick={() => !shouldDisableActions && onMessageDelete(message)} onClick={() => !shouldDisableActions && onMessageDelete(message)}
disabled={shouldDisableActions} disabled={shouldDisableActions}
className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-red-600 hover:!bg-red-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`} className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-red-600 hover:!bg-red-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
+40 -27
View File
@@ -17,25 +17,23 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
X as ActionX,
Check as ActionCheck,
FileText as ActionFileText,
Globe as ActionGlobe,
ChevronDown as ActionChevronDown,
FastForward as ActionFastForward,
VolumeX as ActionVolumeX,
Volume2 as ActionVolume2,
} from '@/components/common/icons/ActionIcons';
import React, { useRef, useEffect, useState } from 'react'; import React, { useRef, useEffect, useState } from 'react';
import { Typography, TextArea, Button, Tooltip } from '@/components/ui'; import { Typography, TextArea, Button, Tooltip } from '@/components/ui';
import MarkdownRenderer from '../common/markdown/MarkdownRenderer'; import MarkdownRenderer from '../common/markdown/MarkdownRenderer';
import ThinkingContent from './ThinkingContent'; import ThinkingContent from './ThinkingContent';
import ImagePreviewModal from './ImagePreviewModal'; import ImagePreviewModal from './ImagePreviewModal';
import FilePreviewModal from './FilePreviewModal'; import FilePreviewModal from './FilePreviewModal';
import { import { Loader2, FileText, Globe, ExternalLink, Sparkles } from 'lucide-react';
Loader2,
Check,
X,
FileText,
Globe,
ExternalLink,
Volume2,
VolumeX,
Sparkles,
FastForward,
ChevronDown,
} from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
// 注意:不要从 helpers/utils 里 import getTextContent —— 本组件下方有同名 const, // 注意:不要从 helpers/utils 里 import getTextContent —— 本组件下方有同名 const,
// 同名遮蔽在 Vite/terser 生产构建里会把两者缩成同一个变量名,触发 TDZ 错误: // 同名遮蔽在 Vite/terser 生产构建里会把两者缩成同一个变量名,触发 TDZ 错误:
@@ -417,7 +415,7 @@ const MessageContent = ({
size='small' size='small'
type='danger' type='danger'
theme='light' theme='light'
icon={<X size={14} />} icon={<ActionX size={14} />}
onClick={onEditCancel} onClick={onEditCancel}
className='flex-1' className='flex-1'
> >
@@ -427,7 +425,7 @@ const MessageContent = ({
size='small' size='small'
type='warning' type='warning'
theme='solid' theme='solid'
icon={<Check size={14} />} icon={<ActionCheck size={14} />}
onClick={onEditSave} onClick={onEditSave}
disabled={!editValue || editValue.trim() === ''} disabled={!editValue || editValue.trim() === ''}
className='flex-1' className='flex-1'
@@ -572,7 +570,12 @@ const MessageContent = ({
key={index} key={index}
type='button' type='button'
onClick={() => setPreviewFile(fileItem.file)} onClick={() => setPreviewFile(fileItem.file)}
className={`flex items-center gap-2 px-3 py-2 rounded-xl ${s.bg} border border-gray-200/60 dark:border-neutral-700/60 shadow-sm hover:shadow-md hover:scale-[1.02] active:scale-100 transition-all duration-200 group cursor-pointer text-left ${isHistoricalAttachment ? 'opacity-60 grayscale' : ''}`} className={[
'app-action-button',
`flex items-center gap-2 px-3 py-2 rounded-xl ${s.bg} border border-gray-200/60 dark:border-neutral-700/60 shadow-sm hover:shadow-md hover:scale-[1.02] active:scale-100 transition-all duration-200 group cursor-pointer text-left ${isHistoricalAttachment ? 'opacity-60 grayscale' : ''}`,
]
.filter(Boolean)
.join(' ')}
// 历史 chip 已用 Semi Tooltip 显示提示,不再加 native title 防止重影 // 历史 chip 已用 Semi Tooltip 显示提示,不再加 native title 防止重影
title={ title={
isHistoricalAttachment ? undefined : t('点击预览') isHistoricalAttachment ? undefined : t('点击预览')
@@ -590,7 +593,7 @@ const MessageContent = ({
: t('附件 {{name}}', { name: fileName }) : t('附件 {{name}}', { name: fileName })
} }
> >
<FileText <ActionFileText
size={16} size={16}
className={`${s.color} flex-shrink-0`} className={`${s.color} flex-shrink-0`}
/> />
@@ -701,20 +704,25 @@ const MessageContent = ({
<button <button
type='button' type='button'
onClick={() => setSourcesExpanded((v) => !v)} onClick={() => setSourcesExpanded((v) => !v)}
className={`flex items-center gap-1.5 w-full text-left transition-colors hover:opacity-80 ${sourcesExpanded ? 'mb-2' : ''}`} className={[
'app-action-button',
`flex items-center gap-1.5 w-full text-left transition-colors hover:opacity-80 ${sourcesExpanded ? 'mb-2' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-expanded={sourcesExpanded} aria-expanded={sourcesExpanded}
aria-label={ aria-label={
sourcesExpanded ? t('收起参考来源') : t('展开参考来源') sourcesExpanded ? t('收起参考来源') : t('展开参考来源')
} }
> >
<Globe <ActionGlobe
size={13} size={13}
className='text-brand dark:text-brand-from flex-shrink-0' className='text-brand dark:text-brand-from flex-shrink-0'
/> />
<span className='text-[11px] font-medium text-brand-deep dark:text-brand-from uppercase tracking-wide'> <span className='text-[11px] font-medium text-brand-deep dark:text-brand-from uppercase tracking-wide'>
{t('参考来源')} · {message.webSearchSources.length} {t('参考来源')} · {message.webSearchSources.length}
</span> </span>
<ChevronDown <ActionChevronDown
size={12} size={12}
className={`ml-auto text-brand-from dark:text-brand transition-transform duration-200 ${sourcesExpanded ? 'rotate-180' : ''}`} className={`ml-auto text-brand-from dark:text-brand transition-transform duration-200 ${sourcesExpanded ? 'rotate-180' : ''}`}
/> />
@@ -844,10 +852,10 @@ const MessageContent = ({
t('请接着上面的内容继续输出,不要重复已经写过的部分'), t('请接着上面的内容继续输出,不要重复已经写过的部分'),
) )
} }
className='inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-amber-50 dark:bg-amber-900/30 hover:bg-amber-100 dark:hover:bg-amber-900/50 text-amber-700 dark:text-amber-300 border border-amber-300/70 dark:border-amber-700/50 transition-colors font-medium' className='app-action-button inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-amber-50 dark:bg-amber-900/30 hover:bg-amber-100 dark:hover:bg-amber-900/50 text-amber-700 dark:text-amber-300 border border-amber-300/70 dark:border-amber-700/50 transition-colors font-medium'
title={t('上次响应因长度限制被截断,点击让模型接着写')} title={t('上次响应因长度限制被截断,点击让模型接着写')}
> >
<FastForward size={11} /> <ActionFastForward size={11} />
{t('继续生成')} {t('继续生成')}
</button> </button>
)} )}
@@ -856,17 +864,22 @@ const MessageContent = ({
<button <button
type='button' type='button'
onClick={() => tts.speak(message.id, plainText)} onClick={() => tts.speak(message.id, plainText)}
className={`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] transition-colors border ${ className={[
'app-action-button',
`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] transition-colors border ${
isThisSpeaking isThisSpeaking
? 'bg-brand/10 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand-from dark:border-brand-deep animate-pulse' ? 'bg-brand/10 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand-from dark:border-brand-deep animate-pulse'
: 'bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border-gray-200/60 dark:border-neutral-700/60' : 'bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border-gray-200/60 dark:border-neutral-700/60'
}`} }`,
]
.filter(Boolean)
.join(' ')}
title={isThisSpeaking ? t('停止朗读') : t('朗读')} title={isThisSpeaking ? t('停止朗读') : t('朗读')}
> >
{isThisSpeaking ? ( {isThisSpeaking ? (
<VolumeX size={11} /> <ActionVolumeX size={11} />
) : ( ) : (
<Volume2 size={11} /> <ActionVolume2 size={11} />
)} )}
{isThisSpeaking ? t('停止朗读') : t('朗读')} {isThisSpeaking ? t('停止朗读') : t('朗读')}
</button> </button>
@@ -879,7 +892,7 @@ const MessageContent = ({
key={idx} key={idx}
type='button' type='button'
onClick={() => onSendQuickPrompt?.(prompt)} onClick={() => onSendQuickPrompt?.(prompt)}
className='inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border border-gray-200/60 dark:border-neutral-700/60 transition-colors' className='app-action-button inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border border-gray-200/60 dark:border-neutral-700/60 transition-colors'
title={t('一键追问')} title={t('一键追问')}
> >
<Sparkles size={11} /> <Sparkles size={11} />
@@ -19,9 +19,12 @@ For commercial licensing, please contact support@quantumnous.com
// 多选导出:底部悬浮操作条。展示型组件,状态由父级(Playground/index.jsx)持有。 // 多选导出:底部悬浮操作条。展示型组件,状态由父级(Playground/index.jsx)持有。
import {
Download as ActionDownload,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Button, RadioGroup, Radio } from '@/components/ui'; import { Button, RadioGroup, Radio } from '@/components/ui';
import { Download, X } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const MessageSelectionBar = ({ const MessageSelectionBar = ({
@@ -76,7 +79,7 @@ const MessageSelectionBar = ({
size='small' size='small'
theme='solid' theme='solid'
type='primary' type='primary'
icon={<Download size={14} />} icon={<ActionDownload size={14} />}
disabled={selectedCount === 0 || exporting} disabled={selectedCount === 0 || exporting}
loading={exporting} loading={exporting}
onClick={handleExport} onClick={handleExport}
@@ -89,7 +92,7 @@ const MessageSelectionBar = ({
<Button <Button
size='small' size='small'
theme='borderless' theme='borderless'
icon={<X size={14} />} icon={<ActionX size={14} />}
// 导出进行中禁用「取消」——否则 bar 被关闭但 docx 仍在 await 中, // 导出进行中禁用「取消」——否则 bar 被关闭但 docx 仍在 await 中,
// 最终仍会触发一次下载,对用户体感是「我已经取消了为什么还有文件」。 // 最终仍会触发一次下载,对用户体感是「我已经取消了为什么还有文件」。
disabled={exporting} disabled={exporting}
+25 -20
View File
@@ -17,19 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Check as ActionCheck,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Input, Slider, Typography, Button, Tag } from '@/components/ui'; import { Input, Slider, Typography, Button, Tag } from '@/components/ui';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import { Hash, Thermometer, Target, Repeat, Ban, Shuffle } from 'lucide-react';
Hash,
Thermometer,
Target,
Repeat,
Ban,
Shuffle,
Check,
X,
} from 'lucide-react';
const ParameterControl = ({ const ParameterControl = ({
inputs, inputs,
@@ -62,9 +57,9 @@ const ParameterControl = ({
size='small' size='small'
icon={ icon={
parameterEnabled.temperature ? ( parameterEnabled.temperature ? (
<Check size={10} /> <ActionCheck size={10} />
) : ( ) : (
<X size={10} /> <ActionX size={10} />
) )
} }
onClick={() => onParameterToggle('temperature')} onClick={() => onParameterToggle('temperature')}
@@ -105,7 +100,11 @@ const ParameterControl = ({
type={parameterEnabled.top_p ? 'primary' : 'tertiary'} type={parameterEnabled.top_p ? 'primary' : 'tertiary'}
size='small' size='small'
icon={ icon={
parameterEnabled.top_p ? <Check size={10} /> : <X size={10} /> parameterEnabled.top_p ? (
<ActionCheck size={10} />
) : (
<ActionX size={10} />
)
} }
onClick={() => onParameterToggle('top_p')} onClick={() => onParameterToggle('top_p')}
className='!rounded-full !w-4 !h-4 !p-0 !min-w-0 param-toggle-hit' className='!rounded-full !w-4 !h-4 !p-0 !min-w-0 param-toggle-hit'
@@ -146,9 +145,9 @@ const ParameterControl = ({
size='small' size='small'
icon={ icon={
parameterEnabled.frequency_penalty ? ( parameterEnabled.frequency_penalty ? (
<Check size={10} /> <ActionCheck size={10} />
) : ( ) : (
<X size={10} /> <ActionX size={10} />
) )
} }
onClick={() => onParameterToggle('frequency_penalty')} onClick={() => onParameterToggle('frequency_penalty')}
@@ -190,9 +189,9 @@ const ParameterControl = ({
size='small' size='small'
icon={ icon={
parameterEnabled.presence_penalty ? ( parameterEnabled.presence_penalty ? (
<Check size={10} /> <ActionCheck size={10} />
) : ( ) : (
<X size={10} /> <ActionX size={10} />
) )
} }
onClick={() => onParameterToggle('presence_penalty')} onClick={() => onParameterToggle('presence_penalty')}
@@ -231,9 +230,9 @@ const ParameterControl = ({
size='small' size='small'
icon={ icon={
parameterEnabled.max_tokens ? ( parameterEnabled.max_tokens ? (
<Check size={10} /> <ActionCheck size={10} />
) : ( ) : (
<X size={10} /> <ActionX size={10} />
) )
} }
onClick={() => onParameterToggle('max_tokens')} onClick={() => onParameterToggle('max_tokens')}
@@ -272,7 +271,13 @@ const ParameterControl = ({
theme={parameterEnabled.seed ? 'solid' : 'borderless'} theme={parameterEnabled.seed ? 'solid' : 'borderless'}
type={parameterEnabled.seed ? 'primary' : 'tertiary'} type={parameterEnabled.seed ? 'primary' : 'tertiary'}
size='small' size='small'
icon={parameterEnabled.seed ? <Check size={10} /> : <X size={10} />} icon={
parameterEnabled.seed ? (
<ActionCheck size={10} />
) : (
<ActionX size={10} />
)
}
onClick={() => onParameterToggle('seed')} onClick={() => onParameterToggle('seed')}
className='!rounded-full !w-4 !h-4 !p-0 !min-w-0 param-toggle-hit' className='!rounded-full !w-4 !h-4 !p-0 !min-w-0 param-toggle-hit'
disabled={disabled} disabled={disabled}
+10 -12
View File
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Copy as ActionCopy,
ChevronUp as ActionChevronUp,
ChevronDown as ActionChevronDown,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useMemo, useCallback } from 'react'; import React, { useState, useMemo, useCallback } from 'react';
import { import {
Button, Button,
@@ -26,14 +31,7 @@ import {
Badge, Badge,
Typography, Typography,
} from '@/components/ui'; } from '@/components/ui';
import { import { Zap, CheckCircle, XCircle } from 'lucide-react';
Copy,
ChevronDown,
ChevronUp,
Zap,
CheckCircle,
XCircle,
} from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { copy } from '../../helpers'; import { copy } from '../../helpers';
@@ -167,7 +165,7 @@ const SSEViewer = ({ sseData }) => {
{JSON.stringify(item.parsed, null, 2)} {JSON.stringify(item.parsed, null, 2)}
</pre> </pre>
<Button <Button
icon={<Copy size={12} />} icon={<ActionCopy size={12} />}
size='small' size='small'
theme='borderless' theme='borderless'
onClick={() => handleCopySingle(item)} onClick={() => handleCopySingle(item)}
@@ -235,7 +233,7 @@ const SSEViewer = ({ sseData }) => {
<div className='flex items-center gap-2'> <div className='flex items-center gap-2'>
<Tooltip content={t('复制全部')}> <Tooltip content={t('复制全部')}>
<Button <Button
icon={<Copy size={14} />} icon={<ActionCopy size={14} />}
size='small' size='small'
onClick={handleCopyAll} onClick={handleCopyAll}
theme='borderless' theme='borderless'
@@ -253,9 +251,9 @@ const SSEViewer = ({ sseData }) => {
<Button <Button
icon={ icon={
expandedKeys.length === parsedSSEData.length ? ( expandedKeys.length === parsedSSEData.length ? (
<ChevronUp size={14} /> <ActionChevronUp size={14} />
) : ( ) : (
<ChevronDown size={14} /> <ActionChevronDown size={14} />
) )
} }
size='small' size='small'
+14 -16
View File
@@ -17,6 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
ChevronRight as ActionChevronRight,
Plus as ActionPlus,
X as ActionX,
ChevronLeft as ActionChevronLeft,
MoreHorizontal as ActionMoreHorizontal,
} from '@/components/common/icons/ActionIcons';
import React, { import React, {
useMemo, useMemo,
useState, useState,
@@ -35,14 +42,9 @@ import {
Dropdown, Dropdown,
} from '@/components/ui'; } from '@/components/ui';
import { import {
Plus,
MessageSquare, MessageSquare,
Trash2, Trash2,
ChevronLeft,
ChevronRight,
Search, Search,
X,
MoreHorizontal,
Edit3, Edit3,
Sparkles, Sparkles,
Download, Download,
@@ -200,7 +202,7 @@ const SessionSidebar = ({
<div className='relative flex flex-col items-center pt-4 gap-2'> <div className='relative flex flex-col items-center pt-4 gap-2'>
<Tooltip content={t('展开会话列表')} position='right'> <Tooltip content={t('展开会话列表')} position='right'>
<Button <Button
icon={<ChevronRight size={16} />} icon={<ActionChevronRight size={16} />}
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
onClick={onToggleCollapse} onClick={onToggleCollapse}
@@ -209,7 +211,7 @@ const SessionSidebar = ({
</Tooltip> </Tooltip>
<Tooltip content={t('新建对话')} position='right'> <Tooltip content={t('新建对话')} position='right'>
<Button <Button
icon={<Plus size={16} />} icon={<ActionPlus size={16} />}
theme='solid' theme='solid'
type='primary' type='primary'
loading={creating} loading={creating}
@@ -254,7 +256,7 @@ const SessionSidebar = ({
</div> </div>
{isMobile && onClose ? ( {isMobile && onClose ? (
<Button <Button
icon={<X size={16} />} icon={<ActionX size={16} />}
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
onClick={onClose} onClick={onClose}
@@ -265,7 +267,7 @@ const SessionSidebar = ({
onToggleCollapse && ( onToggleCollapse && (
<Tooltip content={t('收起')} position='bottom'> <Tooltip content={t('收起')} position='bottom'>
<Button <Button
icon={<ChevronLeft size={16} />} icon={<ActionChevronLeft size={16} />}
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
onClick={onToggleCollapse} onClick={onToggleCollapse}
@@ -280,7 +282,7 @@ const SessionSidebar = ({
{/* 新建按钮 */} {/* 新建按钮 */}
<div className='relative px-3 pb-2'> <div className='relative px-3 pb-2'>
<Button <Button
icon={<Plus size={16} />} icon={<ActionPlus size={16} />}
theme='solid' theme='solid'
type='primary' type='primary'
block block
@@ -486,15 +488,11 @@ const SessionSidebar = ({
> >
<button <button
type='button' type='button'
className=' className='app-action-button \n opacity-0 group-hover:opacity-100 [@media(hover:none)]:opacity-100 transition-opacity\n flex-shrink-0 p-1 rounded hover:bg-gray-200/80 dark:hover:bg-neutral-700/80\n text-gray-400 hover:text-gray-700 dark:hover:text-gray-200\n '
opacity-0 group-hover:opacity-100 [@media(hover:none)]:opacity-100 transition-opacity
flex-shrink-0 p-1 rounded hover:bg-gray-200/80 dark:hover:bg-neutral-700/80
text-gray-400 hover:text-gray-700 dark:hover:text-gray-200
'
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
aria-label={t('更多操作')} aria-label={t('更多操作')}
> >
<MoreHorizontal size={14} /> <ActionMoreHorizontal size={14} />
</button> </button>
</Dropdown> </Dropdown>
)} )}
+3 -10
View File
@@ -17,17 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { X as ActionX } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Select, Typography, Button, Switch } from '@/components/ui'; import { Select, Typography, Button, Switch } from '@/components/ui';
import { import { Users, ToggleLeft, Settings, Sliders, Bot, Zap } from 'lucide-react';
Users,
ToggleLeft,
X,
Settings,
Sliders,
Bot,
Zap,
} from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import {
renderGroupOption, renderGroupOption,
@@ -133,7 +126,7 @@ const SettingsPanel = ({
{styleState.isMobile && onCloseSettings && ( {styleState.isMobile && onCloseSettings && (
<Button <Button
icon={<X size={16} />} icon={<ActionX size={16} />}
onClick={onCloseSettings} onClick={onCloseSettings}
theme='borderless' theme='borderless'
type='tertiary' type='tertiary'
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Copy as ActionCopy,
CheckCircle as ActionCheckCircle,
Download as ActionDownload,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useRef, useCallback } from 'react'; import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
@@ -31,8 +36,6 @@ import {
} from '@/components/ui'; } from '@/components/ui';
import { QRCodeCanvas } from 'qrcode.react'; import { QRCodeCanvas } from 'qrcode.react';
import { import {
Download,
Copy,
Share2, Share2,
Smartphone, Smartphone,
Monitor, Monitor,
@@ -383,7 +386,7 @@ const PromotionPosterModal = ({ visible, onClose }) => {
theme='solid' theme='solid'
type='primary' type='primary'
size='small' size='small'
icon={<Copy size={14} />} icon={<ActionCopy size={14} />}
onClick={handleCopyLink} onClick={handleCopyLink}
className='!bg-gradient-to-r !from-brand-from !to-brand-to !border-0 !rounded-lg' className='!bg-gradient-to-r !from-brand-from !to-brand-to !border-0 !rounded-lg'
> >
@@ -413,7 +416,7 @@ const PromotionPosterModal = ({ visible, onClose }) => {
<Button <Button
theme='light' theme='light'
type='tertiary' type='tertiary'
icon={<Copy size={14} />} icon={<ActionCopy size={14} />}
onClick={handleCopyCode} onClick={handleCopyCode}
className='!rounded-lg' className='!rounded-lg'
> >
@@ -452,17 +455,22 @@ const PromotionPosterModal = ({ visible, onClose }) => {
<button <button
key={template.id} key={template.id}
onClick={() => setSelectedTemplate(template)} onClick={() => setSelectedTemplate(template)}
className={`relative w-14 h-14 rounded-xl border-2 transition-all duration-300 overflow-hidden ${ className={[
'app-action-button',
`relative w-14 h-14 rounded-xl border-2 transition-all duration-300 overflow-hidden ${
selectedTemplate.id === template.id selectedTemplate.id === template.id
? 'border-brand scale-110 shadow-lg shadow-brand/30' ? 'border-brand scale-110 shadow-lg shadow-brand/30'
: 'border-transparent hover:border-gray-300 hover:scale-105' : 'border-transparent hover:border-gray-300 hover:scale-105'
}`} }`,
]
.filter(Boolean)
.join(' ')}
style={{ background: template.bgGradient }} style={{ background: template.bgGradient }}
title={t(template.name)} title={t(template.name)}
> >
{selectedTemplate.id === template.id && ( {selectedTemplate.id === template.id && (
<div className='absolute inset-0 flex items-center justify-center bg-black/20'> <div className='absolute inset-0 flex items-center justify-center bg-black/20'>
<CheckCircle size={20} className='text-white' /> <ActionCheckCircle size={20} className='text-white' />
</div> </div>
)} )}
</button> </button>
@@ -556,7 +564,7 @@ const PromotionPosterModal = ({ visible, onClose }) => {
<Button <Button
theme='solid' theme='solid'
type='primary' type='primary'
icon={<Download size={16} />} icon={<ActionDownload size={16} />}
onClick={handleDownload} onClick={handleDownload}
loading={downloading} loading={downloading}
className='flex-1 !bg-gradient-to-r !from-brand-from !to-brand-to !border-0 !rounded-xl !h-10' className='flex-1 !bg-gradient-to-r !from-brand-from !to-brand-to !border-0 !rounded-xl !h-10'
@@ -566,7 +574,7 @@ const PromotionPosterModal = ({ visible, onClose }) => {
<Button <Button
theme='light' theme='light'
type='tertiary' type='tertiary'
icon={<Copy size={16} />} icon={<ActionCopy size={16} />}
onClick={handleCopyLink} onClick={handleCopyLink}
className='flex-1 !rounded-xl !h-10' className='flex-1 !rounded-xl !h-10'
> >
+3 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Plus as ActionPlus } from '@/components/common/icons/ActionIcons';
import React, { useCallback, useEffect, useState } from 'react'; import React, { useCallback, useEffect, useState } from 'react';
import { import {
Banner, Banner,
@@ -31,7 +32,7 @@ import {
Tag, Tag,
Toast, Toast,
} from '@/components/ui'; } from '@/components/ui';
import { BellRing, Plus } from 'lucide-react'; import { BellRing } from 'lucide-react';
import { useIsMobile } from '../../hooks/common/useIsMobile'; import { useIsMobile } from '../../hooks/common/useIsMobile';
import { import {
ALERT_DIM_TYPES, ALERT_DIM_TYPES,
@@ -337,7 +338,7 @@ const QualityAlerts = ({ quality, t }) => {
</span> </span>
</span> </span>
<Button <Button
icon={<Plus size={14} />} icon={<ActionPlus size={14} />}
theme='solid' theme='solid'
onClick={() => { onClick={() => {
setTestResult(null); setTestResult(null);
+9 -4
View File
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
SlidersHorizontal as ActionSlidersHorizontal,
RotateCcw as ActionRotateCcw,
RefreshCw as ActionRefreshCw,
} from '@/components/common/icons/ActionIcons';
import React, { import React, {
useCallback, useCallback,
useEffect, useEffect,
@@ -33,7 +38,7 @@ import {
Select, Select,
Tag, Tag,
} from '@/components/ui'; } from '@/components/ui';
import { Filter, RefreshCw, RotateCcw, SlidersHorizontal } from 'lucide-react'; import { Filter } from 'lucide-react';
import { import {
FAULTS, FAULTS,
OUTCOMES, OUTCOMES,
@@ -286,17 +291,17 @@ const QualityFilterBar = ({ quality, t, onOpenDetail }) => {
/> />
<div className='flex flex-wrap items-center gap-2 ml-auto'> <div className='flex flex-wrap items-center gap-2 ml-auto'>
<Button <Button
icon={<SlidersHorizontal size={14} />} icon={<ActionSlidersHorizontal size={14} />}
theme={moreOpen ? 'solid' : 'light'} theme={moreOpen ? 'solid' : 'light'}
onClick={() => setMoreOpen((v) => !v)} onClick={() => setMoreOpen((v) => !v)}
> >
{t('更多筛选')} {t('更多筛选')}
</Button> </Button>
<Button icon={<RotateCcw size={14} />} onClick={resetFilters}> <Button icon={<ActionRotateCcw size={14} />} onClick={resetFilters}>
{t('重置')} {t('重置')}
</Button> </Button>
<Button <Button
icon={<RefreshCw size={14} />} icon={<ActionRefreshCw size={14} />}
loading={loading} loading={loading}
onClick={refresh} onClick={refresh}
> >
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { TestTube2 as ActionTestTube2 } from '@/components/common/icons/ActionIcons';
import {
RefreshCw as ActionRefreshCw,
Save as ActionSave,
} from '@/components/common/icons/ActionIcons';
import React, { import React, {
useCallback, useCallback,
useEffect, useEffect,
@@ -40,7 +45,7 @@ import {
Tag, Tag,
Typography, Typography,
} from '@/components/ui'; } from '@/components/ui';
import { RefreshCw, Save, ShieldAlert, TestTube2 } from 'lucide-react'; import { ShieldAlert } from 'lucide-react';
import { API, showError, showSuccess } from '../../helpers'; import { API, showError, showSuccess } from '../../helpers';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import i18next from 'i18next'; import i18next from 'i18next';
@@ -394,7 +399,7 @@ export default function ContentGuardSetting() {
{statusTag(config, t)} {statusTag(config, t)}
</Space> </Space>
<Button <Button
icon={<RefreshCw size={16} />} icon={<ActionRefreshCw size={16} />}
onClick={loadAll} onClick={loadAll}
aria-label={t('刷新')} aria-label={t('刷新')}
/> />
@@ -596,18 +601,18 @@ export default function ContentGuardSetting() {
htmlType='submit' htmlType='submit'
type='primary' type='primary'
loading={saving} loading={saving}
icon={<Save size={16} />} icon={<ActionSave size={16} />}
> >
{t('保存配置')} {t('保存配置')}
</Button> </Button>
<Button <Button
icon={<TestTube2 size={16} />} icon={<ActionTestTube2 size={16} />}
onClick={() => testPermission('moderate')} onClick={() => testPermission('moderate')}
> >
moderate moderate
</Button> </Button>
<Button <Button
icon={<TestTube2 size={16} />} icon={<ActionTestTube2 size={16} />}
onClick={() => testPermission('stream_moderate')} onClick={() => testPermission('stream_moderate')}
> >
stream_moderate stream_moderate
@@ -16,6 +16,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
RefreshCw as ActionRefreshCw,
Plus as ActionPlus,
Upload as ActionUpload,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useCallback } from 'react'; import React, { useState, useEffect, useCallback } from 'react';
import { import {
Card, Card,
@@ -33,16 +38,7 @@ import {
Spin, Spin,
Upload, Upload,
} from '@/components/ui'; } from '@/components/ui';
import { import { Users } from 'lucide-react';
Plus,
Pencil,
Trash2,
Power,
PowerOff,
RefreshCw,
Users,
Upload as UploadIcon,
} from 'lucide-react';
import { API, showError, showSuccess } from '../../helpers'; import { API, showError, showSuccess } from '../../helpers';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -313,20 +309,14 @@ const CustomerServiceSetting = () => {
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button <Button
icon={
record.status === 1 ? <PowerOff size={14} /> : <Power size={14} />
}
size='small'
type={record.status === 1 ? 'danger' : 'primary'}
onClick={() => handleToggleStatus(record)} onClick={() => handleToggleStatus(record)}
type='link'
size='small'
danger={(record.status === 1 ? 'danger' : 'primary') === 'danger'}
> >
{record.status === 1 ? t('下线') : t('上线')} {record.status === 1 ? t('下线') : t('上线')}
</Button> </Button>
<Button <Button onClick={() => openModal(record)} type='link' size='small'>
icon={<Pencil size={14} />}
size='small'
onClick={() => openModal(record)}
>
{t('编辑')} {t('编辑')}
</Button> </Button>
<Popconfirm <Popconfirm
@@ -334,7 +324,7 @@ const CustomerServiceSetting = () => {
content={t('确定要删除这个客服吗?')} content={t('确定要删除这个客服吗?')}
onConfirm={() => handleDelete(record.id)} onConfirm={() => handleDelete(record.id)}
> >
<Button icon={<Trash2 size={14} />} size='small' type='danger'> <Button type='link' size='small' danger>
{t('删除')} {t('删除')}
</Button> </Button>
</Popconfirm> </Popconfirm>
@@ -392,14 +382,14 @@ const CustomerServiceSetting = () => {
</Space> </Space>
<Space> <Space>
<Button <Button
icon={<RefreshCw size={14} />} icon={<ActionRefreshCw size={14} />}
onClick={fetchAgents} onClick={fetchAgents}
loading={loading} loading={loading}
> >
{t('刷新')} {t('刷新')}
</Button> </Button>
<Button <Button
icon={<Plus size={14} />} icon={<ActionPlus size={14} />}
type='primary' type='primary'
onClick={() => openModal()} onClick={() => openModal()}
> >
@@ -457,7 +447,7 @@ const CustomerServiceSetting = () => {
customRequest={(fileInfo) => handleUpload(fileInfo, 'avatar')} customRequest={(fileInfo) => handleUpload(fileInfo, 'avatar')}
> >
<Button <Button
icon={<UploadIcon size={14} />} icon={<ActionUpload size={14} />}
loading={uploadingAvatar} loading={uploadingAvatar}
> >
{t('上传')} {t('上传')}
@@ -497,7 +487,7 @@ const CustomerServiceSetting = () => {
} }
> >
<Button <Button
icon={<UploadIcon size={14} />} icon={<ActionUpload size={14} />}
loading={uploadingQrcode} loading={uploadingQrcode}
> >
{t('上传')} {t('上传')}
@@ -511,14 +511,14 @@ export default function DataSecuritySetting() {
title: t('操作'), title: t('操作'),
render: (_, rule) => ( render: (_, rule) => (
<Space> <Space>
<Button size='small' onClick={() => openEditRule(rule)}> <Button onClick={() => openEditRule(rule)} type='link' size='small'>
{t('编辑')} {t('编辑')}
</Button> </Button>
<Popconfirm <Popconfirm
title={t('确认删除该规则?')} title={t('确认删除该规则?')}
onConfirm={() => deleteRule(rule)} onConfirm={() => deleteRule(rule)}
> >
<Button size='small' type='danger'> <Button type='link' size='small' danger>
{t('删除')} {t('删除')}
</Button> </Button>
</Popconfirm> </Popconfirm>
@@ -649,7 +649,7 @@ export default function DataSecuritySetting() {
)} )}
onConfirm={() => reviewRequest(r.id, 'approve')} onConfirm={() => reviewRequest(r.id, 'approve')}
> >
<Button size='small' theme='solid'> <Button type='link' size='small'>
{t('通过')} {t('通过')}
</Button> </Button>
</Popconfirm> </Popconfirm>
@@ -657,7 +657,7 @@ export default function DataSecuritySetting() {
title={t('确认驳回?')} title={t('确认驳回?')}
onConfirm={() => reviewRequest(r.id, 'reject')} onConfirm={() => reviewRequest(r.id, 'reject')}
> >
<Button size='small' type='danger'> <Button type='link' size='small' danger>
{t('驳回')} {t('驳回')}
</Button> </Button>
</Popconfirm> </Popconfirm>
@@ -881,7 +881,7 @@ export default function DataSecuritySetting() {
)} )}
onConfirm={() => deleteRule(rule)} onConfirm={() => deleteRule(rule)}
> >
<Button size='small' type='danger'> <Button type='link' size='small' danger>
{t('删除')} {t('删除')}
</Button> </Button>
</Popconfirm> </Popconfirm>
@@ -1191,8 +1191,9 @@ export default function DataSecuritySetting() {
render: (_, row) => ( render: (_, row) => (
<Space> <Space>
<Button <Button
size='small'
onClick={() => openEditOrgConfig(row)} onClick={() => openEditOrgConfig(row)}
type='link'
size='small'
> >
{t('编辑')} {t('编辑')}
</Button> </Button>
@@ -1200,7 +1201,7 @@ export default function DataSecuritySetting() {
title={t('确认删除该企业覆盖(回到继承全局)?')} title={t('确认删除该企业覆盖(回到继承全局)?')}
onConfirm={() => deleteOrgConfig(row.org_id)} onConfirm={() => deleteOrgConfig(row.org_id)}
> >
<Button size='small' type='danger'> <Button type='link' size='small' danger>
{t('删除')} {t('删除')}
</Button> </Button>
</Popconfirm> </Popconfirm>
+33 -38
View File
@@ -16,6 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Eraser as ActionEraser } from '@/components/common/icons/ActionIcons';
import {
Plus as ActionPlus,
RefreshCw as ActionRefreshCw,
ChevronDown as ActionChevronDown,
ChevronRight as ActionChevronRight,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useCallback, useMemo } from 'react'; import React, { useState, useEffect, useCallback, useMemo } from 'react';
import { import {
Card, Card,
@@ -37,17 +44,7 @@ import {
Empty, Empty,
Switch, Switch,
} from '@/components/ui'; } from '@/components/ui';
import { import { Search } from 'lucide-react';
Plus,
Pencil,
Trash2,
RefreshCw,
Copy,
Search,
Eraser,
ChevronDown,
ChevronRight,
} from 'lucide-react';
import { API, showError, showSuccess } from '../../helpers'; import { API, showError, showSuccess } from '../../helpers';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import './LevelPolicySetting.css'; import './LevelPolicySetting.css';
@@ -131,7 +128,7 @@ const GroupModelDiscountEditor = ({
/> />
<Button <Button
size='small' size='small'
icon={<Plus size={14} />} icon={<ActionPlus size={14} />}
disabled={!allowAdd || pendingModels.length === 0 || pendingInvalid} disabled={!allowAdd || pendingModels.length === 0 || pendingInvalid}
onClick={() => { onClick={() => {
onAdd(pendingModels, pendingTrim); onAdd(pendingModels, pendingTrim);
@@ -149,16 +146,15 @@ const GroupModelDiscountEditor = ({
</Text> </Text>
)} )}
</Space> </Space>
{rows.length === 0 ? ( {rows.length === 0 &&
// 已废弃分组不显示「按分组折扣计费」——该分组已无流量,顶部已有废弃提示 // 已废弃分组不显示「按分组折扣计费」——该分组已无流量,顶部已有废弃提示
allowAdd ? ( (allowAdd ? (
<div className='mt-2'> <div className='mt-2'>
<Text type='tertiary' size='small'> <Text type='tertiary' size='small'>
{t('未配置模型折扣:该分组所有模型按分组折扣系数计费')} {t('未配置模型折扣:该分组所有模型按分组折扣系数计费')}
</Text> </Text>
</div> </div>
) : null ) : null)}
) : (
<Table <Table
// 嵌在 358px 的弹窗体里,列宽合计 460~480px,必须给横向滚动 // 嵌在 358px 的弹窗体里,列宽合计 460~480px,必须给横向滚动
scroll={{ x: 'max-content' }} scroll={{ x: 'max-content' }}
@@ -232,11 +228,7 @@ const GroupModelDiscountEditor = ({
title={t('确认移除该模型折扣?')} title={t('确认移除该模型折扣?')}
onConfirm={() => onRemove(r.model)} onConfirm={() => onRemove(r.model)}
> >
<Button <Button type='link' size='small' danger>
size='small'
type='danger'
icon={<Trash2 size={14} />}
>
{t('移除')} {t('移除')}
</Button> </Button>
</Popconfirm> </Popconfirm>
@@ -244,7 +236,6 @@ const GroupModelDiscountEditor = ({
}, },
]} ]}
/> />
)}
</div> </div>
); );
}; };
@@ -988,17 +979,17 @@ const LevelPolicySetting = () => {
render: (_, r) => ( render: (_, r) => (
<Space> <Space>
<Button <Button
size='small'
icon={<Pencil size={14} />}
onClick={() => openEditor(type, r.code)} onClick={() => openEditor(type, r.code)}
type='link'
size='small'
> >
{t('编辑')} {t('编辑')}
</Button> </Button>
<Tooltip content={t('以该等级为模板新建')}> <Tooltip content={t('以该等级为模板新建')}>
<Button <Button
size='small'
icon={<Copy size={14} />}
onClick={() => duplicateLevel(type, r.code)} onClick={() => duplicateLevel(type, r.code)}
type='link'
size='small'
> >
{t('复制')} {t('复制')}
</Button> </Button>
@@ -1009,10 +1000,10 @@ const LevelPolicySetting = () => {
onConfirm={() => deleteLevel(type, r.code)} onConfirm={() => deleteLevel(type, r.code)}
> >
<Button <Button
size='small'
type='danger'
icon={<Trash2 size={14} />}
loading={deletingCode === `${type}/${r.code}`} loading={deletingCode === `${type}/${r.code}`}
type='link'
size='small'
danger
> >
{t('删除')} {t('删除')}
</Button> </Button>
@@ -1106,7 +1097,7 @@ const LevelPolicySetting = () => {
headerExtraContent={ headerExtraContent={
<Button <Button
theme='solid' theme='solid'
icon={<Plus size={14} />} icon={<ActionPlus size={14} />}
onClick={() => openEditor(type, null)} onClick={() => openEditor(type, null)}
> >
{t('新增等级')} {t('新增等级')}
@@ -1147,7 +1138,7 @@ const LevelPolicySetting = () => {
headerExtraContent={ headerExtraContent={
<Space> <Space>
<Button <Button
icon={<RefreshCw size={14} />} icon={<ActionRefreshCw size={14} />}
onClick={fetchAll} onClick={fetchAll}
disabled={loading} disabled={loading}
> >
@@ -1355,7 +1346,11 @@ const LevelPolicySetting = () => {
title={t('清空全部逐模型覆盖?')} title={t('清空全部逐模型覆盖?')}
onConfirm={clearOverrides} onConfirm={clearOverrides}
> >
<Button size='small' type='tertiary' icon={<Eraser size={14} />}> <Button
size='small'
type='tertiary'
icon={<ActionEraser size={14} />}
>
{t('清空全部')} {t('清空全部')}
</Button> </Button>
</Popconfirm> </Popconfirm>
@@ -1391,7 +1386,7 @@ const LevelPolicySetting = () => {
/> />
<Button <Button
theme='solid' theme='solid'
icon={<Plus size={14} />} icon={<ActionPlus size={14} />}
disabled={overrideModels.length === 0} disabled={overrideModels.length === 0}
onClick={addOverrides} onClick={addOverrides}
> >
@@ -1465,10 +1460,10 @@ const LevelPolicySetting = () => {
width: 110, width: 110,
render: (_, r) => ( render: (_, r) => (
<Button <Button
size='small'
type='danger'
icon={<Trash2 size={14} />}
onClick={() => removeOverride(r.model)} onClick={() => removeOverride(r.model)}
type='link'
size='small'
danger
> >
{t('移除')} {t('移除')}
</Button> </Button>
@@ -1632,9 +1627,9 @@ const LevelPolicySetting = () => {
type={r.modelDiscountCount > 0 ? 'primary' : 'tertiary'} type={r.modelDiscountCount > 0 ? 'primary' : 'tertiary'}
icon={ icon={
expanded ? ( expanded ? (
<ChevronDown size={14} /> <ActionChevronDown size={14} />
) : ( ) : (
<ChevronRight size={14} /> <ActionChevronRight size={14} />
) )
} }
onClick={() => toggleGroupExpanded(r.key)} onClick={() => toggleGroupExpanded(r.key)}
+3 -3
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Check as ActionCheck } from '@/components/common/icons/ActionIcons';
import { useEffectEvent } from '../../hooks/common/useEffectEvent'; import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import { writeClipboardText } from '../../helpers/clipboard'; import { writeClipboardText } from '../../helpers/clipboard';
import React, { useContext, useEffect, useState } from 'react'; import React, { useContext, useEffect, useState } from 'react';
@@ -47,7 +48,6 @@ import { UserContext } from '../../context/User';
import { Tag as AntTag } from 'antd'; import { Tag as AntTag } from 'antd';
import { Avatar, Tooltip, Card, Tabs } from '@/components/ui'; import { Avatar, Tooltip, Card, Tabs } from '@/components/ui';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { Check } from 'lucide-react';
// 导入内容区组件 // 导入内容区组件
import AccountBindingSection from './personal/sections/AccountBindingSection'; import AccountBindingSection from './personal/sections/AccountBindingSection';
@@ -631,11 +631,11 @@ const PersonalSetting = () => {
> >
<button <button
type='button' type='button'
className='ui-profile-id' className='app-action-button ui-profile-id'
onClick={copyUserId} onClick={copyUserId}
> >
ID:{userState?.user?.id} ID:{userState?.user?.id}
{userIdCopied && <Check size={12} />} {userIdCopied && <ActionCheck size={12} />}
</button> </button>
</Tooltip> </Tooltip>
<span aria-hidden='true'>·</span> <span aria-hidden='true'>·</span>
@@ -33,14 +33,7 @@ import {
Progress, Progress,
Empty, Empty,
} from '@/components/ui'; } from '@/components/ui';
import { import { IconPlus, IconUpload, IconPlayCircle } from '@/components/ui/icons';
IconPlus,
IconDelete,
IconEdit,
IconUpload,
IconPlayCircle,
IconEyeOpened,
} from '@/components/ui/icons';
import { API } from '../../helpers'; import { API } from '../../helpers';
const TutorialVideoSetting = () => { const TutorialVideoSetting = () => {
@@ -271,28 +264,23 @@ const TutorialVideoSetting = () => {
render: (_, record) => ( render: (_, record) => (
<div style={{ display: 'flex', gap: 8 }}> <div style={{ display: 'flex', gap: 8 }}>
<Button <Button
icon={<IconEyeOpened />}
size='small'
theme='borderless'
onClick={() => handlePreview(record)} onClick={() => handlePreview(record)}
/> type='link'
<Button
icon={<IconEdit />}
size='small' size='small'
theme='borderless' >
onClick={() => handleEdit(record)} {t('预览')}
/> </Button>
<Button onClick={() => handleEdit(record)} type='link' size='small'>
{t('编辑')}
</Button>
<Popconfirm <Popconfirm
title={t('确定删除这个视频吗?')} title={t('确定删除这个视频吗?')}
content={t('删除后将无法恢复')} content={t('删除后将无法恢复')}
onConfirm={() => handleDelete(record.id)} onConfirm={() => handleDelete(record.id)}
> >
<Button <Button type='link' size='small' danger>
icon={<IconDelete />} {t('删除')}
size='small' </Button>
theme='borderless'
type='danger'
/>
</Popconfirm> </Popconfirm>
</div> </div>
), ),
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Check as ActionCheck } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Segmented } from 'antd'; import { Segmented } from 'antd';
import { Button, Input } from '@/components/ui'; import { Button, Input } from '@/components/ui';
import { Check } from 'lucide-react';
import { import {
CARTOON_AVATAR_PRESETS, CARTOON_AVATAR_PRESETS,
USER_AVATAR_TYPES, USER_AVATAR_TYPES,
@@ -114,7 +114,12 @@ const AvatarSection = ({
); );
handleAvatarSettingChange('avatarPreset', preset.id); handleAvatarSettingChange('avatarPreset', preset.id);
}} }}
className={`ui-avatar-option ${selected ? 'selected' : ''}`} className={[
'app-action-button',
`ui-avatar-option ${selected ? 'selected' : ''}`,
]
.filter(Boolean)
.join(' ')}
> >
<img <img
src={getCartoonAvatarDataUrl(preset.id, 96)} src={getCartoonAvatarDataUrl(preset.id, 96)}
@@ -122,7 +127,7 @@ const AvatarSection = ({
/> />
<span>{t(preset.label)}</span> <span>{t(preset.label)}</span>
{selected && ( {selected && (
<Check size={14} className='ui-avatar-check' /> <ActionCheck size={14} className='ui-avatar-check' />
)} )}
</button> </button>
); );
@@ -17,9 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Check as ActionCheck,
Copy as ActionCopy,
} from '@/components/common/icons/ActionIcons';
import React, { useRef, useEffect } from 'react'; import React, { useRef, useEffect } from 'react';
import { Button, Form, Toast } from '@/components/ui'; import { Button, Form, Toast } from '@/components/ui';
import { Check, Copy } from 'lucide-react';
import { FormQuotaInput } from '../../../common/ui/QuotaInput'; import { FormQuotaInput } from '../../../common/ui/QuotaInput';
import { copy } from '../../../../helpers'; import { copy } from '../../../../helpers';
import SectionHeader from '../components/SectionHeader'; import SectionHeader from '../components/SectionHeader';
@@ -127,14 +130,19 @@ const NotificationSection = ({
type='button' type='button'
aria-pressed={isSelected} aria-pressed={isSelected}
onClick={() => handleFormChange('warningType', option.value)} onClick={() => handleFormChange('warningType', option.value)}
className={`ui-notify-method ${isSelected ? 'selected' : ''}`} className={[
'app-action-button',
`ui-notify-method ${isSelected ? 'selected' : ''}`,
]
.filter(Boolean)
.join(' ')}
> >
<span className='ui-notify-method-text'> <span className='ui-notify-method-text'>
<strong>{option.label}</strong> <strong>{option.label}</strong>
<span>{option.desc}</span> <span>{option.desc}</span>
</span> </span>
{isSelected && ( {isSelected && (
<Check size={16} className='ui-notify-method-check' /> <ActionCheck size={16} className='ui-notify-method-check' />
)} )}
</button> </button>
); );
@@ -212,11 +220,11 @@ const NotificationSection = ({
<span>{t('Webhook 请求结构说明')}</span> <span>{t('Webhook 请求结构说明')}</span>
<button <button
type='button' type='button'
className='ui-notify-copy' className='app-action-button ui-notify-copy'
onClick={handleCopyExample} onClick={handleCopyExample}
> >
{t('复制')} {t('复制')}
<Copy size={14} /> <ActionCopy size={14} />
</button> </button>
</div> </div>
<pre className='ui-notify-code'> <pre className='ui-notify-code'>
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { RefreshCw as ActionRefreshCw } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button, Tag } from '@/components/ui'; import { Button, Tag } from '@/components/ui';
import { RefreshCw } from 'lucide-react';
import { isAdmin } from '../../../helpers'; import { isAdmin } from '../../../helpers';
const AdminTokensActions = ({ const AdminTokensActions = ({
@@ -58,7 +58,7 @@ const AdminTokensActions = ({
</Button> </Button>
</> </>
)} )}
<Button icon={<RefreshCw size={16} />} onClick={onRefresh}> <Button icon={<ActionRefreshCw size={16} />} onClick={onRefresh}>
{t('刷新')} {t('刷新')}
</Button> </Button>
</div> </div>
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Plus as ActionPlus } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Tabs, TabPane, Tag } from '@/components/ui'; import { Tabs, TabPane, Tag } from '@/components/ui';
import { Button } from 'antd'; import { Button } from 'antd';
import { Plus } from 'lucide-react';
import { CHANNEL_OPTIONS } from '../../../constants'; import { CHANNEL_OPTIONS } from '../../../constants';
import { getChannelIcon, isRoot } from '../../../helpers'; import { getChannelIcon, isRoot } from '../../../helpers';
import './channels-tabs.css'; import './channels-tabs.css';
@@ -45,7 +45,7 @@ const ChannelsTabs = ({
className='console-create-action' className='console-create-action'
type='primary' type='primary'
size='middle' size='middle'
icon={<Plus size={16} />} icon={<ActionPlus size={16} />}
onClick={() => { onClick={() => {
setEditingChannel({ id: undefined }); setEditingChannel({ id: undefined });
setShowEdit(true); setShowEdit(true);
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Filter as ActionFilter } from '@/components/common/icons/ActionIcons';
import React, { useEffect, useMemo, useRef, useState } from 'react'; import React, { useEffect, useMemo, useRef, useState } from 'react';
import { Alert, Button, Card } from 'antd'; import { Alert, Button, Card } from 'antd';
import { Filter, Layers } from 'lucide-react'; import { Layers } from 'lucide-react';
import { calculateModelPrice } from '../../../../helpers'; import { calculateModelPrice } from '../../../../helpers';
import MarketModelCard from './MarketModelCard'; import MarketModelCard from './MarketModelCard';
import MarketLogo from './MarketLogo'; import MarketLogo from './MarketLogo';
@@ -224,7 +225,7 @@ const MarketCatalog = ({
)} )}
<Button <Button
className='mm-mobile-filter' className='mm-mobile-filter'
icon={<Filter size={16} strokeWidth={1.65} />} icon={<ActionFilter size={16} strokeWidth={1.65} />}
aria-expanded={filtersOpen} aria-expanded={filtersOpen}
aria-controls='mm-filter-panel' aria-controls='mm-filter-panel'
onClick={onToggleFilters} onClick={onToggleFilters}
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Search as ActionSearch } from '@/components/common/icons/ActionIcons';
import React, { useCallback, useEffect, useRef, useState } from 'react'; import React, { useCallback, useEffect, useRef, useState } from 'react';
import { Button, Input } from 'antd'; import { Button, Input } from 'antd';
import { Search, Zap } from 'lucide-react'; import { Search, Zap } from 'lucide-react';
@@ -100,7 +101,7 @@ const MarketHero = ({ searchValue, setSearchValue, onReset, t }) => {
<Button <Button
type='primary' type='primary'
htmlType='submit' htmlType='submit'
icon={<Search size={16} strokeWidth={1.65} />} icon={<ActionSearch size={16} strokeWidth={1.65} />}
> >
{t('搜索')} {t('搜索')}
</Button> </Button>
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button, Card, Tag, Tooltip } from 'antd'; import { Button, Card, Tag, Tooltip } from 'antd';
import { Copy, Lock } from 'lucide-react'; import { Lock } from 'lucide-react';
import { getDiscountBadgeText } from '../../../../helpers'; import { getDiscountBadgeText } from '../../../../helpers';
import MarketLogo from './MarketLogo'; import MarketLogo from './MarketLogo';
@@ -146,7 +147,7 @@ const MarketModelCard = ({
<Button <Button
type='text' type='text'
aria-label={t('复制模型名称')} aria-label={t('复制模型名称')}
icon={<Copy size={16} strokeWidth={1.65} />} icon={<ActionCopy size={16} strokeWidth={1.65} />}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
onCopy(model.model_name); onCopy(model.model_name);
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button as AntButton, Tooltip as AntTooltip } from 'antd'; import { Button as AntButton, Tooltip as AntTooltip } from 'antd';
import { Copy } from 'lucide-react';
import { Button, Space, Tag, Modal, Tooltip } from '@/components/ui'; import { Button, Space, Tag, Modal, Tooltip } from '@/components/ui';
import { import {
timestamp2string, timestamp2string,
@@ -372,7 +372,7 @@ export const getModelsColumns = ({
size='small' size='small'
className='models-name-copy' className='models-name-copy'
aria-label={t('复制模型名称')} aria-label={t('复制模型名称')}
icon={<Copy size={14} />} icon={<ActionCopy size={14} />}
onClick={() => copyText(text)} onClick={() => copyText(text)}
/> />
</AntTooltip> </AntTooltip>
+2 -2
View File
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Plus as ActionPlus } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Modal } from '@/components/ui'; import { Modal } from '@/components/ui';
import { Button } from 'antd'; import { Button } from 'antd';
import { Plus } from 'lucide-react';
import { IconEdit, IconClose } from '@/components/ui/icons'; import { IconEdit, IconClose } from '@/components/ui/icons';
import { import {
getLobeHubIcon, getLobeHubIcon,
@@ -165,7 +165,7 @@ const ModelsTabs = ({
className='console-create-action' className='console-create-action'
type='primary' type='primary'
size='middle' size='middle'
icon={<Plus size={16} />} icon={<ActionPlus size={16} />}
onClick={() => setShowAddVendor(true)} onClick={() => setShowAddVendor(true)}
> >
{t('新增供应商')} {t('新增供应商')}
@@ -85,7 +85,7 @@
color: var(--ui-color-primary); color: var(--ui-color-primary);
} }
.models-name-cell .models-name-copy.ant-btn .lucide { .models-name-cell .models-name-copy.ant-btn :is(.lucide, .app-action-icon) {
width: 0.8em; width: 0.8em;
height: 0.8em; height: 0.8em;
} }
@@ -17,16 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button } from '@/components/ui'; import { Button } from '@/components/ui';
import { import { ListTodo, Clock, CheckCircle2, XCircle, Loader2 } from 'lucide-react';
ListTodo,
Clock,
CheckCircle2,
Download,
XCircle,
Loader2,
} from 'lucide-react';
import { exportToCsv, formatTimestampForCsv } from '../../../helpers/exportCsv'; import { exportToCsv, formatTimestampForCsv } from '../../../helpers/exportCsv';
import { Space, Statistic } from 'antd'; import { Space, Statistic } from 'antd';
import { useConsolePage } from '../../console/ConsoleContext'; import { useConsolePage } from '../../console/ConsoleContext';
@@ -120,7 +114,7 @@ const TaskLogsActions = ({
<Space wrap> <Space wrap>
{stats.pendingCount > 0 && <span>{t('实时更新中')}</span>} {stats.pendingCount > 0 && <span>{t('实时更新中')}</span>}
<Button <Button
icon={<Download size={16} />} icon={<ActionDownload size={16} />}
onClick={handleExportCsv} onClick={handleExportCsv}
disabled={!logs.length} disabled={!logs.length}
> >
@@ -249,7 +243,7 @@ const TaskLogsActions = ({
{/* 导出当前页为 CSV,空列表时禁用避免生成只有表头的无用文件 */} {/* 导出当前页为 CSV,空列表时禁用避免生成只有表头的无用文件 */}
<Button <Button
size='small' size='small'
icon={<Download className='w-3.5 h-3.5' />} icon={<ActionDownload className='w-3.5 h-3.5' />}
onClick={handleExportCsv} onClick={handleExportCsv}
disabled={!logs || logs.length === 0} disabled={!logs || logs.length === 0}
className={exportButtonClass} className={exportButtonClass}
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Search as ActionSearch } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button, Form } from '@/components/ui'; import { Button, Form } from '@/components/ui';
import { import {
@@ -244,7 +245,7 @@ const TaskLogsFilters = ({
type='primary' type='primary'
htmlType='submit' htmlType='submit'
loading={loading} loading={loading}
icon={<Search size={14} />} icon={<ActionSearch size={14} />}
> >
{t('搜索')} {t('搜索')}
</Button> </Button>
+3 -2
View File
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Card, Tag as AntTag } from 'antd'; import { Card, Tag as AntTag } from 'antd';
import { Clock, Download } from 'lucide-react'; import { Clock } from 'lucide-react';
import { Button, Pagination } from '@/components/ui'; import { Button, Pagination } from '@/components/ui';
import CardPro from '../../common/ui/CardPro'; import CardPro from '../../common/ui/CardPro';
import { ColumnSettingsButton } from '../../common/table/ColumnSettings'; import { ColumnSettingsButton } from '../../common/table/ColumnSettings';
@@ -102,7 +103,7 @@ const TaskLogsPage = ({
)} )}
{/* 导出当前页为 CSV,空列表时禁用避免生成只有表头的无用文件 */} {/* 导出当前页为 CSV,空列表时禁用避免生成只有表头的无用文件 */}
<Button <Button
icon={<Download size={14} />} icon={<ActionDownload size={14} />}
onClick={() => exportTaskLogsPageCsv(logs, isAdminUser, t)} onClick={() => exportTaskLogsPageCsv(logs, isAdminUser, t)}
disabled={!logs || logs.length === 0} disabled={!logs || logs.length === 0}
> >
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
X as ActionX,
Settings2 as ActionSettings2,
Check as ActionCheck,
} from '@/components/common/icons/ActionIcons';
import { useEffectEvent } from '../../../../hooks/common/useEffectEvent'; import { useEffectEvent } from '../../../../hooks/common/useEffectEvent';
import React, { useEffect, useState, useContext, useRef } from 'react'; import React, { useEffect, useState, useContext, useRef } from 'react';
import { import {
@@ -42,9 +47,6 @@ import {
Key, Key,
CreditCard, CreditCard,
Shield, Shield,
X,
Check,
Settings2,
Calendar, Calendar,
Hash, Hash,
Layers, Layers,
@@ -480,9 +482,9 @@ const EditTokenModal = (props) => {
</div> </div>
<button <button
onClick={handleCancel} onClick={handleCancel}
className='p-1.5 rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors' className='app-action-button p-1.5 rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors'
> >
<X size={18} /> <ActionX size={18} />
</button> </button>
</div> </div>
@@ -640,10 +642,10 @@ const EditTokenModal = (props) => {
<button <button
type='button' type='button'
onClick={() => setAdvancedOpen(!advancedOpen)} onClick={() => setAdvancedOpen(!advancedOpen)}
className='w-full flex items-center justify-between px-4 py-3 bg-white dark:bg-neutral-900 hover:bg-gray-50 dark:hover:bg-neutral-800 transition-colors' className='app-action-button w-full flex items-center justify-between px-4 py-3 bg-white dark:bg-neutral-900 hover:bg-gray-50 dark:hover:bg-neutral-800 transition-colors'
> >
<div className='flex items-center gap-2'> <div className='flex items-center gap-2'>
<Settings2 size={15} className='text-brand' /> <ActionSettings2 size={15} className='text-brand' />
<span className='text-sm font-medium text-gray-700 dark:text-gray-300'> <span className='text-sm font-medium text-gray-700 dark:text-gray-300'>
{t('高级设置')} {t('高级设置')}
</span> </span>
@@ -759,7 +761,7 @@ const EditTokenModal = (props) => {
theme='solid' theme='solid'
className='flex-1 !h-10 !rounded-xl !font-medium !border-0 !text-white !bg-gradient-to-r !from-brand-from !via-brand !to-brand-to shadow-lg shadow-brand/30 hover:!opacity-90' className='flex-1 !h-10 !rounded-xl !font-medium !border-0 !text-white !bg-gradient-to-r !from-brand-from !via-brand !to-brand-to shadow-lg shadow-brand/30 hover:!opacity-90'
onClick={() => formApiRef.current?.submitForm()} onClick={() => formApiRef.current?.submitForm()}
icon={<Check size={16} />} icon={<ActionCheck size={16} />}
loading={loading} loading={loading}
> >
{isEdit ? t('保存修改') : t('创建密钥')} {isEdit ? t('保存修改') : t('创建密钥')}
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Search as ActionSearch } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button, Form } from '@/components/ui'; import { Button, Form } from '@/components/ui';
import { Search } from 'lucide-react';
import '../../common/table/log-filters.css'; import '../../common/table/log-filters.css';
import FilterSearchButton from '../../common/table/FilterSearchButton'; import FilterSearchButton from '../../common/table/FilterSearchButton';
import { useFilterSearch } from '../../../hooks/common/useFilterSearch'; import { useFilterSearch } from '../../../hooks/common/useFilterSearch';
@@ -189,7 +189,7 @@ const LogsFilters = ({
type='primary' type='primary'
htmlType='submit' htmlType='submit'
loading={loading} loading={loading}
icon={<Search size={14} />} icon={<ActionSearch size={14} />}
> >
{t('搜索')} {t('搜索')}
</Button> </Button>
+3 -3
View File
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Card } from 'antd'; import { Card } from 'antd';
import { Download } from 'lucide-react';
import { Button, Pagination } from '@/components/ui'; import { Button, Pagination } from '@/components/ui';
import CardPro from '../../common/ui/CardPro'; import CardPro from '../../common/ui/CardPro';
import { TableTitle } from '../../common/table/TableToolbar'; import { TableTitle } from '../../common/table/TableToolbar';
@@ -69,7 +69,7 @@ const LogsPage = ({ usageRecordMode = false }) => {
<TableTitle>{t('调用明细')}</TableTitle> <TableTitle>{t('调用明细')}</TableTitle>
<div className='usage-record-table-actions'> <div className='usage-record-table-actions'>
<Button <Button
icon={<Download size={14} />} icon={<ActionDownload size={14} />}
onClick={() => logsData.setShowExportModal(true)} onClick={() => logsData.setShowExportModal(true)}
> >
{t('导出')} {t('导出')}
@@ -122,7 +122,7 @@ const LogsPage = ({ usageRecordMode = false }) => {
tableActions={ tableActions={
<> <>
<Button <Button
icon={<Download size={14} />} icon={<ActionDownload size={14} />}
onClick={() => logsData.setShowExportModal(true)} onClick={() => logsData.setShowExportModal(true)}
> >
{logsData.t('导出')} {logsData.t('导出')}
+2 -2
View File
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Plus as ActionPlus } from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { Button } from 'antd'; import { Button } from 'antd';
import { Plus } from 'lucide-react';
import { isAdmin } from '../../../helpers'; import { isAdmin } from '../../../helpers';
const UsersActions = ({ setShowAddUser, t }) => { const UsersActions = ({ setShowAddUser, t }) => {
@@ -34,7 +34,7 @@ const UsersActions = ({ setShowAddUser, t }) => {
<Button <Button
className='console-create-action' className='console-create-action'
type='primary' type='primary'
icon={<Plus size={16} />} icon={<ActionPlus size={16} />}
onClick={handleAddUser} onClick={handleAddUser}
size='middle' size='middle'
> >
+7 -3
View File
@@ -17,6 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Zap as ActionZap,
Copy as ActionCopy,
} from '@/components/common/icons/ActionIcons';
import React from 'react'; import React from 'react';
import { import {
Avatar, Avatar,
@@ -27,7 +31,7 @@ import {
Badge, Badge,
Space, Space,
} from '@/components/ui'; } from '@/components/ui';
import { Copy, Users, BarChart2, TrendingUp, Gift, Zap } from 'lucide-react'; import { Users, BarChart2, TrendingUp, Gift } from 'lucide-react';
const { Text } = Typography; const { Text } = Typography;
@@ -87,7 +91,7 @@ const InvitationCard = ({
onClick={() => setOpenTransfer(true)} onClick={() => setOpenTransfer(true)}
className='!rounded-lg' className='!rounded-lg'
> >
<Zap size={12} className='mr-1' /> <ActionZap size={12} className='mr-1' />
{t('划转到余额')} {t('划转到余额')}
</Button> </Button>
</div> </div>
@@ -184,7 +188,7 @@ const InvitationCard = ({
type='primary' type='primary'
theme='solid' theme='solid'
onClick={handleAffLinkClick} onClick={handleAffLinkClick}
icon={<Copy size={14} />} icon={<ActionCopy size={14} />}
className='!rounded-lg' className='!rounded-lg'
> >
{t('复制')} {t('复制')}
+3 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import { Receipt as ActionReceipt } from '@/components/common/icons/ActionIcons';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { import {
Typography, Typography,
@@ -28,7 +29,7 @@ import {
Spin, Spin,
Tooltip, Tooltip,
} from '@/components/ui'; } from '@/components/ui';
import { CreditCard, Coins, Wallet, Receipt } from 'lucide-react'; import { CreditCard, Coins, Wallet } from 'lucide-react';
import { import {
AlipayBrandIcon, AlipayBrandIcon,
WechatBrandIcon, WechatBrandIcon,
@@ -103,7 +104,7 @@ const RechargeCard = ({
</div> </div>
</div> </div>
<Button <Button
icon={<Receipt size={18} />} icon={<ActionReceipt size={18} />}
theme='solid' theme='solid'
type='secondary' type='secondary'
className='!rounded-xl !px-4 hover:scale-105 transition-transform' className='!rounded-xl !px-4 hover:scale-105 transition-transform'
+8 -4
View File
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Send as ActionSend,
Trash2 as ActionTrash2,
Square as ActionSquare,
} from '@/components/common/icons/ActionIcons';
import React, { import React, {
forwardRef, forwardRef,
useImperativeHandle, useImperativeHandle,
@@ -24,7 +29,6 @@ import React, {
useState, useState,
} from 'react'; } from 'react';
import { Avatar, Button, Input, List } from 'antd'; import { Avatar, Button, Input, List } from 'antd';
import { Send, Square, Trash2 } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
// Only message presentation and the composer live here; the page owns all chat actions. // Only message presentation and the composer live here; the page owns all chat actions.
@@ -86,14 +90,14 @@ export const Chat = forwardRef(function Chat(
type='primary' type='primary'
aria-label={t('发送')} aria-label={t('发送')}
disabled={value.length === 0 || (showStopGenerate && generating)} disabled={value.length === 0 || (showStopGenerate && generating)}
icon={<Send size={16} />} icon={<ActionSend size={16} />}
onClick={send} onClick={send}
/> />
), ),
clearContextNode: showClearContext ? ( clearContextNode: showClearContext ? (
<Button <Button
aria-label={t('清空对话')} aria-label={t('清空对话')}
icon={<Trash2 size={16} />} icon={<ActionTrash2 size={16} />}
onClick={onClear} onClick={onClear}
/> />
) : null, ) : null,
@@ -101,7 +105,7 @@ export const Chat = forwardRef(function Chat(
showStopGenerate && generating ? ( showStopGenerate && generating ? (
<Button <Button
aria-label={t('停止生成')} aria-label={t('停止生成')}
icon={<Square size={16} />} icon={<ActionSquare size={16} />}
onClick={onStopGenerator} onClick={onStopGenerator}
/> />
) : null, ) : null,
+18 -3
View File
@@ -188,7 +188,11 @@ function labelProps(label) {
typeof label === 'object' && typeof label === 'object' &&
!React.isValidElement(label) && !React.isValidElement(label) &&
'text' in label 'text' in label
? { label: label.text, required: label.required, htmlFor: label.name } ? {
label: label.text,
required: label.required,
...(label.name ? { htmlFor: label.name } : {}),
}
: { label }; : { label };
} }
@@ -273,16 +277,27 @@ export function withField(
if (error) throw new Error(String(error)); if (error) throw new Error(String(error));
}, },
}); });
const fieldLabel = labelProps(label);
const control = const control =
field === undefined && props.children && Component === Controls.Input ? ( field === undefined && props.children && Component === Controls.Input ? (
props.children props.children
) : ( ) : (
<Component {...props} ref={ref} style={style} /> <Component
{...props}
id={props.id ?? fieldLabel.htmlFor}
ref={ref}
style={style}
/>
); );
// Unnamed slots remain controlled by the page; named fields use Ant Form's store. // Unnamed slots remain controlled by the page; named fields use Ant Form's store.
return ( return (
<AntForm.Item <AntForm.Item
{...(noLabel ? {} : labelProps(label))} {...(noLabel
? {}
: {
...fieldLabel,
...(control?.props?.id ? { htmlFor: control.props.id } : {}),
})}
name={field === undefined ? undefined : fieldPath(field)} name={field === undefined ? undefined : fieldPath(field)}
initialValue={initValue} initialValue={initValue}
rules={normalizedRules} rules={normalizedRules}
+104 -521
View File
@@ -18,525 +18,108 @@ For commercial licensing, please contact support@quantumnous.com
*/ */
import React from 'react'; import React from 'react';
import * as Icons from 'lucide-react'; import * as Icons from '../common/icons/ActionIcons';
export const IconSearch = ({ size = 16, ...props }) => ( // Tooltip and Popover need a ref to the DOM node to avoid findDOMNode in StrictMode.
<Icons.Search const createIcon = (Icon, displayName) => {
{...props} const Component = React.forwardRef(function LegacyIcon(
size={ { size = 16, ...props },
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size ref,
} ) {
/> return (
); <Icon
export const IconPlus = ({ size = 16, ...props }) => ( {...props}
<Icons.Plus ref={ref}
{...props} size={
size={ { small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size }
} />
/> );
); });
export const IconRefresh = ({ size = 16, ...props }) => ( Component.displayName = displayName;
<Icons.RefreshCw return Component;
{...props} };
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size export const IconSearch = createIcon(Icons.Search, 'IconSearch');
} export const IconPlus = createIcon(Icons.Plus, 'IconPlus');
/> export const IconRefresh = createIcon(Icons.RefreshCw, 'IconRefresh');
); export const IconDelete = createIcon(Icons.Trash2, 'IconDelete');
export const IconDelete = ({ size = 16, ...props }) => ( export const IconClose = createIcon(Icons.X, 'IconClose');
<Icons.Trash2 export const IconMail = createIcon(Icons.Mail, 'IconMail');
{...props} export const IconKey = createIcon(Icons.KeyRound, 'IconKey');
size={ export const IconEdit = createIcon(Icons.Pencil, 'IconEdit');
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size export const IconSave = createIcon(Icons.Save, 'IconSave');
} export const IconLock = createIcon(Icons.LockKeyhole, 'IconLock');
/> export const IconCopy = createIcon(Icons.Copy, 'IconCopy');
); export const IconLink = createIcon(Icons.Link, 'IconLink');
export const IconClose = ({ size = 16, ...props }) => ( export const IconUser = createIcon(Icons.User, 'IconUser');
<Icons.X export const IconChevronDown = createIcon(Icons.ChevronDown, 'IconChevronDown');
{...props} export const IconAlertTriangle = createIcon(
size={ Icons.TriangleAlert,
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size 'IconAlertTriangle',
} );
/> export const IconGithubLogo = createIcon(Icons.Github, 'IconGithubLogo');
); export const IconEyeOpened = createIcon(Icons.Eye, 'IconEyeOpened');
export const IconMail = ({ size = 16, ...props }) => ( export const IconChevronUp = createIcon(Icons.ChevronUp, 'IconChevronUp');
<Icons.Mail export const IconCreditCard = createIcon(Icons.CreditCard, 'IconCreditCard');
{...props} export const IconMore = createIcon(Icons.Ellipsis, 'IconMore');
size={ export const IconFile = createIcon(Icons.File, 'IconFile');
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size export const IconShield = createIcon(Icons.Shield, 'IconShield');
} export const IconCode = createIcon(Icons.Code, 'IconCode');
/> export const IconBolt = createIcon(Icons.Zap, 'IconBolt');
); export const IconFilter = createIcon(Icons.Filter, 'IconFilter');
export const IconKey = ({ size = 16, ...props }) => ( export const IconHelpCircle = createIcon(Icons.CircleHelp, 'IconHelpCircle');
<Icons.KeyRound export const IconGift = createIcon(Icons.Gift, 'IconGift');
{...props} export const IconEyeClosed = createIcon(Icons.EyeOff, 'IconEyeClosed');
size={ export const IconPlayCircle = createIcon(Icons.CirclePlay, 'IconPlayCircle');
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size export const IconCheckCircleStroked = createIcon(
} Icons.CircleCheck,
/> 'IconCheckCircleStroked',
); );
export const IconEdit = ({ size = 16, ...props }) => ( export const IconTreeTriangleDown = createIcon(
<Icons.Pencil Icons.ChevronDown,
{...props} 'IconTreeTriangleDown',
size={ );
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size export const IconSetting = createIcon(Icons.Settings, 'IconSetting');
} export const IconLayers = createIcon(Icons.Layers, 'IconLayers');
/> export const IconUserAdd = createIcon(Icons.UserPlus, 'IconUserAdd');
); export const IconPulse = createIcon(Icons.Activity, 'IconPulse');
export const IconSave = ({ size = 16, ...props }) => ( export const IconSend = createIcon(Icons.Send, 'IconSend');
<Icons.Save export const IconVideo = createIcon(Icons.Video, 'IconVideo');
{...props} export const IconActivity = createIcon(Icons.Activity, 'IconActivity');
size={ export const IconDownload = createIcon(Icons.Download, 'IconDownload');
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size export const IconShieldStroked = createIcon(Icons.Shield, 'IconShieldStroked');
} export const IconMinus = createIcon(Icons.Minus, 'IconMinus');
/> export const IconMenu = createIcon(Icons.Menu, 'IconMenu');
); export const IconBell = createIcon(Icons.Bell, 'IconBell');
export const IconLock = ({ size = 16, ...props }) => ( export const IconUpload = createIcon(Icons.Upload, 'IconUpload');
<Icons.LockKeyhole export const IconHistory = createIcon(Icons.History, 'IconHistory');
{...props} export const IconServer = createIcon(Icons.Server, 'IconServer');
size={ export const IconGlobe = createIcon(Icons.Globe, 'IconGlobe');
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size export const IconBookmark = createIcon(Icons.Bookmark, 'IconBookmark');
} export const IconInfoCircle = createIcon(Icons.Info, 'IconInfoCircle');
/> export const IconExternalOpen = createIcon(
); Icons.ExternalLink,
export const IconCopy = ({ size = 16, ...props }) => ( 'IconExternalOpen',
<Icons.Copy );
{...props} export const IconUserGroup = createIcon(Icons.Users, 'IconUserGroup');
size={ export const IconMoneyExchangeStroked = createIcon(
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size Icons.ArrowRightLeft,
} 'IconMoneyExchangeStroked',
/> );
); export const IconHistogram = createIcon(Icons.ChartColumn, 'IconHistogram');
export const IconLink = ({ size = 16, ...props }) => ( export const IconStopwatchStroked = createIcon(
<Icons.Link Icons.Timer,
{...props} 'IconStopwatchStroked',
size={ );
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size export const IconTypograph = createIcon(Icons.Type, 'IconTypograph');
} export const IconTickCircle = createIcon(Icons.CircleCheck, 'IconTickCircle');
/> export const IconImage = createIcon(Icons.Image, 'IconImage');
); export const IconAlertCircle = createIcon(Icons.CircleAlert, 'IconAlertCircle');
export const IconUser = ({ size = 16, ...props }) => ( export const IconLineChart = createIcon(Icons.ChartLine, 'IconLineChart');
<Icons.User export const IconSaveStroked = createIcon(Icons.Save, 'IconSaveStroked');
{...props} export const Iconbolt = createIcon(Icons.Zap, 'Iconbolt');
size={ export const IconClock = createIcon(Icons.Clock, 'IconClock');
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size export const IconTick = createIcon(Icons.Check, 'IconTick');
} export const IconArrowRight = createIcon(Icons.ArrowRight, 'IconArrowRight');
/> export const IconArticle = createIcon(Icons.FileText, 'IconArticle');
);
export const IconChevronDown = ({ size = 16, ...props }) => (
<Icons.ChevronDown
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconAlertTriangle = ({ size = 16, ...props }) => (
<Icons.TriangleAlert
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconGithubLogo = ({ size = 16, ...props }) => (
<Icons.Github
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconEyeOpened = ({ size = 16, ...props }) => (
<Icons.Eye
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconChevronUp = ({ size = 16, ...props }) => (
<Icons.ChevronUp
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconCreditCard = ({ size = 16, ...props }) => (
<Icons.CreditCard
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconMore = ({ size = 16, ...props }) => (
<Icons.Ellipsis
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconFile = ({ size = 16, ...props }) => (
<Icons.File
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconShield = ({ size = 16, ...props }) => (
<Icons.Shield
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconCode = ({ size = 16, ...props }) => (
<Icons.Code
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconBolt = ({ size = 16, ...props }) => (
<Icons.Zap
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconFilter = ({ size = 16, ...props }) => (
<Icons.Filter
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconHelpCircle = ({ size = 16, ...props }) => (
<Icons.CircleHelp
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconGift = ({ size = 16, ...props }) => (
<Icons.Gift
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconEyeClosed = ({ size = 16, ...props }) => (
<Icons.EyeOff
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconPlayCircle = ({ size = 16, ...props }) => (
<Icons.CirclePlay
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconCheckCircleStroked = ({ size = 16, ...props }) => (
<Icons.CircleCheck
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconTreeTriangleDown = ({ size = 16, ...props }) => (
<Icons.ChevronDown
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconSetting = ({ size = 16, ...props }) => (
<Icons.Settings
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconLayers = ({ size = 16, ...props }) => (
<Icons.Layers
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconUserAdd = ({ size = 16, ...props }) => (
<Icons.UserPlus
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconPulse = ({ size = 16, ...props }) => (
<Icons.Activity
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconSend = ({ size = 16, ...props }) => (
<Icons.Send
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconVideo = ({ size = 16, ...props }) => (
<Icons.Video
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconActivity = ({ size = 16, ...props }) => (
<Icons.Activity
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconDownload = ({ size = 16, ...props }) => (
<Icons.Download
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconShieldStroked = ({ size = 16, ...props }) => (
<Icons.Shield
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconMinus = ({ size = 16, ...props }) => (
<Icons.Minus
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconMenu = ({ size = 16, ...props }) => (
<Icons.Menu
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconBell = ({ size = 16, ...props }) => (
<Icons.Bell
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconUpload = ({ size = 16, ...props }) => (
<Icons.Upload
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconHistory = ({ size = 16, ...props }) => (
<Icons.History
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconServer = ({ size = 16, ...props }) => (
<Icons.Server
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconGlobe = ({ size = 16, ...props }) => (
<Icons.Globe
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconBookmark = ({ size = 16, ...props }) => (
<Icons.Bookmark
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconInfoCircle = ({ size = 16, ...props }) => (
<Icons.Info
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconExternalOpen = ({ size = 16, ...props }) => (
<Icons.ExternalLink
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconUserGroup = ({ size = 16, ...props }) => (
<Icons.Users
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconMoneyExchangeStroked = ({ size = 16, ...props }) => (
<Icons.ArrowRightLeft
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconHistogram = ({ size = 16, ...props }) => (
<Icons.ChartColumn
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconStopwatchStroked = ({ size = 16, ...props }) => (
<Icons.Timer
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconTypograph = ({ size = 16, ...props }) => (
<Icons.Type
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconTickCircle = ({ size = 16, ...props }) => (
<Icons.CircleCheck
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconImage = ({ size = 16, ...props }) => (
<Icons.Image
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconAlertCircle = ({ size = 16, ...props }) => (
<Icons.CircleAlert
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconLineChart = ({ size = 16, ...props }) => (
<Icons.ChartLine
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconSaveStroked = ({ size = 16, ...props }) => (
<Icons.Save
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const Iconbolt = ({ size = 16, ...props }) => (
<Icons.Zap
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconClock = ({ size = 16, ...props }) => (
<Icons.Clock
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconTick = ({ size = 16, ...props }) => (
<Icons.Check
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconArrowRight = ({ size = 16, ...props }) => (
<Icons.ArrowRight
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconArticle = ({ size = 16, ...props }) => (
<Icons.FileText
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
+1
View File
@@ -29,6 +29,7 @@ import { bootstrapLanguage, createBrowserEnv } from './i18n/bootstrap';
import { API } from './helpers'; import { API } from './helpers';
import './styles/tokens.css'; import './styles/tokens.css';
import './index.css'; import './index.css';
import './styles/action-icons.css';
import './styles/org.css'; import './styles/org.css';
import './styles/prototype.css'; import './styles/prototype.css';
import './styles/user-center.css'; import './styles/user-center.css';
+14 -7
View File
@@ -17,6 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com For commercial licensing, please contact support@quantumnous.com
*/ */
import {
Eye as ActionEye,
Check as ActionCheck,
X as ActionX,
Ban as ActionBan,
RotateCw as ActionRotateCw,
} from '@/components/common/icons/ActionIcons';
import { import {
ConsoleCard, ConsoleCard,
ConsoleSearchBar, ConsoleSearchBar,
@@ -35,7 +42,7 @@ import {
Spin, Spin,
Typography, Typography,
} from '@/components/ui'; } from '@/components/ui';
import { Search, Eye, Check, X, RotateCw, Ban } from 'lucide-react'; import { Search } from 'lucide-react';
import { API, showError, showSuccess } from '../../helpers'; import { API, showError, showSuccess } from '../../helpers';
import { import {
INVOICE_STATUS, INVOICE_STATUS,
@@ -298,7 +305,7 @@ const AdminInvoice = () => {
<Button <Button
size='small' size='small'
theme='borderless' theme='borderless'
icon={<Eye size={14} />} icon={<ActionEye size={14} />}
onClick={() => handleViewDetail(record.id)} onClick={() => handleViewDetail(record.id)}
/> />
{record.status === INVOICE_STATUS.PENDING && ( {record.status === INVOICE_STATUS.PENDING && (
@@ -307,7 +314,7 @@ const AdminInvoice = () => {
size='small' size='small'
theme='borderless' theme='borderless'
type='primary' type='primary'
icon={<Check size={14} />} icon={<ActionCheck size={14} />}
onClick={() => { onClick={() => {
setApproveId(record.id); setApproveId(record.id);
setApproveVisible(true); setApproveVisible(true);
@@ -319,7 +326,7 @@ const AdminInvoice = () => {
size='small' size='small'
theme='borderless' theme='borderless'
type='danger' type='danger'
icon={<X size={14} />} icon={<ActionX size={14} />}
onClick={() => { onClick={() => {
setRejectId(record.id); setRejectId(record.id);
setRejectVisible(true); setRejectVisible(true);
@@ -335,7 +342,7 @@ const AdminInvoice = () => {
size='small' size='small'
theme='borderless' theme='borderless'
type='danger' type='danger'
icon={<Ban size={14} />} icon={<ActionBan size={14} />}
onClick={() => handleFailCancel(record.id)} onClick={() => handleFailCancel(record.id)}
> >
{t('取消')} {t('取消')}
@@ -346,7 +353,7 @@ const AdminInvoice = () => {
<Button <Button
size='small' size='small'
theme='borderless' theme='borderless'
icon={<RotateCw size={14} />} icon={<ActionRotateCw size={14} />}
onClick={() => handleRetry(record.id)} onClick={() => handleRetry(record.id)}
> >
{t('重试')} {t('重试')}
@@ -355,7 +362,7 @@ const AdminInvoice = () => {
size='small' size='small'
theme='borderless' theme='borderless'
type='danger' type='danger'
icon={<Ban size={14} />} icon={<ActionBan size={14} />}
onClick={() => handleFailCancel(record.id)} onClick={() => handleFailCancel(record.id)}
> >
{t('取消')} {t('取消')}

Some files were not shown because too many files have changed in this diff Show More