Browse Source

fix issue

tags/v1.22.4.1^2
zhoupzh 4 years ago
parent
commit
c968c48924
6 changed files with 152 additions and 5 deletions
  1. +5
    -0
      options/locale/locale_en-US.ini
  2. +6
    -0
      options/locale/locale_zh-CN.ini
  3. +113
    -3
      templates/repo/cloudbrain/image/submit.tmpl
  4. +1
    -1
      templates/repo/createCourse.tmpl
  5. +1
    -1
      templates/repo/debugjob/index.tmpl
  6. +26
    -0
      web_src/js/features/images.js

+ 5
- 0
options/locale/locale_en-US.ini View File

@@ -917,6 +917,11 @@ image_commit_fail=Failed to submit image, please try again later.
download=Download
score=Score

images.name = Image Name
images.name_placerholder = Please enter the image name
image.label_tooltips = Example Python 3.7, Tensorflow 2.0, cuda 10, pytorch 1.6
images.public_tooltips = After the image is set to public, it can be seen by other users.

cloudbrain=Cloudbrain
cloudbrain.new=New cloudbrain
cloudbrain.desc=Cloudbrain


+ 6
- 0
options/locale/locale_zh-CN.ini View File

@@ -922,6 +922,12 @@ image_commit_fail=提交镜像失败,请稍后再试。
download=模型下载
score=评分


images.name = 镜像名称
images.name_placerholder = 请输入镜像名称
image.label_tooltips = 如Python 3.7, Tensorflow 2.0, cuda 10, pytorch 1.6
images.public_tooltips = 镜像设置为公开后,可被其他用户看到。

cloudbrain=云脑
cloudbrain.new=新建任务
cloudbrain.desc=云脑功能


+ 113
- 3
templates/repo/cloudbrain/image/submit.tmpl View File

@@ -1,5 +1,115 @@
<style>
.fz14{
font-size: 14px !important;
}
.label_color{
color:#505559 !important;
width: 6% !important;
text-align: center;
}
</style>
{{template "base/head" .}}
<div>
asdasd
<div class="repository">
{{template "repo/header" .}}
<div class="ui container">
<div>
<h4 class="ui top attached header">
{{.i18n.Tr "repo.submit_image"}}
</h4>
<div class="ui attached segment" style="padding: 2em 3em;padding-bottom: 7rem;">
<div class="ui form">
<div class="inline field">
<label class="label_color" for="">{{$.i18n.Tr "dataset.dataset_available_clusters"}}</label>
<div class="ui basic label" style="border: none !important;color:#3291f8;">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14"><path fill="none" d="M0 0h24v24H0z"></path><path d="M4 3h16a1 1 0 0 1 1 1v7H3V4a1 1 0 0 1 1-1zM3 13h18v7a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-7zm4 3v2h3v-2H7zM7 6v2h3V6H7z"></path></svg>
CPU/GPU
</div>
</div>
<div class="inline required field">
<label class="label_color" for="">{{$.i18n.Tr "repo.images.name"}}</label>
<input type="text" name="first-name" placeholder="{{$.i18n.Tr "repo.images.name_placerholder"}}" style="width: 80%;">
<span class="tooltips" style="display: block;padding-left: 0.5rem;">{{.i18n.Tr "cloudbrain.job_name_rule"}}</span>
</div>
<div class="inline required field">
<label class="label_color" for="">{{$.i18n.Tr "dataset.description"}}</label>
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)"></textarea>
</div>
<div class="inline required field" style="display: flex;align-items: center;">
<label class="label_color" for="">{{$.i18n.Tr "repo.model.manage.label"}}</label>&nbsp;
<!-- <input type="text" name="first-name" placeholder="{{$.i18n.Tr "repo.repo_label_helpe"}}" style="width: 80%;"> -->
<div class="ui multiple search selection dropdown" id="dropdown_container" style="width: 80%;">
<input type="hidden" name="topics" value="">
<div class="default text" id="default_text">{{.i18n.Tr "repo.repo_label_helpe"}}</div>
<div class="menu" id="course_label_item">
</div>
</div>
</div>
<span class="tooltips" style="display: block;padding-left: 0.5rem;margin-top: 0.5rem;margin-bottom: 1rem;">{{.i18n.Tr "repo.image.label_tooltips"}}</span>
<div class="inline fields">
<label class="label_color" for="" style="visibility: hidden;"></label>
<div class="field">
<div class="ui radio checkbox checked">
<input type="radio" name="fruit" checked="" tabindex="0" class="hidden">
<label>{{.i18n.Tr "org.settings.visibility.public"}}</label>
</div>
</div>
<div class="field" style="flex: 0.15;">
<div class="ui radio checkbox checked" >
<input type="radio" name="fruit" checked="" tabindex="0" class="hidden">
<label>{{.i18n.Tr "home.show_private"}}</label>
</div>
</div>
<div class="field">
<span class="label_color">{{.i18n.Tr "repo.images.public_tooltips"}}</span>
</div>
</div>

