Browse Source

fix issue

tags/v1.21.12.1
zhoupzh 4 years ago
parent
commit
9afb845f1e
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      templates/repo/modelarts/trainjob/show.tmpl

+ 8
- 2
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -657,6 +657,12 @@ td, th {
}
}
function downloadModelFile(version_name,parentDir,filename){
$.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/model_download?version_name=${version_name}&file_name=${filename}`, (data) => {
console.log(data)

})
}
function renderDir(data,version_name){
let html=""
html += "<div class='ui grid' style='margin:0;'>"
@@ -674,10 +680,10 @@ td, th {
html += "<span class='octicon octicon-file-directory'>"
html += "</span>"
if(data.Dirs[i].IsDir){
html += `<a onclick="loadModelFile('${version_name}','${data.Dirs[i].ParenDir}','${data.Dirs[i].FileName}','folder')">`
html += `<a onclick="loadModelFile('${version_name}','${data.Dirs[i].ParenDir}','${data.Dirs[i].ParenDir}','folder')">`
html += "<span class='fitted'><i class='folder icon' width='16' height='16' aria-hidden='true'></i>" + data.Dirs[i].FileName + "</span>"
}else{
html += `<a href='${location.href}/download_model?parentDir=&fileName=${data.Dirs[i].FileName}&jobName=${data.task.JobName}'>`
html += `<a onclick="downloadModelFile('${version_name}','${data.Dirs[i].ParenDir}','${data.Dirs[i].ParenDir}')">`
html += "<span class='fitted'><i class='file icon' width='16' height='16' aria-hidden='true'></i>" + data.Dirs[i].FileName + "</span>"
}
html += '</a>'


Loading…
Cancel
Save