diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 556da9010..21a56288c 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -257,6 +257,24 @@ func DownloadMultiModelFile(ctx *context.Context) { } } +func QueryTrainJobList(ctx *context.Context) { + log.Info("query train job list. start.") + repoId := ctx.Query("repoId") + + VersionListTasks, VersionListCount, err := models.CloudbrainsVersionList(&models.CloudbrainsOptions{ + ListOptions: models.ListOptions{ + Page: -1, + PageSize: -1, + }, + RepoID: repoId, + Type: -1, + JobType: "", + JobID: "", + }) + + ctx.Json(200, VersionListTasks) +} + func DownloadSingleModelFile(ctx *context.Context) { log.Info("DownloadSingleModelFile start.") id := ctx.Params(":ID") diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 5a066c92f..19b8da196 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -974,6 +974,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Delete("/delete_model", repo.DeleteModel) m.Put("/modify_model", repo.ModifyModelInfo) m.Get("/show_model", reqRepoCloudBrainReader, repo.ShowModelPageInfo) + m.Get("/query_train_job", reqRepoCloudBrainReader, repo.QueryTrainJobList) m.Group("/:ID", func() { m.Get("", reqRepoCloudBrainReader, repo.ShowSingleModel) m.Get("/downloadsingle", reqRepoCloudBrainReader, repo.DownloadSingleModelFile)