From 2fc0dcaba4a5d117a0cabac6309853a9cd48d000 Mon Sep 17 00:00:00 2001 From: kyx236 Date: Sat, 7 Feb 2026 00:10:29 +0800 Subject: [PATCH] feat: Introduce a new design system with dark mode and animations, add a reusable Tabs component, implement an Upload page, and create a backend API for team processes. --- backend/internal/api/team_process.go | 10 +++ frontend/src/components/common/Tabs.tsx | 56 ++++++++--------- frontend/src/index.css | 10 +++ frontend/src/pages/Upload.tsx | 81 +++++++++++++------------ 4 files changed, 90 insertions(+), 67 deletions(-) diff --git a/backend/internal/api/team_process.go b/backend/internal/api/team_process.go index a4b10e9..d8d03d4 100644 --- a/backend/internal/api/team_process.go +++ b/backend/internal/api/team_process.go @@ -564,6 +564,16 @@ func processSingleTeam(idx int, req TeamProcessRequest) (result TeamProcessResul if accountStatus.Status == "error" { logger.Warning(fmt.Sprintf("%s 账户状态检查失败: %s,继续尝试", logPrefix, accountStatus.Error), owner.Email, "team") + } else if accountStatus.PlanType == "free" { + logger.Warning(fmt.Sprintf("%s 母号 plan 为 free,非 Team 账户,移除", logPrefix), owner.Email, "team") + if database.Instance != nil { + database.Instance.MarkOwnerAsInvalid(owner.Email) + database.Instance.DeleteTeamOwnerByEmail(owner.Email) + logger.Info(fmt.Sprintf("%s free 母号已删除: %s", logPrefix, owner.Email), owner.Email, "team") + } + result.Errors = append(result.Errors, "账户 plan 为 free,非 Team 账户") + result.DurationMs = time.Since(startTime).Milliseconds() + return result } else { logger.Info(fmt.Sprintf("%s 账户状态正常: %s", logPrefix, accountStatus.PlanType), owner.Email, "team") } diff --git a/frontend/src/components/common/Tabs.tsx b/frontend/src/components/common/Tabs.tsx index b68927c..dfd6853 100644 --- a/frontend/src/components/common/Tabs.tsx +++ b/frontend/src/components/common/Tabs.tsx @@ -16,33 +16,35 @@ interface TabsProps { export function Tabs({ tabs, activeTab, onChange, className = '' }: TabsProps) { return ( -
- {tabs.map((tab) => ( - - ))} +
+
+ {tabs.map((tab) => ( + + ))} +
) } diff --git a/frontend/src/index.css b/frontend/src/index.css index 77b6d5c..ad9ebdd 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -366,6 +366,16 @@ body { } } +/* Hide scrollbar utility */ +.scrollbar-hide { + -ms-overflow-style: none; + scrollbar-width: none; +} + +.scrollbar-hide::-webkit-scrollbar { + display: none; +} + /* Toast notifications */ .toast { position: fixed; diff --git a/frontend/src/pages/Upload.tsx b/frontend/src/pages/Upload.tsx index bd81eee..3d67cbc 100644 --- a/frontend/src/pages/Upload.tsx +++ b/frontend/src/pages/Upload.tsx @@ -267,16 +267,16 @@ export default function Upload() {
{/* Header */}
-
-

- +
+

+ 批量入库

-

+

上传 Team Owner JSON,批量注册并入库到 S2A

-
+
@@ -313,33 +313,33 @@ export default function Upload() { )} {/* Status Overview - Compact */} -
-
+
+
{isRunning ? ( - + ) : ( -
+
)} -
+
状态
-
+
{isRunning ? '运行中' : '空闲'}
-
+
待处理
-
{stats?.valid || 0}
+
{stats?.valid || 0}
-
+
已注册
-
{totalRegistered}
+
{totalRegistered}
-
+
已入库
-
{totalS2A}
+
{totalS2A}
@@ -415,10 +415,10 @@ export default function Upload() { 处理配置 - + {/* 处理数量设置 */}
-
-
+
setConcurrentS2A(Math.min(4, Math.max(1, Number(e.target.value))))} disabled={isRunning} hint="1-4,推荐2" + className="col-span-2 sm:col-span-1" />
{/* 授权方式状态显示 */} -
{authMethod === 'api' ? ( <> -
- +
+
-
-
CodexAuth API 模式
-
纯 API 调用,无需浏览器,速度更快
+
+
CodexAuth API 模式
+
纯 API 调用,无需浏览器,速度更快
) : ( <> -
- +
+
-
-
浏览器模拟模式 (chromedp)
-
使用浏览器自动化进行授权
+
+
浏览器模拟模式
+
使用 chromedp 浏览器自动化进行授权
)}
-
+
0 - ? `代理池: ${proxyPoolStats.enabled} 个可用 / ${proxyPoolStats.total} 个总计` - : '代理池为空,请先在"代理池配置"页面添加代理' + ? `可用 ${proxyPoolStats.enabled} / 总计 ${proxyPoolStats.total}` + : '代理池为空,请先添加代理' } />
-
+