diff --git a/.gitignore b/.gitignore index 663906327..9b0924393 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ pb/proto ~$*.xlsx *.pid cmd/luban/ -pb.bat \ No newline at end of file +pb.bat +cmd/v2/.cache.meta diff --git a/cmd/v2/ui/app_gen.go b/cmd/v2/ui/app_gen.go index e6a75d723..9165ec522 100644 --- a/cmd/v2/ui/app_gen.go +++ b/cmd/v2/ui/app_gen.go @@ -70,6 +70,8 @@ func (this *appGen) LazyInit(obs observer.Observer) error { genType.PlaceHolder = "生成类型" form := widget.NewForm( + widget.NewFormItem("服务地址", serverAddr), + widget.NewFormItem("项目目录", projectDir), widget.NewFormItem("工作目录", workDir), widget.NewFormItem("Client", client), widget.NewFormItem("输入目录", inputDir), diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index dd533764a..a83cfd675 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -36,6 +36,7 @@ func newAgent(gateway IGateway, conn *websocket.Conn) *Agent { closeSignal: make(chan bool), state: 1, } + conn.SetReadDeadline(time.Now().Add(time.Minute)) //一分钟内不登录 自动断开连接 agent.wg.Add(2) go agent.readLoop() go agent.writeLoop() diff --git a/modules/gateway/agentmgr_comp.go b/modules/gateway/agentmgr_comp.go index 5a071e353..fe4960c80 100644 --- a/modules/gateway/agentmgr_comp.go +++ b/modules/gateway/agentmgr_comp.go @@ -137,7 +137,10 @@ func (this *AgentMgrComp) SendMsgToAgents(ctx context.Context, args *pb.BatchMes this.module.Debugf("SendMsgToAgents: agents:%v msg:%v", args.UserSessionIds, msg) for _, v := range args.UserSessionIds { if a, ok := this.agents.Load(v); ok { - a.(IAgent).WriteMsg(msg) + agent := a.(IAgent) + if agent.UserId() != "" { //自发送登录用户 + agent.WriteMsg(msg) + } } } return nil