| 603 | } |
| 604 | |
| 605 | func buildCreateReqFromBatchInstallReq(req dto.AgentBatchInstallReq) dto.AgentCreateReq { |
| 606 | return dto.AgentCreateReq{ |
| 607 | Name: req.Name, |
| 608 | Remark: req.Remark, |
| 609 | AppVersion: req.AppVersion, |
| 610 | WebUIPort: req.WebUIPort, |
| 611 | BridgePort: req.BridgePort, |
| 612 | AllowedOrigins: req.AllowedOrigins, |
| 613 | AgentType: req.AgentType, |
| 614 | Model: req.Model, |
| 615 | AccountID: req.AccountID, |
| 616 | Token: req.Token, |
| 617 | TaskID: req.TaskID, |
| 618 | Advanced: req.Advanced, |
| 619 | ContainerName: req.ContainerName, |
| 620 | AllowPort: req.AllowPort, |
| 621 | SpecifyIP: req.SpecifyIP, |
| 622 | RestartPolicy: req.RestartPolicy, |
| 623 | CpuQuota: req.CpuQuota, |
| 624 | MemoryLimit: req.MemoryLimit, |
| 625 | MemoryUnit: req.MemoryUnit, |
| 626 | PullImage: req.PullImage, |
| 627 | EditCompose: req.EditCompose, |
| 628 | DockerCompose: req.DockerCompose, |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | func buildBatchInstallAgentName(agentType string) (string, error) { |
| 633 | prefix := strings.ToLower(strings.TrimSpace(agentType)) |