|
|
@@ -29,7 +29,8 @@ func MustEnableModelArts(ctx *context.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
func ModelArtsIndex(ctx *context.Context) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func NotebookIndex(ctx *context.Context) { |
|
|
MustEnableModelArts(ctx) |
|
|
MustEnableModelArts(ctx) |
|
|
repo := ctx.Repo.Repository |
|
|
repo := ctx.Repo.Repository |
|
|
page := ctx.QueryInt("page") |
|
|
page := ctx.QueryInt("page") |
|
|
@@ -67,7 +68,7 @@ func ModelArtsIndex(ctx *context.Context) { |
|
|
ctx.HTML(200, tplModelArtsIndex) |
|
|
ctx.HTML(200, tplModelArtsIndex) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func ModelArtsNew(ctx *context.Context) { |
|
|
|
|
|
|
|
|
func NotebookNew(ctx *context.Context) { |
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
|
|
|
|
|
|
t := time.Now() |
|
|
t := time.Now() |
|
|
@@ -88,7 +89,7 @@ func ModelArtsNew(ctx *context.Context) { |
|
|
ctx.HTML(200, tplModelArtsNew) |
|
|
ctx.HTML(200, tplModelArtsNew) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func ModelArtsCreate(ctx *context.Context, form auth.CreateModelArtsForm) { |
|
|
|
|
|
|
|
|
func NotebookCreate(ctx *context.Context, form auth.CreateModelArtsForm) { |
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
jobName := form.JobName |
|
|
jobName := form.JobName |
|
|
uuid := form.Attachment |
|
|
uuid := form.Attachment |
|
|
@@ -104,7 +105,7 @@ func ModelArtsCreate(ctx *context.Context, form auth.CreateModelArtsForm) { |
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts") |
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func ModelArtsShow(ctx *context.Context) { |
|
|
|
|
|
|
|
|
func NotebookShow(ctx *context.Context) { |
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
|
|
|
|
|
|
var jobID = ctx.Params(":jobid") |
|
|
var jobID = ctx.Params(":jobid") |
|
|
@@ -145,7 +146,7 @@ func ModelArtsShow(ctx *context.Context) { |
|
|
ctx.HTML(200, tplModelArtsShow) |
|
|
ctx.HTML(200, tplModelArtsShow) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func ModelArtsDebug(ctx *context.Context) { |
|
|
|
|
|
|
|
|
func NotebookDebug(ctx *context.Context) { |
|
|
var jobID = ctx.Params(":jobid") |
|
|
var jobID = ctx.Params(":jobid") |
|
|
_, err := models.GetCloudbrainByJobID(jobID) |
|
|
_, err := models.GetCloudbrainByJobID(jobID) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
@@ -180,7 +181,7 @@ func ModelArtsDebug(ctx *context.Context) { |
|
|
ctx.Redirect(debugUrl) |
|
|
ctx.Redirect(debugUrl) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func ModelArtsStop(ctx *context.Context) { |
|
|
|
|
|
|
|
|
func NotebookStop(ctx *context.Context) { |
|
|
var jobID = ctx.Params(":jobid") |
|
|
var jobID = ctx.Params(":jobid") |
|
|
log.Info(jobID) |
|
|
log.Info(jobID) |
|
|
task, err := models.GetCloudbrainByJobID(jobID) |
|
|
task, err := models.GetCloudbrainByJobID(jobID) |
|
|
@@ -212,10 +213,10 @@ func ModelArtsStop(ctx *context.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts") |
|
|
|
|
|
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/notebook") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func ModelArtsDel(ctx *context.Context) { |
|
|
|
|
|
|
|
|
func NotebookDel(ctx *context.Context) { |
|
|
var jobID = ctx.Params(":jobid") |
|
|
var jobID = ctx.Params(":jobid") |
|
|
task, err := models.GetCloudbrainByJobID(jobID) |
|
|
task, err := models.GetCloudbrainByJobID(jobID) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
@@ -242,6 +243,6 @@ func ModelArtsDel(ctx *context.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts") |
|
|
|
|
|
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/notebook") |
|
|
} |
|
|
} |
|
|
|
|
|
|