<div class="inline required field" style="padding-top: 2rem;">
<label class="label_color" for="" style="visibility: hidden;"></label>
<button class="ui create_train_job green button">
{{.i18n.Tr "repo.cloudbrain.commit_image"}}
</button>
<a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
</div>
</div>
</div>
</div>
</div>
</div>
{{template "base/footer" .}}
{{template "base/footer" .}}

<script>

$(document).ready(function(){
$('.ui.multiple.search.selection.dropdown')
.dropdown({
allowAdditions: true,
onChange: function(value, text, $selectedItem) {
$('#course_label_item').empty()
}
})
// let defaultText = document.getElementById("default_text").offsetHeight
// defaultText = defaultText>40 ? defaultText+12 :defaultText
// $("#dropdown_container").css("height",defaultText)
$('input.search').bind('input propertychange', function (event) {
// $("#dropdown_container").removeAttr("style");
const query = $('input.search').val()
if(!query){
$('#course_label_item').empty()
}else{
$.get(`/api/v1/topics/search?q=${query}`,(data)=>{
if(data.topics.length!==0){
let html=''
$('#course_label_item').empty()
data.topics.forEach(element => {
html += `<div class="item" data-value="${element.topic_name}">${element.topic_name}</div>`
});
$('#course_label_item').append(html)
}
})
}
});
})
</script>

+ 1
- 1
templates/repo/createCourse.tmpl View File

@@ -46,7 +46,7 @@
<span style="flex: 1;"></span>
</div>

<div class="inline field" style="display: flex;align-items:center;">
<div class="inline field" style="display: flex;align-items:center;">
<label style="margin: .035714em 1em 0 0;">{{.i18n.Tr "repo.model.manage.label"}}</label>
<div class="ui multiple search selection dropdown" id="dropdown_container">
<input type="hidden" name="topics" value="">


+ 1
- 1
templates/repo/debugjob/index.tmpl View File

@@ -382,7 +382,7 @@
<!-- 接收结果 -->
<iframe src="" frameborder="0" name="iframeContent" style="display: none;"></iframe>
{{if .CanDebug}}
<a id="model-image-{{.Cloudbrain.ID}}" class='imageBtn ui basic {{if ne .Status "RUNNING"}}disabled {{else}}blue {{end}}button' href="{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}/commit_image">{{$.i18n.Tr "repo.submit_image"}}</a>
<a id="model-image-{{.Cloudbrain.ID}}" class='imageBtn ui basic {{if ne .Status "RUNNING"}} {{else}}blue {{end}}button' href="{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}/commit_image">{{$.i18n.Tr "repo.submit_image"}}</a>
{{else}}
<a class="imageBtn ui basic disabled button">{{$.i18n.Tr "repo.submit_image"}}</a>
{{end}}


+ 26
- 0
web_src/js/features/images.js View File

@@ -0,0 +1,26 @@
import Images from './components/Images.vue';
export default async function initImage(){

const el = document.getElementById('image-base');
if (!el) {
return;
}
new Vue({
delimiters: ['${', '}'],
el,
data() {
return{

}
},
components: {
Images
},
mounted(){
},
methods:{
}
});

}

Loading…
Cancel
Save