Browse Source

Merge branch 'liuzx_trainjob' of https://git.openi.org.cn/OpenI/aiforge into liuzx_trainjob

update
tags/v1.21.12.1
liuzx 4 years ago
parent
commit
5e40f38409
6 changed files with 118 additions and 62 deletions
  1. +2
    -0
      modules/templates/helper.go
  2. +5
    -0
      modules/timeutil/since.go
  3. +5
    -1
      options/locale/locale_en-US.ini
  4. +7
    -1
      options/locale/locale_zh-CN.ini
  5. +77
    -55
      templates/repo/modelarts/trainjob/show.tmpl
  6. +22
    -5
      templates/repo/modelarts/trainjob/version_new.tmpl

+ 2
- 0
modules/templates/helper.go View File

@@ -92,6 +92,7 @@ func NewFuncMap() []template.FuncMap {
"Str2html": Str2html, "Str2html": Str2html,
"TimeSince": timeutil.TimeSince, "TimeSince": timeutil.TimeSince,
"TimeSinceUnix": timeutil.TimeSinceUnix, "TimeSinceUnix": timeutil.TimeSinceUnix,
"TimeSinceUnix1": timeutil.TimeSinceUnix1,
"RawTimeSince": timeutil.RawTimeSince, "RawTimeSince": timeutil.RawTimeSince,
"FileSize": base.FileSize, "FileSize": base.FileSize,
"PrettyNumber": base.PrettyNumber, "PrettyNumber": base.PrettyNumber,
@@ -340,6 +341,7 @@ func NewTextFuncMap() []texttmpl.FuncMap {
}, },
"TimeSince": timeutil.TimeSince, "TimeSince": timeutil.TimeSince,
"TimeSinceUnix": timeutil.TimeSinceUnix, "TimeSinceUnix": timeutil.TimeSinceUnix,
"TimeSinceUnix1": timeutil.TimeSinceUnix1,
"RawTimeSince": timeutil.RawTimeSince, "RawTimeSince": timeutil.RawTimeSince,
"DateFmtLong": func(t time.Time) string { "DateFmtLong": func(t time.Time) string {
return t.Format(time.RFC1123Z) return t.Format(time.RFC1123Z)


+ 5
- 0
modules/timeutil/since.go View File

@@ -162,3 +162,8 @@ func htmlTimeSinceUnix(then, now TimeStamp, lang string) template.HTML {
then.FormatInLocation(GetTimeFormat(lang), setting.DefaultUILocation), then.FormatInLocation(GetTimeFormat(lang), setting.DefaultUILocation),
timeSinceUnix(int64(then), int64(now), lang))) timeSinceUnix(int64(then), int64(now), lang)))
} }
func TimeSinceUnix1(then TimeStamp) string {
format := time.Unix(int64(then), 0).Format("2006-01-02 15:04:05")
return format
}

+ 5
- 1
options/locale/locale_en-US.ini View File

@@ -823,7 +823,11 @@ modelarts.train_job.new_train=New Train Task
modelarts.train_job.config=Configuration information modelarts.train_job.config=Configuration information
modelarts.train_job.new=New train Task modelarts.train_job.new=New train Task
modelarts.train_job.new_place=The description should not exceed 256 characters modelarts.train_job.new_place=The description should not exceed 256 characters

modelarts.modify=Modify
modelarts.current_version=Current version
modelarts.parent_version=Parent Version
modelarts.run_version=Run Version
modelarts.train_job.compute_node=Compute Node




modelarts.train_job.basic_info=Basic Info modelarts.train_job.basic_info=Basic Info


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

@@ -828,6 +828,10 @@ modelarts.train_job.new_train=新建训练任务
modelarts.train_job.config=配置信息 modelarts.train_job.config=配置信息
modelarts.train_job.new=新建训练任务 modelarts.train_job.new=新建训练任务
modelarts.train_job.new_place=描述字数不超过256个字符 modelarts.train_job.new_place=描述字数不超过256个字符
modelarts.modify=修改
modelarts.current_version=当前版本
modelarts.parent_version=父版本
modelarts.run_version=运行版本






