Browse Source

解决#2916 【模型转换】模型文件为空时应不能创建模型转换任务

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/2977/head
zouap 2 years ago
parent
commit
b2169ba04d
3 changed files with 11 additions and 2 deletions
  1. +1
    -0
      options/locale/locale_en-US.ini
  2. +1
    -0
      options/locale/locale_zh-CN.ini
  3. +9
    -2
      templates/repo/modelmanage/convertIndex.tmpl

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

@@ -1301,6 +1301,7 @@ modelconvert.taskurlname=Model transformation task
log_scroll_start=Scroll to top
log_scroll_end=Scroll to bottom
modelconvert.tasknameempty=Please enter a task name.
modelconvert.modelfileempty=Please choose a model file.
modelconvert.inputshapeerror=Format input error, please input such as: 1,1,32,32, corresponding to the input data format.

modelconvert.manage.create_error1=A model transformation task with the same name already exists.


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

@@ -1317,6 +1317,7 @@ log_scroll_start=滚动到顶部
log_scroll_end=滚动到底部
modelconvert.tasknameempty=请输入任务名称。
modelconvert.inputshapeerror=格式输入错误,请输入如:1,1,32,32,与输入数据格式对应。
modelconvert.modelfileempty=请选择模型文件。

modelconvert.manage.create_error1=相同的名称模型转换任务已经存在。
modelconvert.manage.create_error2=只能创建一个正在运行的模型转换任务。


+ 9
- 2
templates/repo/modelmanage/convertIndex.tmpl View File

@@ -241,7 +241,7 @@
</div>
</div>
</div>
<div class="unite min_title inline fields required">
<div class="unite min_title inline fields required" id="ModelFile_Div">
<div class="three wide field right aligned">
<label for="choice_file">{{$.i18n.Tr "repo.model.manage.modelfile"}}</label>
</div>
@@ -382,7 +382,14 @@
data['DestFormat'] = $('#DestFormat').val();
data['NetOutputFormat']= $('#NetOutputFormat').val();
data['ModelFile'] = $('#ModelFile').val();

if(data['ModelFile']==""){
$('.ui.error.message').text("{{.i18n.Tr "repo.modelconvert.modelfileempty"}}")
$('.ui.error.message').css('display','block')
$("#ModelFile_Div").addClass("error")
return false
}else{
$("#ModelFile_Div").removeClass("error")
}
$.post(`${repolink}/modelmanage/create_model_convert`,data,(result) => {
console.log("result=" + result);
if(result.result_code ==0){


Loading…
Cancel
Save