Browse Source

show model

tags/v1.21.12.1
lewis 4 years ago
parent
commit
78b02e4264
2 changed files with 3 additions and 1 deletions
  1. +2
    -0
      routers/repo/cloudbrain.go
  2. +1
    -1
      templates/repo/cloudbrain/models/dir_list.tmpl

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

@@ -340,6 +340,7 @@ func CloudBrainShowModels(ctx *context.Context) {

jobID := ctx.Params(":jobid")
parentDir := ctx.Query("parentDir")
dirArray := strings.Split(parentDir, "/")
task, err := models.GetCloudbrainByJobID(jobID)
if err != nil {
log.Error("no such job!")
@@ -363,6 +364,7 @@ func CloudBrainShowModels(ctx *context.Context) {
return
}

ctx.Data["Path"] = dirArray
ctx.Data["Dirs"] = fileInfos
ctx.Data["task"] = task
ctx.Data["JobID"] = jobID


+ 1
- 1
templates/repo/cloudbrain/models/dir_list.tmpl View File

@@ -6,7 +6,7 @@
<td class="name four wide">
<span class="truncate">
<span class="octicon octicon-file-directory"></span>
<a class="title" href="{{if .IsDir}}{{$.RepoLink}}/cloudbrain/{{$.JobID}}/models?parentDir={{.ParenDir}}{{end}}">
<a class="title" href="{{if .IsDir}}{{$.RepoLink}}/cloudbrain/{{$.JobID}}/models?parentDir={{.ParenDir}}{{else}}{{$.RepoLink}}/cloudbrain/{{$.JobID}}/download_model?parentDir={{.ParenDir}}&fileName={{.FileName}}&jobName={{$.task.JobName}}{{end}}">
<span class="fitted">{{if .IsDir}} {{svg "octicon-file-directory" 16}}{{else}}{{svg "octicon-file" 16}}{{end}}</span> {{.FileName}}
</a>
</span>


Loading…
Cancel
Save