| @@ -149,14 +149,20 @@ func ListOrgRepos(ctx *context.APIContext) { | |||||
| } | } | ||||
| func GetComputeNodes(ctx *context.APIContext) { | func GetComputeNodes(ctx *context.APIContext) { | ||||
| modelarts.InitMultiNode() | |||||
| if modelarts.MultiNodeConfig != nil { | |||||
| for _, info := range modelarts.MultiNodeConfig.Info { | |||||
| if isInOrg, _ := models.IsOrganizationMemberByOrgName(info.Org, ctx.User.ID); isInOrg { | |||||
| ctx.JSON(http.StatusOK, info.Node) | |||||
| return | |||||
| taskeType := ctx.QueryInt("type") | |||||
| if taskeType == 2 { | |||||
| ctx.JSON(http.StatusOK, []int{1}) | |||||
| } else { | |||||
| modelarts.InitMultiNode() | |||||
| if modelarts.MultiNodeConfig != nil { | |||||
| for _, info := range modelarts.MultiNodeConfig.Info { | |||||
| if isInOrg, _ := models.IsOrganizationMemberByOrgName(info.Org, ctx.User.ID); isInOrg { | |||||
| ctx.JSON(http.StatusOK, info.Node) | |||||
| return | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| ctx.JSON(http.StatusOK, []int{1}) | |||||
| } | } | ||||
| ctx.JSON(http.StatusOK, []int{1}) | |||||
| } | } | ||||