Browse Source

Merge branch 'inference-job' of https://git.openi.org.cn/OpenI/aiforge into inference-job

pull/1406/head
zhoupzh 3 years ago
parent
commit
f546dc0492
2 changed files with 9 additions and 3 deletions
  1. +7
    -2
      routers/repo/ai_model_manage.go
  2. +2
    -1
      routers/repo/setting.go

+ 7
- 2
routers/repo/ai_model_manage.go View File

@@ -487,8 +487,7 @@ func ShowOneVersionOtherModel(ctx *context.Context) {
} }
} }


func ShowModelTemplate(ctx *context.Context) {
ctx.Data["isModelManage"] = true
func SetModelCount(ctx *context.Context) {
repoId := ctx.Repo.Repository.ID repoId := ctx.Repo.Repository.ID
Type := -1 Type := -1
_, count, _ := models.QueryModel(&models.AiModelQueryOptions{ _, count, _ := models.QueryModel(&models.AiModelQueryOptions{
@@ -501,6 +500,12 @@ func ShowModelTemplate(ctx *context.Context) {
New: MODEL_LATEST, New: MODEL_LATEST,
}) })
ctx.Data["MODEL_COUNT"] = count ctx.Data["MODEL_COUNT"] = count
}

func ShowModelTemplate(ctx *context.Context) {
ctx.Data["isModelManage"] = true
repoId := ctx.Repo.Repository.ID
SetModelCount(ctx)


_, trainCount, _ := models.QueryModelTrainJobList(repoId) _, trainCount, _ := models.QueryModelTrainJobList(repoId)
log.Info("query train count=" + fmt.Sprint(trainCount)) log.Info("query train count=" + fmt.Sprint(trainCount))


+ 2
- 1
routers/repo/setting.go View File

@@ -50,6 +50,7 @@ func Settings(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["PageIsSettingsOptions"] = true ctx.Data["PageIsSettingsOptions"] = true
ctx.Data["ForcePrivate"] = setting.Repository.ForcePrivate ctx.Data["ForcePrivate"] = setting.Repository.ForcePrivate
SetModelCount(ctx)
ctx.HTML(200, tplSettingsOptions) ctx.HTML(200, tplSettingsOptions)
} }


@@ -57,7 +58,7 @@ func Settings(ctx *context.Context) {
func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["PageIsSettingsOptions"] = true ctx.Data["PageIsSettingsOptions"] = true
SetModelCount(ctx)
repo := ctx.Repo.Repository repo := ctx.Repo.Repository


switch ctx.Query("action") { switch ctx.Query("action") {


Loading…
Cancel
Save