@@ -847,11 +851,13 @@ modelarts.train_job.frames=常用框架
modelarts.train_job.algorithm_origin=算法来源 modelarts.train_job.algorithm_origin=算法来源
modelarts.train_job.AI_driver=AI引擎 modelarts.train_job.AI_driver=AI引擎
modelarts.train_job.start_file=启动文件 modelarts.train_job.start_file=启动文件
modelarts.train_job.boot_file_helper=启动文件是您程序执行的入口文件,必须是以.py结尾的文件。
modelarts.train_job.boot_file_helper=启动文件是您程序执行的入口文件,必须是以.py结尾的文件。比如train.py、main.py、example/train.py、case/main.py。
modelarts.train_job.boot_file_place=填写启动文件路径,默认为train.py modelarts.train_job.boot_file_place=填写启动文件路径,默认为train.py
modelarts.train_job.dataset=数据集 modelarts.train_job.dataset=数据集
modelarts.code_version=代码分支 modelarts.code_version=代码分支
modelarts.parents_version=基于版本 modelarts.parents_version=基于版本
modelarts.train_job.compute_node=计算节点
modelarts.train_job.train_dataset=训练数据集


modelarts.train_job.run_parameter=运行参数 modelarts.train_job.run_parameter=运行参数
modelarts.train_job.add_run_parameter=增加运行参数 modelarts.train_job.add_run_parameter=增加运行参数


