Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.4.1^2
zouap 3 years ago
parent
commit
b6e31fcd9c
2 changed files with 17 additions and 4 deletions
  1. +14
    -1
      routers/repo/modelarts.go
  2. +3
    -3
      templates/repo/modelarts/notebook/show.tmpl

+ 14
- 1
routers/repo/modelarts.go View File

@@ -281,6 +281,7 @@ func NotebookShow(ctx *context.Context) {
if task.Uuid != "" && task.UserID == ctx.User.ID {
attachment, err := models.GetAttachmentByUUID(task.Uuid)
if err == nil {
task.DatasetName = attachment.Name
datasetDownloadLink = attachment.S3DownloadURL()
}
}
@@ -301,7 +302,19 @@ func NotebookShow(ctx *context.Context) {
}
}
}

if task.TrainJobDuration == "" {
if task.Duration == 0 {
var duration int64
if task.Status == string(models.JobRunning) {
duration = time.Now().Unix() - int64(task.CreatedUnix)
} else {
duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix)
}
task.Duration = duration
}
task.TrainJobDuration = models.ConvertDurationToStr(task.Duration)
}
ctx.Data["duration"] = task.TrainJobDuration
ctx.Data["datasetDownloadLink"] = datasetDownloadLink
ctx.Data["task"] = task
ctx.Data["ID"] = ID


+ 3
- 3
templates/repo/modelarts/notebook/show.tmpl View File

@@ -328,7 +328,7 @@ td, th {

<td class="ti-text-form-content">
<div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName">
{{.DatasetName}}
<a href="{{$.datasetDownloadLink}}">{{.DatasetName}}</a>
</div>
</td>
</tr>
@@ -360,12 +360,12 @@ td, th {
</tr>
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
描述
{{$.i18n.Tr "cloudbrain.description"}}
</td>

<td class="ti-text-form-content">
<div class="text-span text-span-w" id="model_storage_path">
--
{{.Description}}
</div>
</td>
</tr>


Loading…
Cancel
Save