feat: Implement browser-based OAuth authentication using Chromedp and Rod, add an upload page, and introduce team processing API.
This commit is contained in:
@@ -69,6 +69,7 @@ export default function Upload() {
|
||||
// 配置
|
||||
const [membersPerTeam, setMembersPerTeam] = useState(4)
|
||||
const [concurrentTeams, setConcurrentTeams] = useState(2)
|
||||
const [concurrentS2A, setConcurrentS2A] = useState(2) // 入库并发数
|
||||
const [browserType, setBrowserType] = useState<'chromedp' | 'rod'>('chromedp')
|
||||
const [useProxy, setUseProxy] = useState(false) // 是否使用全局代理
|
||||
const [includeOwner, setIncludeOwner] = useState(false) // 母号也入库
|
||||
@@ -192,6 +193,7 @@ export default function Upload() {
|
||||
body: JSON.stringify({
|
||||
members_per_team: membersPerTeam,
|
||||
concurrent_teams: Math.min(concurrentTeams, stats?.valid || 1),
|
||||
concurrent_s2a: concurrentS2A, // 入库并发数
|
||||
browser_type: browserType,
|
||||
headless: true, // 始终使用无头模式
|
||||
proxy: useProxy ? globalProxy : '',
|
||||
@@ -212,7 +214,7 @@ export default function Upload() {
|
||||
alert('启动失败')
|
||||
}
|
||||
setLoading(false)
|
||||
}, [stats, membersPerTeam, concurrentTeams, browserType, useProxy, globalProxy, includeOwner, processCount, fetchStatus])
|
||||
}, [stats, membersPerTeam, concurrentTeams, concurrentS2A, browserType, useProxy, globalProxy, includeOwner, processCount, fetchStatus])
|
||||
|
||||
// 停止处理
|
||||
const handleStop = useCallback(async () => {
|
||||
@@ -422,9 +424,9 @@ export default function Upload() {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<div className="grid grid-cols-3 gap-3">
|
||||
<Input
|
||||
label="每个 Team 成员数"
|
||||
label="每 Team 成员数"
|
||||
type="number"
|
||||
min={1}
|
||||
max={10}
|
||||
@@ -440,7 +442,17 @@ export default function Upload() {
|
||||
value={concurrentTeams}
|
||||
onChange={(e) => setConcurrentTeams(Number(e.target.value))}
|
||||
disabled={isRunning}
|
||||
hint={`最多 ${stats?.valid || 0} 个`}
|
||||
hint={`最多 ${stats?.valid || 0}`}
|
||||
/>
|
||||
<Input
|
||||
label="入库并发数"
|
||||
type="number"
|
||||
min={1}
|
||||
max={4}
|
||||
value={concurrentS2A}
|
||||
onChange={(e) => setConcurrentS2A(Math.min(4, Math.max(1, Number(e.target.value))))}
|
||||
disabled={isRunning}
|
||||
hint="1-4,推荐2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user