|
|
|
@@ -2,8 +2,10 @@ package repo |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/modules/git" |
|
|
|
"code.gitea.io/gitea/modules/storage" |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"net/http" |
|
|
|
"os" |
|
|
|
"os/exec" |
|
|
|
"strconv" |
|
|
|
@@ -333,7 +335,7 @@ func CloudBrainDel(ctx *context.Context) { |
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain") |
|
|
|
} |
|
|
|
|
|
|
|
func CloudBrainGetModels(ctx *context.Context) { |
|
|
|
func CloudBrainShowModels(ctx *context.Context) { |
|
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
|
|
|
|
|
var jobID = ctx.Params(":jobid") |
|
|
|
@@ -344,6 +346,7 @@ func CloudBrainGetModels(ctx *context.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//get dirs |
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["task"] = task |
|
|
|
@@ -351,6 +354,19 @@ func CloudBrainGetModels(ctx *context.Context) { |
|
|
|
ctx.HTML(200, tplCloudBrainShowModels) |
|
|
|
} |
|
|
|
|
|
|
|
func CloudBrainDownloadModel(ctx *context.Context) { |
|
|
|
filePath := ctx.Query("file_path") |
|
|
|
fileName := ctx.Query("file_name") |
|
|
|
url, err := storage.Attachments.PresignedGetURL(filePath, fileName) |
|
|
|
if err != nil { |
|
|
|
log.Error("PresignedGetURL failed: %v", err.Error()) |
|
|
|
ctx.ServerError("PresignedGetURL", err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusMovedPermanently) |
|
|
|
} |
|
|
|
|
|
|
|
func GetRate(ctx *context.Context) { |
|
|
|
var jobID = ctx.Params(":jobid") |
|
|
|
job, err := models.GetCloudbrainByJobID(jobID) |
|
|
|
|