Browse Source

add train-job

tags/v1.21.12.1
Gitea 4 years ago
parent
commit
6bf0917b61
3 changed files with 133 additions and 10 deletions
  1. +1
    -0
      options/locale/locale_zh-CN.ini
  2. +9
    -10
      templates/repo/modelarts/notebook/index.tmpl
  3. +123
    -0
      templates/repo/modelarts/trainjob/index.tmpl

+ 1
- 0
options/locale/locale_zh-CN.ini View File

@@ -762,6 +762,7 @@ cloudbrain_selection=云脑选择
cloudbrain_platform_selection=选择您准备使用的云脑平台:
confirm_choice=确定

modelarts.nodebook=云脑作业
modelarts.train_job=训练作业
modelarts.train_job.new=新建作业
modelarts.train_job.job_name=作业名称


+ 9
- 10
templates/repo/modelarts/notebook/index.tmpl View File

@@ -213,17 +213,11 @@
<div class="computer three wide computer column">
<div class="ui grid">
<div class="sixteen wide column ui secondary sticky pointing tabular vertical menu">
<a class="{{if .PageIsExploreRepositories}}active{{end}} item" href="{{AppSubUrl}}/explore/repos">
{{svg "octicon-repo" 16}} {{.i18n.Tr "explore.repos"}}
<a class="item" href="{{.RepoLink}}/modelarts/notebook">
{{svg "octicon-repo" 16}} {{.i18n.Tr "repo.modelarts.nodebook"}}
</a>
<a class="{{if .PageIsDatasets}}active{{end}} item" href="{{AppSubUrl}}/explore/datasets">
{{svg "octicon-inbox" 16}} {{.i18n.Tr "datasets"}}
</a>
<a class="{{if .PageIsExploreUsers}}active{{end}} item" href="{{AppSubUrl}}/explore/users">
{{svg "octicon-person" 16}} {{.i18n.Tr "explore.users"}}
</a>
<a class="{{if .PageIsExploreOrganizations}}active{{end}} item" href="{{AppSubUrl}}/explore/organizations">
{{svg "octicon-organization" 16}} {{.i18n.Tr "explore.organizations"}}
<a class="item" href="{{.RepoLink}}/modelarts/train-job">
{{svg "octicon-inbox" 16}} {{.i18n.Tr "repo.modelarts.train_job"}}
</a>
</div>
</div>
@@ -508,4 +502,9 @@
}
})
}

// 超链接
$("a").click(function(){
$(this).toggleClass("active")
})
</script>

+ 123
- 0
templates/repo/modelarts/trainjob/index.tmpl View File

@@ -0,0 +1,123 @@
{{template "base/head" .}}
<div class="repository view">
{{template "repo/header" .}}
<style>
.ui.segment.bottom.attached {
border: none;
}
.ui.secondary.vertical.pointing.menu{
border-right-width: 0;
margin-right: 0;
border-right-color: white;
margin-top: 14px;
}
</style>
<div class="modelarts train_job container">
<div class="ui container">
<div class="ui grid">
<div class="three wide column">
<div class="ui grid">
<div class="sixteen wide column ui secondary sticky pointing tabular vertical menu">
<a class="item" href="{{.RepoLink}}/modelarts/notebook">
{{svg "octicon-repo" 16}} {{.i18n.Tr "repo.modelarts.nodebook"}}
</a>
<a class="item" href="{{.RepoLink}}/modelarts/train-job">
{{svg "octicon-inbox" 16}} {{.i18n.Tr "repo.modelarts.train_job"}}
</a>
</div>
</div>
</div>
<!-- 右侧 -->
<div class="ui thirteen wide column">
<div class="ui three column stackable grid">
<div class="column">
<h2>{{.i18n.Tr "repo.modelarts.train_job"}}</h2>
</div>
<div class="column">
</div>
<div class="column right aligned">
<a class="ui green button" href="{{.RepoLink}}/modelarts/train-job/create">{{.i18n.Tr "repo.modelarts.train_job.new"}}</a>
</div>
</div>
<div class="ui divider"></div>
<div class="ui thirteen wide column">
<div class="ui thirteen wide column">
<div class="ui two column stackable grid">
<div class="column">
</div>
<div class="column right aligned">
<div class="ui right dropdown type jump item">
<span class="text">
{{.i18n.Tr "repo.issues.filter_sort"}}<i class="dropdown icon"></i>
</span>
</div>
</div>
</div>
</div>
<!-- 任务展示 -->
<div class="train_job list">
{{range .Tasks}}
<div class="ui grid stackable item">
<div class="row">
<!-- 任务名 -->
<div class="four wide column">
<a class="title" href="{{$.Link}}/{{.JobID}}">
<span class="fitted">{{svg "octicon-tasklist" 16}}</span>
<span class="fitted">{{.JobName}}</span>
</a>
</div>
<!--任务状态 -->
<div class="two wide column job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}">
{{.Status}}
</div>
<!-- 任务创建时间 -->
<div class="three wide column">
<span class="ui text center">{{svg "octicon-flame" 16}} {{TimeSinceUnix .CreatedUnix $.Lang}}</span>
</div>
<!-- 查看 -->
<div class="one wide column">
<span class="ui text center clipboard">
<a class="title" href="{{$.Link}}/{{.JobID}}">
<span class="fitted">查看</span>
</a>
</span>
</div>
<!-- 删除 -->
<div class="two wide column">
<div class="ui text center clipboard">
<form id="delForm-{{.JobID}}" action="{{if ne .Status "STOPPED"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/del{{end}}" method="post">
{{$.CsrfTokenHtml}}
<a class="fitted" onclick="assertDelete(this)" style="{{if ne .Status "STOPPED"}}color:#CCCCCC{{end}}; font-size:16px; font-weight:bold">删除</a>
</form>
</div>
</div>
<!-- 停止 -->
<div class="two wide column">
<div class="ui text center clipboard">
<form id="stopForm-{{.JobID}}" action="{{if ne .Status "RUNNING"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/stop{{end}}" method="post">
{{$.CsrfTokenHtml}}
<a class="fitted" onclick="document.getElementById('stopForm-{{.JobID}}').submit();" style="{{if ne .Status "RUNNING"}}color:#CCCCCC{{end}}; font-size:16px; font-weight:bold">停止</a>
</form>
</div>
</div>
</div>
</div>
{{end}} {{template "base/paginate" .}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{{template "base/footer" .}}

Loading…
Cancel
Save