Browse Source

模型文件渲染

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.7.1
zouap 3 years ago
parent
commit
f6629cde89
1 changed files with 28 additions and 40 deletions
  1. +28
    -40
      templates/repo/modelmanage/convertshowinfo.tmpl

+ 28
- 40
templates/repo/modelmanage/convertshowinfo.tmpl View File

@@ -254,7 +254,7 @@ td, th {
</td>

<td class="ti-text-form-content">
<div class="text-span text-span-w" id="status">
<div class="text-span text-span-w" id="InputShape">
{{.InputShape}}
</div>
</td>
@@ -266,7 +266,7 @@ td, th {
</td>

<td class="ti-text-form-content">
<div class="text-span text-span-w" id="status">
<div class="text-span text-span-w" id="InputDataFormat">
{{.InputDataFormat}}
</div>
</td>
@@ -507,7 +507,7 @@ td, th {
$.get(`/api/v1/repos/${userName}/${repoPath}/modelmanage/${taskID}/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)
$(`#log_file`).text(data.Content)
document.getElementById("mask").style.display = "none"
}).fail(function(err) {
console.log(err);
@@ -520,16 +520,16 @@ td, th {
init = init || ''
console.log("start")
$.get(`/api/v1/repos/${userName}/${repoPath}/modelmanage/${taskID}/model_list?version_name=${version_name}&parentDir=${parents}`, (data) => {
$(`#dir_list${version_name}`).empty()
$(`#dir_list`).empty()
renderDir(data,version_name)
if(init==="init"){
$(`input[name=model${version_name}]`).val("")
$(`input[name=modelback${version_name}]`).val(version_name)
$(`#file_breadcrumb${version_name}`).empty()
$(`input[name=model]`).val("")
$(`input[name=modelback]`).val(version_name)
$(`#file_breadcrumb`).empty()
let htmlBread = ""
htmlBread += `<div class='active section'>${version_name}</div>`
htmlBread += `<div class='active section'></div>`
htmlBread += "<div class='divider'> / </div>"
$(`#file_breadcrumb${version_name}`).append(htmlBread)
$(`#file_breadcrumb`).append(htmlBread)
}else{
renderBrend(version_name,parents,filename,init)
}
@@ -552,15 +552,15 @@ td, th {
htmlBrend += `<div class='active section'>${filename}</div>`
htmlBrend += "<div class='divider'> / </div>"
$(`#file_breadcrumb${version_name}`).append(htmlBrend)
$(`input[name=model${version_name}]`).val(parents)
$(`input[name=modelback${version_name}]`).val(filename)
$(`#file_breadcrumb`).append(htmlBrend)
$(`input[name=model]`).val(parents)
$(`input[name=modelback]`).val(filename)
}else{
$(`input[name=model${version_name}]`).val(parents)
$(`input[name=modelback${version_name}]`).val(filename)
$(`#file_breadcrumb${version_name} a.section:contains(${filename})`).nextAll().remove()
$(`#file_breadcrumb${version_name} a.section:contains(${filename})`).replaceWith(`<div class='active section'>${filename}</div>`)
$(`#file_breadcrumb${version_name} div.section:contains(${filename})`).append("<div class='divider'> / </div>")
$(`input[name=model]`).val(parents)
$(`input[name=modelback]`).val(filename)
$(`#file_breadcrumb a.section:contains(${filename})`).nextAll().remove()
$(`#file_breadcrumb a.section:contains(${filename})`).replaceWith(`<div class='active section'>${filename}</div>`)
$(`#file_breadcrumb div.section:contains(${filename})`).append("<div class='divider'> / </div>")
}
}
@@ -616,7 +616,7 @@ td, th {
html += "</div>"
html += "</div>"
html += "</div>"
$(`#dir_list${version_name}`).append(html)
$(`#dir_list`).append(html)
}
function renderSize(value){
if(null==value||value==''){
@@ -641,25 +641,19 @@ td, th {
// || job.textContent.trim() == 'CANCELED' || job.textContent.trim() == 'LOST') {
// return
// }
let status = $(`#${versionname}-status-span`).text()
let status = $(`#status-span`).text()
if(['IMAGE_FAILED','SUBMIT_FAILED','DELETE_FAILED','KILLED','COMPLETED','FAILED','CANCELED','LOST','START_FAILED','SUCCEEDED','STOPPED'].includes(status)){
return
}
let stopArray=["KILLED","FAILED","START_FAILED","KILLING","COMPLETED","SUCCEEDED","STOPPED"]
$.get(`/api/v1/repos/${repoPath}/modelmanage/${taskID}?version_name=${versionname}`, (data) => {
//$(`#${versionname}-duration-span`).text(data.JobDuration)
$(`#${versionname}-status-span span`).text(data.JobStatus)
$(`#${versionname}-status-span i`).attr("class",data.JobStatus)
// detail status and duration
//$('#'+versionname+'-duration').text(data.JobDuration)
$('#'+versionname+'-status').text(data.JobStatus)
if(stopArray.includes(data.JobStatus)){
$('#'+versionname+'-stop').addClass('disabled')
}
if(data.JobStatus==="COMPLETED"){
$('#'+versionname+'-create-model').removeClass('disabled').addClass('blue')
}
$(`#status-span span`).text(data.JobStatus)
$(`#status-span i`).attr("class",data.JobStatus)
$('#status').text(data.JobStatus)
}).fail(function(err) {
console.log(err);
});
@@ -668,16 +662,10 @@ td, th {

function refreshStatus(version_name){
$.get(`/api/v1/repos/${userName}/${repoPath}/modelmanage/${taskID}?version_name=${versionname}`,(data)=>{
// header status and duration
//$(`#${version_name}-duration-span`).text(data.JobDuration)
$(`#${version_name}-status-span span`).text(data.JobStatus)
$(`#${version_name}-status-span i`).attr("class",data.JobStatus)
// detail status and duration
//$('#'+version_name+'-duration').text(data.JobDuration)
$('#'+version_name+'-status').text(data.JobStatus)
$(`#status-span span`).text(data.JobStatus)
$(`#status-span i`).attr("class",data.JobStatus)
$('#status').text(data.JobStatus)
loadLog(version_name)


}).fail(function(err) {
console.log(err);
});


Loading…
Cancel
Save