diff --git a/package-lock.json b/package-lock.json index d45f8c6f8..a8e5e3e25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11655,6 +11655,11 @@ "autolinker": "~0.28.0" } }, + "remixicon": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/remixicon/-/remixicon-2.5.0.tgz", + "integrity": "sha512-q54ra2QutYDZpuSnFjmeagmEiN9IMo56/zz5dDNitzKD23oFRw77cWo4TsrAdmdkPiEn8mxlrTqxnkujDbEGww==" + }, "remove-bom-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", diff --git a/package.json b/package.json index 7147bea0d..ba5459a07 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "postcss-preset-env": "6.7.0", "postcss-safe-parser": "4.0.2", "qs": "6.9.4", + "remixicon": "2.5.0", "spark-md5": "3.0.1", "svg-sprite-loader": "5.0.0", "svgo": "1.3.2", diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index f61b65f60..138a323e1 100755 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -149,12 +149,6 @@ {{.i18n.Tr "repo.model_manager"}} {{end}} - {{if .Permission.CanRead $.UnitTypeModelManage}} - - - {{.i18n.Tr "repo.model_manager"}} - - {{end}} {{if .Permission.CanRead $.UnitTypeCloudBrain}} diff --git a/templates/repo/modelarts/trainjob/index.tmpl b/templates/repo/modelarts/trainjob/index.tmpl index 0f8f23490..52201e79d 100755 --- a/templates/repo/modelarts/trainjob/index.tmpl +++ b/templates/repo/modelarts/trainjob/index.tmpl @@ -121,7 +121,7 @@
- + {{.TrainJobDuration}}
@@ -253,35 +253,18 @@ } } - function loadJobDuration() { - $(".job-status").each((index, job) => { - const jobID = job.dataset.jobid; - const repoPath = job.dataset.repopath; - const versionname = job.dataset.version - $.get(`/api/v1/repos/${repoPath}/modelarts/train-job/${jobID}?version_name=${versionname}`, (data) => { - console.log(data) - const duration = data.JobDuration - const jobID = data.JobID - $('#duration-'+jobID).text(duration) - }) - - }) - } - $(document).ready(loadJobDuration); // 加载任务状态 var timeid = window.setInterval(loadJobStatus, 15000); $(document).ready(loadJobStatus); function loadJobStatus() { $(".job-status").each((index, job) => { - const jobID = job.dataset.jobid; - const repoPath = job.dataset.repopath; + const jobID = job.dataset.jobid + const repoPath = job.dataset.repopath const versionname = job.dataset.version - if (job.textContent.trim() == 'IMAGE_FAILED' || job.textContent.trim() == 'SUBMIT_FAILED' || job.textContent.trim() == 'DELETE_FAILED' - || job.textContent.trim() == 'KILLED' || job.textContent.trim() == 'COMPLETED' || job.textContent.trim() == 'FAILED' - || job.textContent.trim() == 'CANCELED' || job.textContent.trim() == 'LOST') { - return + const status_text = $(`#${jobID}-text`).text() + if(['IMAGE_FAILED','SUBMIT_FAILED','DELETE_FAILED','KILLED','COMPLETED','FAILED','CANCELED','LOST','START_FAILED'].includes(status_text)){ + return } - $.get(`/api/v1/repos/${repoPath}/modelarts/train-job/${jobID}?version_name=${versionname}`, (data) => { const jobID = data.JobID const status = data.JobStatus @@ -329,7 +312,6 @@ } } function stopVersion(version_name,jobID){ - const url = '/api/v1/repos/{{$.RepoRelPath}}/modelarts/train-job/'+jobID+'/stop_version' $.post(url,{version_name:version_name},(data)=>{ if(data.StatusOK===0){ diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index 67150e682..f6de05a36 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -450,7 +450,6 @@ td, th { {{template "base/footer" .}}