Browse Source

fix issue

tags/v1.22.12.1^2
zhoupzh 3 years ago
parent
commit
3692fb692f
3 changed files with 74 additions and 17 deletions
  1. +7
    -5
      templates/repo/debugjob/index.tmpl
  2. +17
    -8
      templates/repo/grampus/notebook/npu/new.tmpl
  3. +50
    -4
      templates/repo/modelarts/notebook/show.tmpl

+ 7
- 5
templates/repo/debugjob/index.tmpl View File

@@ -219,8 +219,9 @@
</div>
<div class="two wide column text center">
<!--任务状态 -->
{{.Cloudbrain.Type}}
<span class="job-status" id="{{.Cloudbrain.ID}}"
data-repopath="{{$.RepoRelPath}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}"
data-repopath="{{$.RepoRelPath}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}"
data-jobid="{{.Cloudbrain.ID}}" data-resource="{{.ComputeResource}}">
<span><i id="{{.Cloudbrain.ID}}-icon" style="vertical-align: middle;"
class="{{.Status}}"></i><span id="{{.Cloudbrain.ID}}-text"
@@ -262,14 +263,14 @@
<a style="margin: 0 1rem;" id="ai-debug-{{.Cloudbrain.ID}}"
class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}}disabled {{else}}blue {{end}}button'
data-jobid="{{.Cloudbrain.ID}}"
data-repopath='{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/'>
data-repopath='{{$.RepoLink}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}/{{.Cloudbrain.ID}}/'>
{{$.i18n.Tr "repo.debug"}}
</a>
{{else}}
<a id="ai-debug-{{.Cloudbrain.ID}}"
class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}} disabled {{else}}blue {{end}}button'
data-jobid="{{.Cloudbrain.ID}}"
data-repopath='{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/'
data-repopath='{{$.RepoLink}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}/{{.Cloudbrain.ID}}/'
data-linkpath='{{$.Link}}'>
{{$.i18n.Tr "repo.debug_again"}}
</a>
@@ -293,7 +294,7 @@
{{if .CanDel}}
<a id="ai-stop-{{.Cloudbrain.ID}}"
class='ui basic ai_stop {{if eq .Status "STOPPED" "FAILED" "START_FAILED" "STOPPING" "CREATING" "STARTING" "SUCCEEDED" "CREATE_FAILED" "DELETED"}}disabled {{else}}blue {{end}}button'
data-repopath="{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/stop"
data-repopath='{{$.RepoLink}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}/{{.Cloudbrain.ID}}/stop'
data-jobid="{{.Cloudbrain.ID}}">
{{$.i18n.Tr "repo.stop"}}
</a>
@@ -305,7 +306,7 @@
</form>
<!-- 删除 -->
<form id="delForm-{{.Cloudbrain.ID}}"
action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/del"
action="{{$.RepoLink}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}/{{.Cloudbrain.ID}}/del"
method="post">
<input type="hidden" name="debugListType" value="{{$.ListType}}">
{{$.CsrfTokenHtml}}
@@ -433,6 +434,7 @@
</div>
{{template "base/footer" .}}
<script>
console.log({{.Tasks}})
// 调试和评分新开窗口
const { AppSubUrl, StaticUrlPrefix, csrf } = window.config;
let url = {{.RepoLink }}


+ 17
- 8
templates/repo/grampus/notebook/npu/new.tmpl View File

@@ -14,6 +14,7 @@
{{template "custom/alert_cb" .}}
<form class="ui form" id="form_id" action="{{.Link}}" method="post">
<input type="hidden" name="type" value="1">
<input type="hidden" name="image" value="">
{{.CsrfTokenHtml}}
<h3 class="ui top attached header">
{{.i18n.Tr "repo.cloudbrain.new"}}
@@ -81,10 +82,11 @@
</div>
<div class="inline required field">
<label>{{.i18n.Tr "cloudbrain.mirror"}}</label>
<select id="cloudbrain_image" class="ui search dropdown" placeholder="{{.i18n.Tr "cloudbrain.choose_mirror"}}" style='width:385px' name="image_id">
<select class="ui search dropdown cloudbrain_image" placeholder="{{.i18n.Tr "cloudbrain.choose_mirror"}}" style='width:385px' name="image_id">
{{range .images}}
<option name="image_id" value="{{.ID}}">{{.Name}}</option>
{{end}}
<option name="image_id" value="222222222">1111</option>
</select>
</div>
@@ -182,14 +184,21 @@
document.getElementById("mask").style.display = "none"
}
}
$('select.dropdown')
.dropdown();
$(document).ready(function(){
$(document).keydown(function(event){
if(event.keyCode==13){
event.preventDefault();
}
});
$('input[name="image"]').val($('.cloudbrain_image').dropdown('get text'))
$('.cloudbrain_image.ui.search.dropdown')
.dropdown({
onChange: function(value, text, $selectedItem) {
$('input[name="image"]').val(text)
}
})
$(document).keydown(function(event){
if(event.keyCode==13){
event.preventDefault();
}
});
});

;(function() {


+ 50
- 4
templates/repo/modelarts/notebook/show.tmpl View File

@@ -336,6 +336,18 @@
</div>
</td>
</tr>
{{if eq .Type 2}}
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
代码分支
</td>
<td class="ti-text-form-content">
<div class="text-span text-span-w">
{{.BranchName}}
</div>
</td>
</tr>
{{end}}
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
{{$.i18n.Tr "cloudbrain.description"}}
@@ -363,13 +375,13 @@
<td class="ti-text-form-content">
<div class="text-span text-span-w" id="{{.VersionName}}-mirror">
<span class="ui poping up clipboard" data-position="top center" id="clipboard-btn-image" style="cursor:pointer"
data-clipboard-text="{{.Image}}"
data-clipboard-text="{{if .Image}}{{.Image}}{{else}}{{.EngineName}}{{end}}"
data-success="{{$.i18n.Tr "repo.copied"}}"
data-error="{{$.i18n.Tr "repo.copied_error"}}"
data-content="{{$.i18n.Tr "repo.copy"}}"
data-variation="inverted tiny"
>
<span title="{{.Image}}">{{.Image}}</span>
<span title="{{if .Image}}{{.Image}}{{else}}{{.EngineName}}{{end}}">{{if .Image}}{{.Image}}{{else}}{{.EngineName}}{{end}}</span>
</span>
</div>
</td>
@@ -430,8 +442,37 @@
</div>
</td>
</tr>
{{if eq .Type 2}}
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
代码地址
</td>


<td class="ti-text-form-content">
<div class="text-span text-span-w">
{{if .TrainUrl}}
{{.TrainUrl}}
{{else}}
--
{{end}}
</div>
</td>
</tr>
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
数据集地址
</td>
<td class="ti-text-form-content">
<div class="text-span text-span-w">
{{if .DataUrl}}
{{.DataUrl}}
{{else}}
--
{{end}}
</div>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
@@ -439,7 +480,9 @@


</div>
<div style="clear:both">
{{if ne .Type 2}}
<table style="border:none" class="ui fixed small stackable table">
<thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide center aligned">{{$.i18n.Tr "dataset.file"}}</th>
@@ -462,7 +505,9 @@
{{end}}
</tbody>
</table>
</div>
{{end}}
</div>
</div>
</div>

@@ -521,4 +566,5 @@
});
$('td.ti-text-form-content.spec div').text(specStr);
})();
console.log({{.task}})
</script>

Loading…
Cancel
Save