feat: Implement initial Codex Pool backend server with comprehensive APIs for configuration, S2A integration, owner management, batch processing, monitoring, and corresponding frontend pages.
This commit is contained in:
@@ -70,10 +70,13 @@ export default function Upload() {
|
||||
const [membersPerTeam, setMembersPerTeam] = useState(4)
|
||||
const [concurrentTeams, setConcurrentTeams] = useState(2)
|
||||
const [browserType, setBrowserType] = useState<'chromedp' | 'rod'>('chromedp')
|
||||
const [proxy, setProxy] = useState('')
|
||||
const [useProxy, setUseProxy] = useState(false) // 是否使用全局代理
|
||||
const [includeOwner, setIncludeOwner] = useState(false) // 母号也入库
|
||||
const [processCount, setProcessCount] = useState(0) // 处理数量,0表示全部
|
||||
|
||||
// 获取全局代理地址
|
||||
const globalProxy = config.proxy?.default || ''
|
||||
|
||||
const hasConfig = config.s2a.apiBase && config.s2a.adminKey
|
||||
|
||||
// Load stats
|
||||
@@ -191,7 +194,7 @@ export default function Upload() {
|
||||
concurrent_teams: Math.min(concurrentTeams, stats?.valid || 1),
|
||||
browser_type: browserType,
|
||||
headless: true, // 始终使用无头模式
|
||||
proxy,
|
||||
proxy: useProxy ? globalProxy : '',
|
||||
include_owner: includeOwner, // 母号也入库
|
||||
process_count: processCount, // 处理数量,0表示全部
|
||||
}),
|
||||
@@ -209,7 +212,7 @@ export default function Upload() {
|
||||
alert('启动失败')
|
||||
}
|
||||
setLoading(false)
|
||||
}, [stats, membersPerTeam, concurrentTeams, browserType, proxy, includeOwner, processCount, fetchStatus])
|
||||
}, [stats, membersPerTeam, concurrentTeams, browserType, useProxy, globalProxy, includeOwner, processCount, fetchStatus])
|
||||
|
||||
// 停止处理
|
||||
const handleStop = useCallback(async () => {
|
||||
@@ -469,13 +472,15 @@ export default function Upload() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Input
|
||||
label="代理地址(可选)"
|
||||
placeholder="http://127.0.0.1:7890"
|
||||
value={proxy}
|
||||
onChange={(e) => setProxy(e.target.value)}
|
||||
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={useProxy}
|
||||
onChange={setUseProxy}
|
||||
disabled={isRunning || !globalProxy}
|
||||
label="使用全局代理"
|
||||
description={globalProxy ? `当前代理: ${globalProxy}` : '请先在系统配置中设置代理地址'}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="p-3 rounded-lg bg-slate-50 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700">
|
||||
<Switch
|
||||
|
||||
Reference in New Issue
Block a user