| @@ -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)) | ||||
| @@ -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") { | ||||