diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index edeb1356e..cf9297270 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -786,6 +786,7 @@ model_manager = 模型 model_noright=无权限操作 debug=调试 +debug_again=再次调试 stop=停止 delete=删除 model_download=模型下载 diff --git a/templates/repo/debugjob/index.tmpl b/templates/repo/debugjob/index.tmpl index 75811fd3e..ba76fa11f 100755 --- a/templates/repo/debugjob/index.tmpl +++ b/templates/repo/debugjob/index.tmpl @@ -316,21 +316,26 @@ {{end}} --> - {{if .CanDebug}} - {{if eq .ComputeResource "CPU/GPU"}} - - 再次调试 - +
+ {{$.CsrfTokenHtml}} + {{if .CanDebug}} + {{if eq .Status "RUNNING"}} + + {{$.i18n.Tr "repo.debug"}} + + {{else}} + + {{$.i18n.Tr "repo.debug_again"}} + + {{end}} {{else}} - - 再次调试 + + + {{$.i18n.Tr "repo.debug_again"}} {{end}} - {{else}} - - {{$.i18n.Tr "repo.debug"}} - - {{end}} +
+
{{$.CsrfTokenHtml}} @@ -501,25 +506,13 @@ .modal('show') } } - function debugAgain(jobID,url){ - console.log(url) - $.post(url,{_csrf:csrf},(data)=>{ - let getUrl = url.split('/restart')[0] - console.log(getUrl) - $.get(`/api/v1/repos${getUrl}`,(data)=>{ - const jobID = data.JobID - const status = data.JobStatus - console.log("status",status) - if(status==="RUNNING"){ - console.log("========status",status) - $('#model-debug-'+jobID).removeClass('disabled') - $('#model-debug-'+jobID).addClass('blue') - $('#model-debug-'+jobID).text('调试') - $('#model-image-'+jobID).removeClass('disabled') - $('#model-image-'+jobID).addClass('blue') - } - }) - }) + function debugAgain(JobID,debugUrl){ + console.log() + if($('#' + JobID+ '-text').text()==="RUNNING"){ + window.open(debugUrl) + }else{ + document.getElementById(`debugAgainForm-${JobID}`).submit(); + } } // 加载任务状态 @@ -549,6 +542,7 @@ $('#model-debug-'+jobID).text('调试') $('#model-image-'+jobID).removeClass('disabled') $('#model-image-'+jobID).addClass('blue') + $('#model-debug-'+jobID).css("margin","0 1rem") } if(status!=="RUNNING"){ // $('#model-debug-'+jobID).removeClass('blue')