feat: add Team Auto Registration page for batch creation and management of ChatGPT Team accounts.

This commit is contained in:
2026-02-01 08:16:30 +08:00
parent 6254e3781b
commit 0808da128d
2 changed files with 29 additions and 6 deletions

View File

@@ -164,14 +164,37 @@ func checkAndAutoAdd() {
} }
} }
// 读取代理配置
proxyURL := ""
replenishUseProxy := false
if val, _ := database.Instance.GetConfig("monitor_replenish_use_proxy"); val == "true" {
replenishUseProxy = true
}
if replenishUseProxy {
proxyURL = config.Global.DefaultProxy
}
// 读取浏览器类型配置
browserType := "rod"
if val, _ := database.Instance.GetConfig("monitor_browser_type"); val != "" {
browserType = val
}
req := TeamProcessRequest{ req := TeamProcessRequest{
Owners: reqOwners, Owners: reqOwners,
MembersPerTeam: 4, MembersPerTeam: 4,
ConcurrentTeams: 2, ConcurrentTeams: 2,
IncludeOwner: false, IncludeOwner: false,
Headless: true, Headless: true,
BrowserType: "rod", // 默认使用 rod BrowserType: browserType,
Proxy: "", // 不使用代理 Proxy: proxyURL,
}
// 输出代理使用状态日志
if proxyURL != "" {
logger.Info(fmt.Sprintf("自动补号: 使用代理 %s", proxyURL), "", "auto-add")
} else {
logger.Info("自动补号: 未使用代理", "", "auto-add")
} }
// 初始化状态 // 初始化状态
@@ -186,7 +209,7 @@ func checkAndAutoAdd() {
// 异步执行 // 异步执行
go runTeamProcess(req) go runTeamProcess(req)
logger.Success(fmt.Sprintf("自动补号任务已启动: %d 个 Team", actualTeams), "", "auto-add") logger.Success(fmt.Sprintf("自动补号任务已启动: %d 个 Team (浏览器: %s)", actualTeams, browserType), "", "auto-add")
} }
// getS2AAccountCount 获取 S2A 当前账号数量 // getS2AAccountCount 获取 S2A 当前账号数量

View File

@@ -414,7 +414,7 @@ export default function TeamReg() {
</Card> </Card>
{/* 实时日志 */} {/* 实时日志 */}
<Card className="glass-card lg:col-span-2 flex flex-col"> <Card className="glass-card lg:col-span-2">
<CardHeader> <CardHeader>
<CardTitle className="flex items-center gap-2"> <CardTitle className="flex items-center gap-2">
<Terminal className="h-5 w-5 text-green-500" /> <Terminal className="h-5 w-5 text-green-500" />
@@ -448,10 +448,10 @@ export default function TeamReg() {
</button> </button>
</div> </div>
</CardHeader> </CardHeader>
<CardContent className="flex-1 flex flex-col"> <CardContent>
<div <div
ref={logsContainerRef} ref={logsContainerRef}
className="min-h-[400px] flex-1 overflow-y-auto bg-slate-900 rounded-lg p-4 font-mono text-sm" className="h-[500px] overflow-y-auto bg-slate-900 rounded-lg p-4 font-mono text-sm"
> >
{logs.length === 0 ? ( {logs.length === 0 ? (
<div className="flex items-center justify-center h-full text-slate-500"> <div className="flex items-center justify-center h-full text-slate-500">