From 05740cfacedfa4f734dfe04db8cf07f33b677ca1 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 23 Feb 2022 15:44:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BB=BB=E5=8A=A1=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E4=BB=93=E5=BA=93=E4=BF=A1=E6=81=AF=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/admin/cloudbrains.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/routers/admin/cloudbrains.go b/routers/admin/cloudbrains.go index 1cf5ca256..fa56bc88c 100644 --- a/routers/admin/cloudbrains.go +++ b/routers/admin/cloudbrains.go @@ -179,10 +179,17 @@ func DownloadCloudBrains(ctx *context.Context) { func allValues(row int, rs *models.CloudbrainInfo, ctx *context.Context) map[string]string { return map[string]string{getCellName("A", row): rs.JobName, getCellName("B", row): rs.Status, getCellName("C", row): rs.JobType, getCellName("D", row): time.Unix(int64(rs.Cloudbrain.CreatedUnix), 0).Format(CREATE_TIME_FORMAT), getCellName("E", row): getDurationTime(rs), - getCellName("F", row): rs.ComputeResource, getCellName("G", row): rs.Name, getCellName("H", row): rs.Repo.OwnerName + "/" + rs.Repo.Alias, getCellName("I", row): rs.JobName, + getCellName("F", row): rs.ComputeResource, getCellName("G", row): rs.Name, getCellName("H", row): getRepoPathName(rs), getCellName("I", row): rs.JobName, } } +func getRepoPathName(rs *models.CloudbrainInfo) string { + if rs.Repo != nil { + return rs.Repo.OwnerName + "/" + rs.Repo.Alias + } + return "" +} + func getDurationTime(rs *models.CloudbrainInfo) string { if rs.JobType == "TRAIN" || rs.JobType == "INFERENCE" { return rs.TrainJobDuration