feat: Implement batch team owner processing with file upload, configuration, and real-time status monitoring.

This commit is contained in:
2026-01-30 14:30:42 +08:00
parent 402daf79ad
commit d7f4724473
6 changed files with 289 additions and 93 deletions

View File

@@ -16,7 +16,7 @@ import {
import { FileDropzone } from '../components/upload'
import LogStream from '../components/upload/LogStream'
import OwnerList from '../components/upload/OwnerList'
import { Card, CardHeader, CardTitle, CardContent, Button, Tabs, Input } from '../components/common'
import { Card, CardHeader, CardTitle, CardContent, Button, Tabs, Input, Switch } from '../components/common'
import { useConfig } from '../hooks/useConfig'
interface OwnerStats {
@@ -71,6 +71,7 @@ export default function Upload() {
const [concurrentTeams, setConcurrentTeams] = useState(2)
const [browserType, setBrowserType] = useState<'chromedp' | 'rod'>('chromedp')
const [proxy, setProxy] = useState('')
const [includeOwner, setIncludeOwner] = useState(false) // 母号也入库
const hasConfig = config.s2a.apiBase && config.s2a.adminKey
@@ -175,6 +176,7 @@ export default function Upload() {
browser_type: browserType,
headless: true, // 始终使用无头模式
proxy,
include_owner: includeOwner, // 母号也入库
}),
})
@@ -190,7 +192,7 @@ export default function Upload() {
alert('启动失败')
}
setLoading(false)
}, [stats, membersPerTeam, concurrentTeams, browserType, proxy, fetchStatus])
}, [stats, membersPerTeam, concurrentTeams, browserType, proxy, includeOwner, fetchStatus])
// 停止处理
const handleStop = useCallback(async () => {
@@ -427,6 +429,16 @@ export default function Upload() {
disabled={isRunning}
/>
<div className="p-3 rounded-lg bg-slate-50 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700">
<Switch
checked={includeOwner}
onChange={setIncludeOwner}
disabled={isRunning}
label="母号也入库"
description="开启后母号Owner账号也会被注册到 S2A"
/>
</div>
<div className="flex gap-2 pt-2">
{isRunning ? (
<Button