diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index faf9c7ced..81fc5cc06 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -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. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index e00b69e0e..f8bbb5ca9 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -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=只能创建一个正在运行的模型转换任务。 diff --git a/templates/repo/modelmanage/convertIndex.tmpl b/templates/repo/modelmanage/convertIndex.tmpl index 2f5ee6c35..3c4ac7f69 100644 --- a/templates/repo/modelmanage/convertIndex.tmpl +++ b/templates/repo/modelmanage/convertIndex.tmpl @@ -241,7 +241,7 @@ -
+
@@ -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){