| @@ -86,8 +86,9 @@ type AiModelQueryOptions struct { | |||||
| SortType string | SortType string | ||||
| New int | New int | ||||
| // JobStatus CloudbrainStatus | // JobStatus CloudbrainStatus | ||||
| Type int | |||||
| Status int | |||||
| Type int | |||||
| Status int | |||||
| IsOnlyThisRepo bool | |||||
| } | } | ||||
| func (a *AiModelConvert) IsGpuTrainTask() bool { | func (a *AiModelConvert) IsGpuTrainTask() bool { | ||||
| @@ -427,11 +428,11 @@ func QueryModel(opts *AiModelQueryOptions) ([]*AiModelManage, int64, error) { | |||||
| builder.Eq{"ai_model_manage.status": opts.Status}, | builder.Eq{"ai_model_manage.status": opts.Status}, | ||||
| ) | ) | ||||
| } | } | ||||
| orCon := builder.NewCond() | |||||
| orCon = orCon.And(builder.Eq{"ai_model_manage.is_private": false}) | |||||
| cond = cond.Or(orCon) | |||||
| if !opts.IsOnlyThisRepo { | |||||
| orCon := builder.NewCond() | |||||
| orCon = orCon.And(builder.Eq{"ai_model_manage.is_private": false}) | |||||
| cond = cond.Or(orCon) | |||||
| } | |||||
| count, err := sess.Where(cond).Count(new(AiModelManage)) | count, err := sess.Where(cond).Count(new(AiModelManage)) | ||||
| if err != nil { | if err != nil { | ||||
| return nil, 0, fmt.Errorf("Count: %v", err) | return nil, 0, fmt.Errorf("Count: %v", err) | ||||
| @@ -1193,15 +1193,17 @@ func QueryModelListForPredict(ctx *context.Context) { | |||||
| if pageSize <= 0 { | if pageSize <= 0 { | ||||
| pageSize = -1 | pageSize = -1 | ||||
| } | } | ||||
| IsOnlyThisRepo := ctx.QueryBool("isOnlyThisRepo") | |||||
| modelResult, count, err := models.QueryModel(&models.AiModelQueryOptions{ | modelResult, count, err := models.QueryModel(&models.AiModelQueryOptions{ | ||||
| ListOptions: models.ListOptions{ | ListOptions: models.ListOptions{ | ||||
| Page: page, | Page: page, | ||||
| PageSize: pageSize, | PageSize: pageSize, | ||||
| }, | }, | ||||
| RepoID: repoId, | |||||
| Type: ctx.QueryInt("type"), | |||||
| New: -1, | |||||
| Status: 0, | |||||
| RepoID: repoId, | |||||
| Type: ctx.QueryInt("type"), | |||||
| New: -1, | |||||
| Status: 0, | |||||
| IsOnlyThisRepo: IsOnlyThisRepo, | |||||
| }) | }) | ||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("Cloudbrain", err) | ctx.ServerError("Cloudbrain", err) | ||||
| @@ -487,7 +487,7 @@ | |||||
| } | } | ||||
| function loadModelList(){ | function loadModelList(){ | ||||
| $.get(`${repolink}/modelmanage/query_model_for_predict?repoId=${repoId}&type=-1`, (data) => { | |||||
| $.get(`${repolink}/modelmanage/query_model_for_predict?repoId=${repoId}&type=-1&isOnlyThisRepo=true`, (data) => { | |||||
| modelData = data | modelData = data | ||||
| let nameList = data.nameList | let nameList = data.nameList | ||||
| const n_length = nameList.length | const n_length = nameList.length | ||||