Browse Source

add interface

tags/v1.21.12.1
lewis 4 years ago
parent
commit
c0a5c8a48c
1 changed files with 19 additions and 0 deletions
  1. +19
    -0
      routers/repo/cloudbrain.go

+ 19
- 0
routers/repo/cloudbrain.go View File

@@ -23,6 +23,7 @@ const (
tplCloudBrainIndex base.TplName = "repo/cloudbrain/index"
tplCloudBrainNew base.TplName = "repo/cloudbrain/new"
tplCloudBrainShow base.TplName = "repo/cloudbrain/show"
tplCloudBrainShowModels base.TplName = "repo/cloudbrain/show_models"
)

var (
@@ -332,6 +333,24 @@ func CloudBrainDel(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain")
}

func CloudBrainGetModels(ctx *context.Context) {
ctx.Data["PageIsCloudBrain"] = true

var jobID = ctx.Params(":jobid")
task, err := models.GetCloudbrainByJobID(jobID)
if err != nil {
log.Error("no such job!")
ctx.RenderWithErr("no such job!", tplCloudBrainIndex, nil)
return
}



ctx.Data["task"] = task
ctx.Data["jobID"] = jobID
ctx.HTML(200, tplCloudBrainShowModels)
}

func GetRate(ctx *context.Context) {
var jobID = ctx.Params(":jobid")
job, err := models.GetCloudbrainByJobID(jobID)


Loading…
Cancel
Save