feat(remote): 增加远端控制台与日志汇总导出

This commit is contained in:
yml
2026-11-21 20:07:40 +08:00
parent 79b503d1a6
commit d176c421a8
27 changed files with 3486 additions and 19 deletions
+7
View File
@@ -16,6 +16,7 @@ import (
"douyu_go/internal/constants"
imgpkg "douyu_go/internal/image"
"douyu_go/internal/logger"
"douyu_go/internal/remote"
"douyu_go/internal/seckill"
"douyu_go/internal/trace"
"douyu_go/internal/types"
@@ -53,6 +54,9 @@ type App struct {
closeLog func()
closeTrace func()
remoteMu sync.RWMutex
remoteAgent *remote.Agent
}
// getClient 返回当前 client 指针快照(读锁保护)。
@@ -228,8 +232,10 @@ func (a *App) Startup(ctx context.Context) {
scheduler.UpdateProxySettings(cfg)
scheduler.SetStateChangeCallback(func(state string) {
runtime.EventsEmit(a.ctx, seckillStateEvent, state)
a.remoteSetState(state)
})
scheduler.LoadAccounts()
a.configureRemote(cfg)
startupRefreshTried := false
tryRefreshStartupProxy := func(reason string) bool {
@@ -304,6 +310,7 @@ func (a *App) Startup(ctx context.Context) {
// Shutdown Wails 应用关闭时调用。
func (a *App) Shutdown(ctx context.Context) {
a.closeRemote()
if scheduler := a.getScheduler(); scheduler != nil {
scheduler.Close()
}