merge: 合入总仓库 weiyuan(bfdfb339) web/ 新功能,保留 ui-optimization 的 UI 重构

来源:luoguang/monkey-ai weiyuan@bfdfb339 的 web/(经 sync/main-weiyuan-web-bfdfb339 同步)
同步基准:总仓库 a2ca13cb = 本仓库初始导入 d8f3aee2

冲突处理原则:保留 ui-optimization 的 UI(样式/结构/组件),嫁接 weiyuan 的功能逻辑。
- i18n:按键三方合并;ours 的「令牌→密钥」改名键上移植 theirs 的术语修订
- task-logs / OrgLogs:ours 已手工移植同一功能(6ad95e2),保留 ours
- 删除:OrgCreate(theirs 下线 /org/create)、旧 image 组件与 VideoRegenerateModal(theirs 体验中心重写)、
  OrgAvatarSection / PricingBentoPage / CommissionConsole(ours 重构中已移除)
- 测试:users-pagination 的 i18next mock 补 t();theirs 新增文件补 license header
This commit is contained in:
qiubaishen
2026-11-10 12:01:21 +08:00
266 changed files with 38432 additions and 7570 deletions
+39 -26
View File
@@ -29,9 +29,9 @@ import {
TrendingUp,
TrendingDown,
} from 'lucide-react';
import { renderQuota } from '../../helpers';
import { renderQuota, timestamp2string } from '../../helpers';
const OverviewCards = ({ overview, t }) => {
const OverviewCards = ({ overview, loading = false, t }) => {
if (!overview) {
return (
<div className='grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4'>
@@ -124,31 +124,44 @@ const OverviewCards = ({ overview, t }) => {
};
return (
<div className='grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4'>
{cards.map((card, index) => (
<Card
key={index}
className={`${card.bgColor} border-none shadow-sm hover:shadow-md transition-shadow`}
bodyStyle={{ padding: '16px' }}
>
<div className='flex items-start justify-between'>
<div className='flex-1'>
<p className='text-xs text-gray-500 dark:text-gray-400 mb-1'>
{card.title}
</p>
<p className='text-xl font-bold text-gray-800 dark:text-gray-100'>
{card.value}
</p>
{renderChange(card.change)}
<div>
<div
className={`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 transition-opacity ${
loading ? 'opacity-50' : ''
}`}
>
{cards.map((card, index) => (
<Card
key={index}
className={`${card.bgColor} border-none shadow-sm hover:shadow-md transition-shadow`}
bodyStyle={{ padding: '16px' }}
>
<div className='flex items-start justify-between'>
<div className='flex-1'>
<p className='text-xs text-gray-500 dark:text-gray-400 mb-1'>
{card.title}
</p>
<p className='text-xl font-bold text-gray-800 dark:text-gray-100'>
{card.value}
</p>
{renderChange(card.change)}
</div>
<div
className={`${card.iconBg} p-2 rounded-lg text-white shadow-sm`}
>
{card.icon}
</div>
</div>
<div
className={`${card.iconBg} p-2 rounded-lg text-white shadow-sm`}
>
{card.icon}
</div>
</div>
</Card>
))}
</Card>
))}
</div>
{/* 活跃/消耗取自汇总层时会落后一个同步周期(约 30~60 秒),把截止时间标出来,
避免「数字和日志对不上」被当成算错;data_as_of 为 0 表示本次是实时直查。 */}
{overview.data_as_of > 0 && (
<p className='mt-2 text-xs text-gray-400 dark:text-gray-500 text-right'>
{t('活跃与消耗数据截至')} {timestamp2string(overview.data_as_of)}
</p>
)}
</div>
);
};