@@ -139,20 +139,7 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { | |||||
var cond = builder.NewCond() | var cond = builder.NewCond() | ||||
cond = cond.And(builder.Neq{"dataset.status": DatasetStatusDeleted}) | cond = cond.And(builder.Neq{"dataset.status": DatasetStatusDeleted}) | ||||
if len(opts.Keyword) > 0 { | |||||
cond = cond.And(builder.Or(builder.Like{"dataset.title", opts.Keyword}, builder.Like{"dataset.description", opts.Keyword})) | |||||
} | |||||
if len(opts.Category) > 0 { | |||||
cond = cond.And(builder.Eq{"dataset.category": opts.Category}) | |||||
} | |||||
if len(opts.Task) > 0 { | |||||
cond = cond.And(builder.Eq{"dataset.task": opts.Task}) | |||||
} | |||||
if len(opts.License) > 0 { | |||||
cond = cond.And(builder.Eq{"dataset.license": opts.License}) | |||||
} | |||||
cond = generateFilterCond(opts, cond) | |||||
if opts.RepoID > 0 { | if opts.RepoID > 0 { | ||||
cond = cond.And(builder.Eq{"dataset.repo_id": opts.RepoID}) | cond = cond.And(builder.Eq{"dataset.repo_id": opts.RepoID}) | ||||
@@ -162,14 +149,12 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { | |||||
cond = cond.And(builder.Eq{"dataset.status": DatasetStatusPublic}) | cond = cond.And(builder.Eq{"dataset.status": DatasetStatusPublic}) | ||||
cond = cond.And(builder.Eq{"attachment.is_private": false}) | cond = cond.And(builder.Eq{"attachment.is_private": false}) | ||||
if opts.OwnerID > 0 { | if opts.OwnerID > 0 { | ||||
if len(opts.Keyword) == 0 { | |||||
cond = cond.Or(builder.Eq{"repository.owner_id": opts.OwnerID}) | |||||
} else { | |||||
subCon := builder.NewCond() | |||||
subCon = subCon.And(builder.Eq{"repository.owner_id": opts.OwnerID}, builder.Or(builder.Like{"dataset.title", opts.Keyword}, builder.Like{"dataset.description", opts.Keyword})) | |||||
cond = cond.Or(subCon) | |||||
} | |||||
subCon := builder.NewCond() | |||||
subCon = subCon.And(builder.Eq{"repository.owner_id": opts.OwnerID}) | |||||
subCon = generateFilterCond(opts, subCon) | |||||
cond = cond.Or(subCon) | |||||
} | } | ||||
} else if opts.OwnerID > 0 { | } else if opts.OwnerID > 0 { | ||||
cond = cond.And(builder.Eq{"repository.owner_id": opts.OwnerID}) | cond = cond.And(builder.Eq{"repository.owner_id": opts.OwnerID}) | ||||
@@ -182,6 +167,25 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { | |||||
return cond | return cond | ||||
} | } | ||||
func generateFilterCond(opts *SearchDatasetOptions, cond builder.Cond) builder.Cond { | |||||
if len(opts.Keyword) > 0 { | |||||
cond = cond.And(builder.Or(builder.Like{"dataset.title", opts.Keyword}, builder.Like{"dataset.description", opts.Keyword})) | |||||
} | |||||
if len(opts.Category) > 0 { | |||||
cond = cond.And(builder.Eq{"dataset.category": opts.Category}) | |||||
} | |||||
if len(opts.Task) > 0 { | |||||
cond = cond.And(builder.Eq{"dataset.task": opts.Task}) | |||||
} | |||||
if len(opts.License) > 0 { | |||||
cond = cond.And(builder.Eq{"dataset.license": opts.License}) | |||||
} | |||||
return cond | |||||
} | |||||
func SearchDatasetByCondition(opts *SearchDatasetOptions, cond builder.Cond) (DatasetList, int64, error) { | func SearchDatasetByCondition(opts *SearchDatasetOptions, cond builder.Cond) (DatasetList, int64, error) { | ||||
if opts.Page <= 0 { | if opts.Page <= 0 { | ||||
opts.Page = 1 | opts.Page = 1 | ||||
@@ -916,7 +916,9 @@ language_other = Other | |||||
datasets = Datasets | datasets = Datasets | ||||
datasets.desc = Enable Dataset | datasets.desc = Enable Dataset | ||||
cloudbrain_helper=Use GPU/NPU resources to open notebooks, model training tasks, etc. | cloudbrain_helper=Use GPU/NPU resources to open notebooks, model training tasks, etc. | ||||
cloudbrain.exitinfo=Exit Information | |||||
cloudbrain.platform=Platform | |||||
cloudbrain.endtime=End Time | |||||
model_manager = Model | model_manager = Model | ||||
model_noright=No right | model_noright=No right | ||||
model_rename=Duplicate model name, please modify model name. | model_rename=Duplicate model name, please modify model name. | ||||
@@ -963,7 +963,9 @@ cloudbrain_jobname_err=只能以小写字母或数字开头且只包含小写字 | |||||
cloudbrain_query_fail=查询云脑任务失败。 | cloudbrain_query_fail=查询云脑任务失败。 | ||||
cloudbrain.mirror_tag = 镜像标签 | cloudbrain.mirror_tag = 镜像标签 | ||||
cloudbrain.mirror_description = 镜像描述 | cloudbrain.mirror_description = 镜像描述 | ||||
cloudbrain.exitinfo=退出信息 | |||||
cloudbrain.platform=平台 | |||||
cloudbrain.endtime=结束时间 | |||||
record_begintime_get_err=无法获取统计开始时间。 | record_begintime_get_err=无法获取统计开始时间。 | ||||
parameter_is_wrong=输入参数错误,请检查输入参数。 | parameter_is_wrong=输入参数错误,请检查输入参数。 | ||||
total_count_get_error=查询总页数失败。 | total_count_get_error=查询总页数失败。 | ||||
@@ -2,11 +2,9 @@ package repo | |||||
import ( | import ( | ||||
"bufio" | "bufio" | ||||
"code.gitea.io/gitea/modules/timeutil" | |||||
"encoding/json" | "encoding/json" | ||||
"errors" | "errors" | ||||
"fmt" | "fmt" | ||||
"github.com/unknwon/i18n" | |||||
"io" | "io" | ||||
"net/http" | "net/http" | ||||
"os" | "os" | ||||
@@ -16,6 +14,9 @@ import ( | |||||
"strings" | "strings" | ||||
"time" | "time" | ||||
"code.gitea.io/gitea/modules/timeutil" | |||||
"github.com/unknwon/i18n" | |||||
"code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
"code.gitea.io/gitea/modules/auth" | "code.gitea.io/gitea/modules/auth" | ||||
"code.gitea.io/gitea/modules/base" | "code.gitea.io/gitea/modules/base" | ||||
@@ -531,6 +532,12 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo | |||||
} | } | ||||
} | } | ||||
attachment, err := models.GetAttachmentByUUID(task.Uuid) | |||||
if err == nil { | |||||
ctx.Data["datasetname"] = attachment.Name | |||||
} else { | |||||
ctx.Data["datasetname"] = "" | |||||
} | |||||
ctx.Data["task"] = task | ctx.Data["task"] = task | ||||
ctx.Data["jobName"] = task.JobName | ctx.Data["jobName"] = task.JobName | ||||
@@ -539,6 +546,9 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo | |||||
version_list_task = append(version_list_task, task) | version_list_task = append(version_list_task, task) | ||||
ctx.Data["version_list_task"] = version_list_task | ctx.Data["version_list_task"] = version_list_task | ||||
ctx.Data["debugListType"] = debugListType | ctx.Data["debugListType"] = debugListType | ||||
ctx.Data["code_path"] = cloudbrain.CodeMountPath | |||||
ctx.Data["dataset_path"] = cloudbrain.DataSetMountPath | |||||
ctx.Data["model_path"] = cloudbrain.ModelMountPath | |||||
ctx.Data["canDownload"] = cloudbrain.CanDeleteJob(ctx, task) | ctx.Data["canDownload"] = cloudbrain.CanDeleteJob(ctx, task) | ||||
ctx.HTML(200, tpName) | ctx.HTML(200, tpName) | ||||
} | } | ||||
@@ -247,7 +247,11 @@ func renderDirectory(ctx *context.Context, treeLink string) { | |||||
ctx.Data["ReadmeInList"] = true | ctx.Data["ReadmeInList"] = true | ||||
ctx.Data["ReadmeExist"] = true | ctx.Data["ReadmeExist"] = true | ||||
ctx.Data["FileIsSymlink"] = readmeFile.isSymlink | ctx.Data["FileIsSymlink"] = readmeFile.isSymlink | ||||
ctx.Data["ReadmeName"] = readmeFile.name | |||||
if ctx.Repo.TreePath == "" { | |||||
ctx.Data["ReadmeRelativePath"] = readmeFile.name | |||||
} else { | |||||
ctx.Data["ReadmeRelativePath"] = ctx.Repo.TreePath + "/" + readmeFile.name | |||||
} | |||||
if ctx.Repo.CanEnableEditor() { | if ctx.Repo.CanEnableEditor() { | ||||
ctx.Data["CanEditFile"] = true | ctx.Data["CanEditFile"] = true | ||||
@@ -579,11 +583,11 @@ func safeURL(address string) string { | |||||
} | } | ||||
type ContributorInfo struct { | type ContributorInfo struct { | ||||
UserInfo *models.User // nil for contributor who is not a registered user | |||||
RelAvatarLink string `json:"rel_avatar_link"` | |||||
UserName string `json:"user_name"` | |||||
Email string `json:"email"` | |||||
CommitCnt int `json:"commit_cnt"` | |||||
UserInfo *models.User // nil for contributor who is not a registered user | |||||
RelAvatarLink string `json:"rel_avatar_link"` | |||||
UserName string `json:"user_name"` | |||||
Email string `json:"email"` | |||||
CommitCnt int `json:"commit_cnt"` | |||||
} | } | ||||
type GetContributorsInfo struct { | type GetContributorsInfo struct { | ||||
@@ -642,7 +646,7 @@ func Home(ctx *context.Context) { | |||||
existedContributorInfo.CommitCnt += c.CommitCnt | existedContributorInfo.CommitCnt += c.CommitCnt | ||||
} else { | } else { | ||||
var newContributor = &ContributorInfo{ | var newContributor = &ContributorInfo{ | ||||
user, "", "",c.Email, c.CommitCnt, | |||||
user, "", "", c.Email, c.CommitCnt, | |||||
} | } | ||||
count++ | count++ | ||||
contributorInfos = append(contributorInfos, newContributor) | contributorInfos = append(contributorInfos, newContributor) | ||||
@@ -839,7 +843,7 @@ func renderCode(ctx *context.Context) { | |||||
compareInfo, err = baseGitRepo.GetCompareInfo(ctx.Repo.Repository.RepoPath(), ctx.Repo.BranchName, ctx.Repo.Repository.BaseRepo.DefaultBranch) | compareInfo, err = baseGitRepo.GetCompareInfo(ctx.Repo.Repository.RepoPath(), ctx.Repo.BranchName, ctx.Repo.Repository.BaseRepo.DefaultBranch) | ||||
ctx.Data["UpstreamSameBranchName"] = false | ctx.Data["UpstreamSameBranchName"] = false | ||||
} | } | ||||
if err==nil && compareInfo != nil { | |||||
if err == nil && compareInfo != nil { | |||||
if compareInfo.Commits != nil { | if compareInfo.Commits != nil { | ||||
log.Info("compareInfoCommits数量:%d", compareInfo.Commits.Len()) | log.Info("compareInfoCommits数量:%d", compareInfo.Commits.Len()) | ||||
ctx.Data["FetchUpstreamCnt"] = compareInfo.Commits.Len() | ctx.Data["FetchUpstreamCnt"] = compareInfo.Commits.Len() | ||||
@@ -950,7 +954,7 @@ func ContributorsAPI(ctx *context.Context) { | |||||
} else { | } else { | ||||
// new committer info | // new committer info | ||||
var newContributor = &ContributorInfo{ | var newContributor = &ContributorInfo{ | ||||
user, user.RelAvatarLink(),user.Name, user.Email,c.CommitCnt, | |||||
user, user.RelAvatarLink(), user.Name, user.Email, c.CommitCnt, | |||||
} | } | ||||
count++ | count++ | ||||
contributorInfos = append(contributorInfos, newContributor) | contributorInfos = append(contributorInfos, newContributor) | ||||
@@ -963,7 +967,7 @@ func ContributorsAPI(ctx *context.Context) { | |||||
existedContributorInfo.CommitCnt += c.CommitCnt | existedContributorInfo.CommitCnt += c.CommitCnt | ||||
} else { | } else { | ||||
var newContributor = &ContributorInfo{ | var newContributor = &ContributorInfo{ | ||||
user, "", "",c.Email,c.CommitCnt, | |||||
user, "", "", c.Email, c.CommitCnt, | |||||
} | } | ||||
count++ | count++ | ||||
contributorInfos = append(contributorInfos, newContributor) | contributorInfos = append(contributorInfos, newContributor) | ||||
@@ -281,7 +281,7 @@ td, th { | |||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
镜像 | |||||
{{.i18n.Tr "cloudbrain.mirror"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
@@ -292,7 +292,8 @@ td, th { | |||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
类型 | |||||
{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
@@ -313,7 +314,7 @@ td, th { | |||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
训练程序 | |||||
{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
@@ -324,7 +325,7 @@ td, th { | |||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
测试程序 | |||||
{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_test"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
@@ -360,7 +361,7 @@ td, th { | |||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
创建者 | |||||
{{$.i18n.Tr "repo.cloudbrain_creator"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
@@ -371,7 +372,7 @@ td, th { | |||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
子类型 | |||||
{{$.i18n.Tr "repo.cloudbrain.benchmark.evaluate_child_type"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
@@ -1,108 +1,501 @@ | |||||
{{template "base/head" .}} | {{template "base/head" .}} | ||||
<style> | |||||
.according-panel-heading{ | |||||
box-sizing: border-box; | |||||
padding: 8px 16px; | |||||
color: #252b3a; | |||||
background-color: #f2f5fc; | |||||
line-height: 1.5; | |||||
cursor: pointer; | |||||
-moz-user-select: none; | |||||
-webkit-user-select: none; | |||||
-ms-user-select: none; | |||||
-khtml-user-select: none; | |||||
user-select: none; | |||||
} | |||||
.accordion-panel-title { | |||||
margin-top: 0; | |||||
margin-bottom: 0; | |||||
color: #252b3a; | |||||
} | |||||
.accordion-panel-title-content{ | |||||
vertical-align: middle; | |||||
display: inline-block; | |||||
width: calc(100% - 32px); | |||||
cursor: default; | |||||
} | |||||
.acc-margin-bottom { | |||||
margin-bottom: 5px; | |||||
} | |||||
.title_text { | |||||
font-size: 12px; | |||||
} | |||||
.ac-display-inblock { | |||||
display: inline-block; | |||||
} | |||||
.cti-mgRight-sm { | |||||
margin-right: 8px; | |||||
} | |||||
.ac-text-normal { | |||||
font-size: 14px; | |||||
color: #575d6c; | |||||
} | |||||
.uc-accordionTitle-black { | |||||
color: #333; | |||||
} | |||||
.accordion-border{ | |||||
border:1px solid #cce2ff; | |||||
} | |||||
.padding0{ | |||||
padding: 0 !important; | |||||
} | |||||
.content-pad{ | |||||
padding: 15px 35px; | |||||
} | |||||
.content-margin{ | |||||
margin:10px 5px ; | |||||
} | |||||
.tab_2_content { | |||||
min-height: 560px; | |||||
margin-left: 10px; | |||||
} | |||||
.ac-grid { | |||||
display: block; | |||||
*zoom: 1; | |||||
} | |||||
.ac-grid-col { | |||||
float: left; | |||||
width: 100%; | |||||
} | |||||
.ac-grid-col2 .ac-grid-col { | |||||
width: 50%; | |||||
} | |||||
.ti-form { | |||||
text-align: left; | |||||
max-width: 100%; | |||||
vertical-align: middle; | |||||
} | |||||
.ti-form>tbody { | |||||
font-size: 12px; | |||||
} | |||||
.ti-form>tbody, .ti-form>tbody>tr { | |||||
vertical-align: inherit; | |||||
} | |||||
.info_text { | |||||
padding-bottom: 20px; | |||||
padding-right: 20px; | |||||
font-size: 12px; | |||||
} | |||||
.ti-text-form-label { | |||||
padding-bottom: 20px; | |||||
padding-right: 20px; | |||||
color: #8a8e99; | |||||
font-size: 12px; | |||||
white-space: nowrap !important; | |||||
width: 80px; | |||||
line-height: 30px; | |||||
} | |||||
.ti-text-form-content{ | |||||
line-height: 30px; | |||||
padding-bottom: 20px; | |||||
} | |||||
.ti-form>tbody>tr>td { | |||||
vertical-align: top; | |||||
white-space: normal; | |||||
} | |||||
td, th { | |||||
padding: 0; | |||||
} | |||||
.ac-grid-col .text-span { | |||||
width: 450px; | |||||
overflow: hidden; | |||||
text-overflow: ellipsis; | |||||
white-space: nowrap; | |||||
} | |||||
.redo-color{ | |||||
color: #3291F8; | |||||
} | |||||
.ti-action-menu-item:not(:last-child){ | |||||
margin-right: 10px; | |||||
padding-right: 11px; | |||||
text-decoration: none!important; | |||||
color: #526ecc; | |||||
cursor: pointer; | |||||
display: inline-block; | |||||
-moz-user-select: none; | |||||
-webkit-user-select: none; | |||||
-ms-user-select: none; | |||||
-khtml-user-select: none; | |||||
user-select: none; | |||||
position: relative; | |||||
} | |||||
.ti-action-menu-item:not(:last-child):after { | |||||
content: ""; | |||||
display: inline-block; | |||||
position: absolute; | |||||
height: 12px; | |||||
right: 0; | |||||
top: 50%; | |||||
-webkit-transform: translateY(-6px); | |||||
-ms-transform: translateY(-6px); | |||||
-o-transform: translateY(-6px); | |||||
transform: translateY(-6px); | |||||
border-right: 1px solid #dfe1e6; | |||||
} | |||||
.text-width80{ | |||||
width: 100px; | |||||
line-height: 30px; | |||||
} | |||||
.border-according{ | |||||
border: 1px solid #dfe1e6; | |||||
} | |||||
.disabled { | |||||
cursor: default; | |||||
pointer-events: none; | |||||
color: rgba(0,0,0,.6) !important; | |||||
opacity: .45 !important; | |||||
} | |||||
.pad20{ | |||||
border:0px !important; | |||||
} | |||||
.model_file_bread{ | |||||
margin-bottom: -0.5rem !important; | |||||
padding-left: 1rem; | |||||
padding-top: 0.5rem ; | |||||
} | |||||
</style> | |||||
<div id="mask"> | |||||
<div id="loadingPage"> | |||||
<div class="rect1"></div> | |||||
<div class="rect2"></div> | |||||
<div class="rect3"></div> | |||||
<div class="rect4"></div> | |||||
<div class="rect5"></div> | |||||
</div> | |||||
</div> | |||||
<div class="repository"> | <div class="repository"> | ||||
{{template "repo/header" .}} | {{template "repo/header" .}} | ||||
<div class="repository new repo ui middle very relaxed page grid"> | |||||
<div class="column"> | |||||
{{template "base/alert" .}} | |||||
<div class="ui container"> | |||||
<h4 class="ui header" id="vertical-segment"> | <h4 class="ui header" id="vertical-segment"> | ||||
<div class="ui breadcrumb"> | |||||
<a class="section" href="{{.RepoLink}}/debugjob?debugListType=all"> | |||||
{{.i18n.Tr "repo.cloudbrain"}} | |||||
</a> | |||||
<div class="divider"> / </div> | |||||
<a class="section backTodeBug" href="{{.RepoLink}}/debugjob?debugListType={{if eq $.debugListType "NPU"}}NPU{{else if eq $.debugListType "CPU/GPU"}}CPU/GPU{{else}}all{{end}}"> | |||||
{{$.i18n.Tr "repo.modelarts.notebook"}} | |||||
</a> | |||||
<div class="divider"> / </div> | |||||
{{with .task}} | |||||
<div class="active section">{{.DisplayJobName}}</div> | |||||
{{end}} | |||||
</div> | |||||
<div class="ui breadcrumb"> | |||||
<a class="section" href="{{.RepoLink}}/debugjob?debugListType=all"> | |||||
{{.i18n.Tr "repo.cloudbrain"}} | |||||
</a> | |||||
<div class="divider"> / </div> | |||||
<a class="section backTodeBug" href="{{.RepoLink}}/debugjob?debugListType={{if eq $.debugListType "NPU"}}NPU{{else if eq $.debugListType "CPU/GPU"}}CPU/GPU{{else}}all{{end}}"> | |||||
{{$.i18n.Tr "repo.modelarts.notebook"}} | |||||
</a> | |||||
<div class="divider"> / </div> | |||||
<div class="active section">{{.displayJobName}}</div> | |||||
</div> | |||||
</h4> | </h4> | ||||
<div> | |||||
<div class="ui yellow segment"> | |||||
{{with .task}} | |||||
<p>任务名称: {{.DisplayJobName}}</p> | |||||
{{end}} | |||||
</div> | |||||
<div class="ui green segment"> | |||||
<p>任务结果:</p> | |||||
{{with .taskRes}} | |||||
{{range .TaskStatuses}} | |||||
<table class="ui celled striped table"> | |||||
<tbody> | |||||
<tr> | |||||
<td class="four wide"> 状态 </td> | |||||
<td> {{.State}} </td> | |||||
</tr> | |||||
</tbody> | |||||
</table> | |||||
{{end}} | |||||
{{end}} | |||||
</div> | |||||
<div class="ui blue segment"> | |||||
{{with .result}} | |||||
<table class="ui celled striped table"> | |||||
<thead> | |||||
<tr> <th colspan="2"> 硬件信息 </th> </tr> | |||||
</thead> | |||||
<tbody> | |||||
<tr> | |||||
<td class="four wide"> CPU </td> | |||||
<td>{{.Resource.CPU}}</td> | |||||
</tr> | |||||
<tr> | |||||
<td> Memory </td> | |||||
<td>{{.Resource.Memory}}</td> | |||||
</tr> | |||||
<tr> | |||||
<td> NvidiaComGpu </td> | |||||
<td>{{.Resource.NvidiaComGpu}}</td> | |||||
</tr> | |||||
</tbody> | |||||
</table> | |||||
<table class="ui celled striped table"> | |||||
<thead> | |||||
<tr> <th colspan="2"> 调试信息 </th> </tr> | |||||
</thead> | |||||
<tbody> | |||||
<tr> | |||||
<td class="four wide"> 平台 </td> | |||||
<td> {{.Platform}} </td> | |||||
</tr> | |||||
<tr> | |||||
<td> 开始时间 </td> | |||||
{{if not (eq $.task.StartTime 0)}} | |||||
<td>{{TimeSinceUnix1 $.task.StartTime}}</td> | |||||
{{else}} | |||||
<td>无<td> | |||||
{{end}} | |||||
</tr> | |||||
<tr> | |||||
<td> 结束时间 </td> | |||||
{{if not (eq $.task.EndTime 0)}} | |||||
<td>{{TimeSinceUnix1 $.task.EndTime}}</td> | |||||
{{else}} | |||||
<td>无<td> | |||||
{{end}} | |||||
</tr> | |||||
<tr> | |||||
<td> ExitCode </td> | |||||
<td>{{.JobStatus.AppExitCode}}</td> | |||||
</tr> | |||||
<tr> | |||||
<td> 退出信息 </td> | |||||
<td>{{.JobStatus.AppExitDiagnostics | nl2br}}</td> | |||||
</tr> | |||||
</tbody> | |||||
</table> | |||||
{{end}} | |||||
</div> | |||||
{{range $k ,$v := .version_list_task}} | |||||
<div class="ui accordion border-according" id="accordion{{.VersionName}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}" data-version="{{.VersionName}}"> | |||||
<input type="hidden" id="jobId_input" name="jobId_input" value="{{.JobID}}"> | |||||
<div class="{{if eq $k 0}}active{{end}} title padding0"> | |||||
<div class="according-panel-heading"> | |||||
<div class="accordion-panel-title"> | |||||
<i class="dropdown icon"></i> | |||||
<span class="accordion-panel-title-content"> | |||||
<span> | |||||
<div class="ac-display-inblock title_text acc-margin-bottom"> | |||||
<span class="cti-mgRight-sm"> | |||||
{{if not (eq .StartTime 0)}} | |||||
<td>{{TimeSinceUnix1 .StartTime}}</td> | |||||
{{else}} | |||||
<td>{{TimeSinceUnix1 .CreatedUnix}}<td> | |||||
{{end}} | |||||
</span> | |||||
<span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}: | |||||
<span id="{{.VersionName}}-status-span"><i id="icon" style="vertical-align: middle;" class="{{.Status}}"></i><span id="text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span> | |||||
</span> | |||||
<span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span> | |||||
<span class="cti-mgRight-sm uc-accordionTitle-black" id="{{.VersionName}}-duration-span">{{$.duration}}</span> | |||||
</div> | |||||
</span> | |||||
</span> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="{{if eq $k 0}}active{{end}} content"> | |||||
<div class="content-pad"> | |||||
<div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);"> | |||||
<a class="active item" data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> | |||||
</div> | |||||
<div class="ui tab active" data-tab="first{{$k}}"> | |||||
<div style="padding-top: 10px;"> | |||||
<div class="tab_2_content"> | |||||
<div class="ac-grid ac-grid-col2"> | |||||
<div class="ac-grid-col"> | |||||
<table class="ti-form"> | |||||
<tbody class="ti-text-form"> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.cloudbrain_task"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w"> | |||||
{{.DisplayJobName}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.status"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-status"> | |||||
{{.Status}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.train_job.start_time"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w"> | |||||
<span style="font-size: 12px;" class=""> | |||||
{{if not (eq .StartTime 0)}} | |||||
{{TimeSinceUnix1 .StartTime}} | |||||
{{else}} | |||||
{{TimeSinceUnix1 .CreatedUnix}} | |||||
{{end}} | |||||
</span> | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-duration"> | |||||
{{$.duration}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.mirror"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||||
{{.Image}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.dataset_storage_path"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="dataset_storage_path"> | |||||
{{$.dataset_path}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.code_storage_path"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="code_storage_path"> | |||||
{{$.code_path}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
</tbody> | |||||
</table> | |||||
</div> | |||||
<div class="ac-grid-col"> | |||||
<table class="ti-form"> | |||||
<tbody class="ti-text-form"> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.cloudbrain.platform"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w"> | |||||
{{$.result.Platform}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
ExitCode | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w"> | |||||
{{$.result.JobStatus.AppExitCode}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.cloudbrain.endtime"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName"> | |||||
{{if not (eq .StartTime 0)}} | |||||
{{TimeSinceUnix1 .EndTime}} | |||||
{{else}} | |||||
-- | |||||
{{end}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.train_job.dataset"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName"> | |||||
{{$.datasetname}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.train_job.standard"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w"> | |||||
{{$.resource_spec}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.cloudbrain_creator"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||||
{{.User.Name}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.model_storage_path"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="model_storage_path"> | |||||
{{$.model_path}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
</tbody> | |||||
</table> | |||||
</div> | |||||
</div> | |||||
<div class="ac-grid ac-grid-col2"> | |||||
<div class="ac-grid-col"> | |||||
<span class="ti-text-form-label">{{$.i18n.Tr "repo.cloudbrain.exitinfo"}}</span> | |||||
</div> | |||||
</div> | |||||
<div class="ac-grid-col"> | |||||
<span class="info_text"> | |||||
{{$.result.JobStatus.AppExitDiagnostics}} | |||||
</span> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
{{end}} {{template "base/paginate" .}} | |||||
</div> | |||||
<!-- 确认模态框 --> | |||||
<div id="deletemodel"> | |||||
<div class="ui basic modal"> | |||||
<div class="ui icon header"> | |||||
<i class="trash icon"></i> {{.i18n.Tr "cloudbrain.delete_task"}} | |||||
</div> | |||||
<div class="content"> | |||||
<p>{{.i18n.Tr "cloudbrain.task_delete_confirm"}}</p> | |||||
</div> | |||||
<div class="actions"> | |||||
<div class="ui red basic inverted cancel button"> | |||||
<i class="remove icon"></i> {{.i18n.Tr "cloudbrain.operate_cancel"}} | |||||
</div> | |||||
<div class="ui green basic inverted ok button"> | |||||
<i class="checkmark icon"></i> {{.i18n.Tr "cloudbrain.operate_confirm"}} | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | |||||
</div> | </div> | ||||
{{template "base/footer" .}} | {{template "base/footer" .}} | ||||
<script> | |||||
$('.menu .item').tab() | |||||
$(document).ready(function(){ | |||||
$('.ui.accordion').accordion({selector:{trigger:'.icon'}}); | |||||
}); | |||||
$(document).ready(function(){ | |||||
$('.secondary.menu .item').tab(); | |||||
}); | |||||
let userName | |||||
let repoPath | |||||
let jobName | |||||
$(document).ready(function(){ | |||||
let url = window.location.href; | |||||
let urlArr = url.split('/') | |||||
userName = urlArr.slice(-5)[0] | |||||
repoPath = urlArr.slice(-4)[0] | |||||
jobName = urlArr.slice(-1)[0] | |||||
}) | |||||
function loadLog(version_name){ | |||||
document.getElementById("mask").style.display = "block" | |||||
$.get(`/api/v1/repos/${userName}/${repoPath}/cloudbrain/${jobName}/log?version_name=${version_name}&lines=50&order=asc`, (data) => { | |||||
$('input[name=end_line]').val(data.EndLine) | |||||
$('input[name=start_line]').val(data.StartLine) | |||||
$(`#log_file${version_name}`).text(data.Content) | |||||
document.getElementById("mask").style.display = "none" | |||||
}).fail(function(err) { | |||||
console.log(err); | |||||
document.getElementById("mask").style.display = "none" | |||||
}); | |||||
} | |||||
</script> |
@@ -40,7 +40,7 @@ | |||||
<div class="ui right file-actions"> | <div class="ui right file-actions"> | ||||
{{if .Repository.CanEnableEditor}} | {{if .Repository.CanEnableEditor}} | ||||
{{if .CanEditFile}} | {{if .CanEditFile}} | ||||
<a href="{{.RepoLink}}/_edit/{{EscapePound .BranchName}}/{{EscapePound .ReadmeName}}"><span class="btn-octicon poping up" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted">{{svg "octicon-pencil" 16}}</span></a> | |||||
<a href="{{.RepoLink}}/_edit/{{EscapePound .BranchName}}/{{EscapePound .ReadmeRelativePath}}"><span class="btn-octicon poping up" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted">{{svg "octicon-pencil" 16}}</span></a> | |||||
{{else}} | {{else}} | ||||
<span class="btn-octicon poping up disabled" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted">{{svg "octicon-pencil" 16}}</span> | <span class="btn-octicon poping up disabled" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted">{{svg "octicon-pencil" 16}}</span> | ||||
{{end}} | {{end}} | ||||
@@ -48,7 +48,7 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
{{end}} | {{end}} | ||||
{{if not .ReadmeInList}} | {{if not .ReadmeInList}} | ||||
<div class="file-header-right"> | <div class="file-header-right"> | ||||
<div class="ui right file-actions"> | <div class="ui right file-actions"> | ||||