|
|
|
@@ -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>' |
|
|
|
|