+ 77
- 55
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -174,7 +174,7 @@ td, th {
{{$.i18n.Tr "repo.modelarts.train_job"}} {{$.i18n.Tr "repo.modelarts.train_job"}}
</a> </a>
<div class="divider"> / </div> <div class="divider"> / </div>
<div class="active section"></div>
<div class="active section">{{.jobName}}</div>
</div> </div>
</h4> </h4>
{{range $k ,$v := .version_list_task}} {{range $k ,$v := .version_list_task}}
@@ -186,21 +186,36 @@ td, th {
<span class="accordion-panel-title-content"> <span class="accordion-panel-title-content">
<span> <span>
<div style="float: right;"> <div style="float: right;">
<a class="ti-action-menu-item {{if ne .Status "COMPLETED"}}disabled {{end}}">创建模型</a>
<a class="ti-action-menu-item" href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/create_version?version_name={{.VersionName}}">修改</a>
<a class="ti-action-menu-item {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED"}}disabled {{end}}" id="{{.VersionName}}-stop" onclick="stopVersion({{.VersionName}})">停止</a>
<a class="ti-action-menu-item " href="{{$.Link}}/models?version_name={{.VersionName}}" target="_blank">模型下载</a>
<a class="ti-action-menu-item" onclick="deleteVersion({{.VersionName}})" style="color: #FF4D4F;">删除</a>
<!-- <a class="ti-action-menu-item {{if ne .Status "COMPLETED"}}disabled {{end}}">创建模型</a> -->
{{$.CsrfTokenHtml}}
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}}
<a class="ti-action-menu-item" href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/create_version?version_name={{.VersionName}}">{{$.i18n.Tr "repo.modelarts.modify"}}</a>
{{else}}
<a class="ti-action-menu-item disabled" href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/create_version?version_name={{.VersionName}}">{{$.i18n.Tr "repo.modelarts.modify"}}</a>
{{end}}
{{$.CsrfTokenHtml}}
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}}
<a class="ti-action-menu-item {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED"}}disabled {{end}}" id="{{.VersionName}}-stop" onclick="stopVersion({{.VersionName}})">{{$.i18n.Tr "repo.stop"}}</a>
{{else}}
<a class="ti-action-menu-item disabled" id="{{.VersionName}}-stop" onclick="stopVersion({{.VersionName}})">{{$.i18n.Tr "repo.stop"}}</a>
{{end}}
{{$.CsrfTokenHtml}}
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}}
<a class="ti-action-menu-item" onclick="deleteVersion({{.VersionName}})" style="color: #FF4D4F;">{{$.i18n.Tr "repo.delete"}}</a>
{{else}}
<a class="ti-action-menu-item disabled" onclick="deleteVersion({{.VersionName}})" style="color: #FF4D4F;">{{$.i18n.Tr "repo.delete"}}</a>
{{end}}
</div> </div>
<div class="ac-display-inblock title_text acc-margin-bottom"> <div class="ac-display-inblock title_text acc-margin-bottom">
<span class="cti-mgRight-sm">{{.Cloudbrain.CreatedUnix}}</span>
<span class="cti-mgRight-sm"> 当前版本:{{.VersionName}}</span>
<span class="cti-mgRight-sm"> 父版本:{{.PreVersionName}}</span>
<span class="cti-mgRight-sm ac-text-normal title_text">状态:
<span class="cti-mgRight-sm">{{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}</span>
<span class="cti-mgRight-sm"> {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}}</span>
<span class="cti-mgRight-sm"> {{$.i18n.Tr "repo.modelarts.parent_version"}}:{{.PreVersionName}}</span>
<span class="cti-mgRight-sm ac-text-normal title_text">{{$.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 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>
<span class="ac-text-normal title_text">运行时间:</span>
<span class="ac-text-normal title_text">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span>
<span class="cti-mgRight-sm uc-accordionTitle-black" id="{{.VersionName}}-duration-span">{{.TrainJobDuration}}</span> <span class="cti-mgRight-sm uc-accordionTitle-black" id="{{.VersionName}}-duration-span">{{.TrainJobDuration}}</span>
<span data-tooltip="刷新" style="cursor: pointer;" data-inverted="" onclick="refreshStatus({{.VersionName}})"><i class="redo icon redo-color"></i></span> <span data-tooltip="刷新" style="cursor: pointer;" data-inverted="" onclick="refreshStatus({{.VersionName}})"><i class="redo icon redo-color"></i></span>


@@ -214,9 +229,9 @@ td, th {
<div class="content-pad"> <div class="content-pad">
<div class="ui pointing secondary menu"> <div class="ui pointing secondary menu">
<a class="active item" data-tab="first{{$k}}">配置信息</a>
<a class="item" data-tab="second{{$k}}" onclick="loadLog({{.VersionName}})">日志文件</a>
<a class="item" data-tab="third{{$k}}" onclick="loadModelFile({{.VersionName}},'','','init')">模型下载</a>
<a class="active item" data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
<a class="item" data-tab="second{{$k}}" onclick="loadLog({{.VersionName}})">{{$.i18n.Tr "repo.modelarts.log"}}</a>
<a class="item" data-tab="third{{$k}}" onclick="loadModelFile({{.VersionName}},'','','init')">{{$.i18n.Tr "repo.model_download"}}</a>
</div> </div>
<div class="ui tab active" data-tab="first{{$k}}"> <div class="ui tab active" data-tab="first{{$k}}">
<div style="padding-top: 10px;"> <div style="padding-top: 10px;">
@@ -227,7 +242,7 @@ td, th {
<tbody class="ti-text-form"> <tbody class="ti-text-form">
<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_task"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -238,7 +253,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.modelarts.status"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -249,7 +264,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.modelarts.run_version"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -260,18 +275,18 @@ 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.modelarts.train_job.start_time"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
<div class="text-span text-span-w"> <div class="text-span text-span-w">
<span style="font-size: 12px;" class="">{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}</span>
<span style="font-size: 12px;" class="">{{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}</span>
</div> </div>
</td> </td>
</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.modelarts.train_job.dura_time"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -282,7 +297,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.modelarts.train_job.standard"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -293,7 +308,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.modelarts.train_job.compute_node"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -310,7 +325,7 @@ td, th {
<tbody class="ti-text-form"> <tbody class="ti-text-form">
<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">
AI引擎
{{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -332,7 +347,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.modelarts.train_job.start_file"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -343,7 +358,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.modelarts.train_job.train_dataset"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -354,7 +369,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.modelarts.train_job.run_parameter"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -363,7 +378,7 @@ td, th {
</div> </div>
</td> </td>
</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">
训练输出位置 训练输出位置
</td> </td>
@@ -373,15 +388,15 @@ td, th {
{{.TrainUrl}} {{.TrainUrl}}
</div> </div>
</td> </td>
</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.modelarts.train_job.description"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
<div class="text-span text-span-w"> <div class="text-span text-span-w">
<!-- {{.TrainUrl}} -->
{{.Cloudbrain.Description}}
</div> </div>
</td> </td>
</tr> </tr>
@@ -460,7 +475,7 @@ td, th {
{{template "base/footer" .}} {{template "base/footer" .}}


<script> <script>
console.log({{.version_list_task}})
$('.menu .item').tab() $('.menu .item').tab()
// $('.ui.style.accordion').accordion(); // $('.ui.style.accordion').accordion();


@@ -471,12 +486,12 @@ td, th {
$('.secondary.menu .item').tab(); $('.secondary.menu .item').tab();
}); });
var userName
var repoPath
var jobID
let userName
let repoPath
let jobID
$(document).ready(function(){ $(document).ready(function(){
var url = window.location.href;
var urlArr = url.split('/')
let url = window.location.href;
let urlArr = url.split('/')
userName = urlArr.slice(-5)[0] userName = urlArr.slice(-5)[0]
repoPath = urlArr.slice(-4)[0] repoPath = urlArr.slice(-4)[0]
jobID = urlArr.slice(-1)[0] jobID = urlArr.slice(-1)[0]
@@ -489,11 +504,23 @@ td, th {
e.cancelBubble = true; //ie兼容 e.cancelBubble = true; //ie兼容
} }
} }
// var timeid = window.setInterval(refreshStatus(version_name), 30000);
// let timeid = window.setInterval(refreshStatus(version_name), 30000);
// document.ready(refreshStatus(version_name)) // document.ready(refreshStatus(version_name))
var timeid = window.setInterval(loadJobStatus, 30000);
let timeid = window.setInterval(loadJobStatus, 30000);
$(document).ready(loadJobStatus); $(document).ready(loadJobStatus);

function renderSize(value){
if(null==value||value==''){
return "0 Bytes";
}
var unitArr = new Array("Bytes","KB","MB","GB","TB","PB","EB","ZB","YB");
var index=0;
var srcsize = parseFloat(value);
index=Math.floor(Math.log(srcsize)/Math.log(1024));
var size =srcsize/Math.pow(1024,index);
size=size.toFixed(2);//保留的小数位数
return size+unitArr[index];
}
function loadJobStatus() { function loadJobStatus() {
$(".ui.accordion.border-according").each((index, job) => { $(".ui.accordion.border-according").each((index, job) => {
@@ -505,23 +532,17 @@ td, th {
|| job.textContent.trim() == 'CANCELED' || job.textContent.trim() == 'LOST') { || job.textContent.trim() == 'CANCELED' || job.textContent.trim() == 'LOST') {
return return
} }
let stopArray=["KILLED","FAILED","START_FAILED","KILLING","COMPLETED"]
$.get(`/api/v1/repos/${repoPath}/modelarts/train-job/${jobID}?version_name=${versionname}`, (data) => { $.get(`/api/v1/repos/${repoPath}/modelarts/train-job/${jobID}?version_name=${versionname}`, (data) => {
// const jobID = data.JobID
// const status = data.JobStatus
// const duration = data.JobDuration
$(`#${versionname}-duration-span`).text(data.JobDuration) $(`#${versionname}-duration-span`).text(data.JobDuration)
$(`#${versionname}-status-span span`).text(data.JobStatus) $(`#${versionname}-status-span span`).text(data.JobStatus)
$(`#${versionname}-status-span i`).attr("class",data.JobStatus) $(`#${versionname}-status-span i`).attr("class",data.JobStatus)
// detail status and duration // detail status and duration
$('#'+versionname+'-duration').text(data.JobDuration) $('#'+versionname+'-duration').text(data.JobDuration)
$('#'+versionname+'-status').text(data.JobStatus) $('#'+versionname+'-status').text(data.JobStatus)
// $('#duration-'+jobID).text(duration)
// if (status != job.textContent.trim()) {
// $('#' + jobID+'-icon').removeClass().addClass(status)
// $('#' + jobID+ '-text').text(status)

// }
if(stopArray.includes(data.JobStatus)){
$('#'+versionname+'-stop').addClass('disabled')
}
}).fail(function(err) { }).fail(function(err) {
console.log(err); console.log(err);
}); });
@@ -648,6 +669,7 @@ td, th {
html += '<tbody>' html += '<tbody>'
// html += "</tbody>" // html += "</tbody>"
for(let i=0;i<data.Dirs.length;i++){ for(let i=0;i<data.Dirs.length;i++){
let dirs_size = renderSize(data.Dirs[i].Size)
html += "<tr>" html += "<tr>"
html += "<td class='name six wid'>" html += "<td class='name six wid'>"
html += "<span class='truncate'>" html += "<span class='truncate'>"
@@ -664,7 +686,7 @@ td, th {
html += "</span>" html += "</span>"
html += "</td>" html += "</td>"
html += "<td class='message seven wide'>" html += "<td class='message seven wide'>"
html += "<span class='truncate has-emoji'>" + data.Dirs[i].Size + "</span>"
html += "<span class='truncate has-emoji'>"+ `${dirs_size}` + "</span>"
html += "</td>" html += "</td>"


html += "<td class='text right age three wide'>" html += "<td class='text right age three wide'>"
@@ -683,13 +705,13 @@ td, th {
} }
// $(`.log{}`).scroll() // $(`.log{}`).scroll()
function logScroll(version_name) { function logScroll(version_name) {
var scrollTop = $(`#log${version_name}`)[0].scrollTop; // 滚动距离
var scrollHeight = $(`#log${version_name}`)[0].scrollHeight; // 文档高度
var divHeight = $(`#log${version_name}`).height(); // 可视区高度
let scrollTop = $(`#log${version_name}`)[0].scrollTop; // 滚动距离
let scrollHeight = $(`#log${version_name}`)[0].scrollHeight; // 文档高度
let divHeight = $(`#log${version_name}`).height(); // 可视区高度
// let version_name=$(this).find('input[name=version_name]').val() // let version_name=$(this).find('input[name=version_name]').val()
console.log("scrollTo,scrollHeight,divHeight",scrollTop,scrollHeight,divHeight) console.log("scrollTo,scrollHeight,divHeight",scrollTop,scrollHeight,divHeight)
if(parseInt(scrollTop) + divHeight + 18 == scrollHeight){ if(parseInt(scrollTop) + divHeight + 18 == scrollHeight){
var end_line = $(`#log${version_name} input[name=end_line]`).val()
let end_line = $(`#log${version_name} input[name=end_line]`).val()
$.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=${end_line}&order=desc`, (data) => { $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=${end_line}&order=desc`, (data) => {
if (data.Lines == 0){ if (data.Lines == 0){
$(`.message${version_name} #header`).text('您已翻阅至日志底部') $(`.message${version_name} #header`).text('您已翻阅至日志底部')
@@ -706,7 +728,7 @@ td, th {
}); });
} }
if(scrollTop == 0){ if(scrollTop == 0){
var start_line = $(`#log${version_name} input[name=start_line]`).val()
let start_line = $(`#log${version_name} input[name=start_line]`).val()
$.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=${start_line}&order=asc`, (data) => { $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=${start_line}&order=asc`, (data) => {
if (data.Lines == 0){ if (data.Lines == 0){
$(`.message${version_name} #header`).text('您已翻阅至日志顶部') $(`.message${version_name} #header`).text('您已翻阅至日志顶部')


+ 22
- 5
templates/repo/modelarts/trainjob/version_new.tmpl View File

@@ -170,9 +170,10 @@
<input id="parents_version" style="width: 60%;" value="" tabindex="3" disabled > <input id="parents_version" style="width: 60%;" value="" tabindex="3" disabled >
</div> </div>
<div class="unite min_title inline field"> <div class="unite min_title inline field">
<label for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}&nbsp;&nbsp;</label> <label for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}&nbsp;&nbsp;</label>
<textarea style="width: 80%;" id="description" value="{{.description}}" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 256)"></textarea>
<textarea style="width: 80%;" id="description" value="{{.description}}" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 256)">{{.description}}</textarea>
</div> </div>
<div class="ui divider"></div> <div class="ui divider"></div>


@@ -408,7 +409,6 @@
}) })
}); });
console.log(parameters)
$('.ui.parameter.modal') $('.ui.parameter.modal')
.modal('hide'); .modal('hide');
for(var i = 2; i < parameters.length; i++){ for(var i = 2; i < parameters.length; i++){
@@ -516,7 +516,16 @@
prompt : '计算节点需要在1-25之间,请您键入正确的值' prompt : '计算节点需要在1-25之间,请您键入正确的值'
} }
] ]
}
},
run_para_list:{
identifier : 'run_para_list',
rules: [
{
type: 'maxLength[256]',
prompt : '所有字符最长不超过256个字符。'
}
]
},
}, },
}) })


@@ -564,7 +573,16 @@
prompt : '计算节点需要在1-25之间,请您键入正确的值' prompt : '计算节点需要在1-25之间,请您键入正确的值'
} }
] ]
}
},
run_para_list:{
identifier : 'run_para_list',
rules: [
{
type: 'maxLength[256]',
prompt : '所有字符最长不超过256个字符。'
}
]
},
}, },
onSuccess: function(){ onSuccess: function(){
// $('.ui.page.dimmer').dimmer('show') // $('.ui.page.dimmer').dimmer('show')
@@ -594,7 +612,6 @@
$('#store_run_para').val(msg) $('#store_run_para').val(msg)
} }
function get_name(){ function get_name(){
console.log("--------------")
let name1=$("#engine_name .text").text() let name1=$("#engine_name .text").text()
let name2=$("#flaver_name .text").text() let name2=$("#flaver_name .text").text()
console.log(name1,name2) console.log(name1,name2)


Loading…
Cancel
Save