|
|
|
@@ -5,6 +5,7 @@ |
|
|
|
package user |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/modules/modelarts" |
|
|
|
"net/http" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
@@ -146,3 +147,16 @@ func ListOrgRepos(ctx *context.APIContext) { |
|
|
|
|
|
|
|
listUserRepos(ctx, ctx.Org.Organization, ctx.IsSigned) |
|
|
|
} |
|
|
|
|
|
|
|
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 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.JSON(http.StatusOK, []int{1}) |
|
|
|
} |