-
+
+
+
-
@@ -477,7 +481,7 @@ td, th {
}
// var timeid = window.setInterval(refreshStatus(version_name), 30000);
// document.ready(refreshStatus(version_name))
- var timeid = window.setInterval(loadJobStatus, 10000);
+ // var timeid = window.setInterval(loadJobStatus, 10000);
$(document).ready(loadJobStatus);
function loadJobStatus() {
@@ -575,81 +579,52 @@ td, th {
console.log(err);
});
}
- function loadModelFile(version_name,parents,filename){
- console.log("")
+ function loadModelFile(version_name,parents,filename,init){
parents = parents || ''
filename = filename || ''
+ init = init || ''
$.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/model_list?version_name=${version_name}&parentDir=${parents}`, (data) => {
- console.log("=====parents======",data,version_name,parents)
- if(!filename){
- console.log("bread")
- $("#dir_list").empty()
- renderDir(data,version_name)
- renderBrend(version_name,parents,filename,false)
+ $(`#dir_list${version_name}`).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()
+ let htmlBread = ""
+ htmlBread += `
${version_name}
`
+ htmlBread += "
/
"
+ $(`#file_breadcrumb${version_name}`).append(htmlBread)
}else{
- $("#dir_list").empty()
- renderDir(data,version_name)
- renderBrend(version_name,parents,filename,true)
+ renderBrend(version_name,parents,filename,init)
}
-
-
}).fail(function(err) {
console.log(err,version_name);
});
- // if(!parents){
- // $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/model_list?version_name=${version_name}`, (data) => {
- // console.log("===========",data,version_name)
- // $("#dir_list").empty()
- // renderDir(data,version_name)
-
- // }).fail(function(err) {
- // console.log(err);
- // });
- // }else{
- // console.log("-----else-----",version_name)
-
- // }
}
- let parentsArr=[]
- function renderBrend(version_name,parents,filename,flag){
- if(flag){
- parentsArr.push(parents)
- console.log("parents parentsARR",parents,parentsArr)
-
+ function renderBrend(version_name,parents,filename,init){
+ if(init=="folder"){
let htmlBrend = ""
- if($('#file_breadcrumb .active').length>0){
- let parents1 = parentsArr.shift()
- let sectionName=$('#file_breadcrumb .active.section').html()
- $('#file_breadcrumb .active.section').replaceWith(`
${sectionName}`)
- htmlBrend += `
${filename}
`
-
-
+ let sectionName=$(`#file_breadcrumb${version_name} .active.section`).text()
+ let parents1 = $(`input[name=model${version_name}]`).val()
+ let filename1 = $(`input[name=modelback${version_name}]`).val()
+ if(parents1===""){
+ $(`#file_breadcrumb${version_name} .active.section`).replaceWith(`
${sectionName}`)
}else{
-
- htmlBrend += `
${version_name}
`
-
+ $(`#file_breadcrumb${version_name} .active.section`).replaceWith(`
${sectionName}`)
}
- console.log("parentsARR",parentsArr)
+ htmlBrend += `
${filename}
`
htmlBrend += "
/
"
- $('#file_breadcrumb').append(htmlBrend)
-
+ $(`#file_breadcrumb${version_name}`).append(htmlBrend)
+ $(`input[name=model${version_name}]`).val(parents)
+ $(`input[name=modelback${version_name}]`).val(filename)
}else{
- if(!parents){
- $('#file_breadcrumb').empty()
- let htmlBread = ""
- htmlBread += `
${version_name}
`
- htmlBread += "
/
"
- $('#file_breadcrumb').append(htmlBread)
- }else{
-
- $(`a.section:contains(${parents})`).nextAll().remove()
- $(`a.section:contains(${parents})`).replaceWith(`
${parents}
`)
- $(`a.section:contains(${parents})`).append("
/
")
-
- }
-
+ $(`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(`
${filename}
`)
+ $(`#file_breadcrumb${version_name} div.section:contains(${filename})`).append("
/
")
}
}
@@ -669,7 +644,7 @@ td, th {
html += "
"
html += ""
if(data.Dirs[i].IsDir){
- html += `
`
+ html += ``
html += "" + data.Dirs[i].FileName + ""
}else{
html += ``
@@ -694,46 +669,48 @@ td, th {
html += "