diff --git a/web_src/vuepages/langs/config/en-US.js b/web_src/vuepages/langs/config/en-US.js index 7a5c7aec2..0d30c6578 100644 --- a/web_src/vuepages/langs/config/en-US.js +++ b/web_src/vuepages/langs/config/en-US.js @@ -221,6 +221,7 @@ const en = { uploadStatus: 'Upload status', modelFileUploadDefaultTips: 'Click to add files or drag files here directly', modelFileUploadErrTips: 'Up to 10 files can be uploaded at a time, and the total file size of the model does not exceed {size}GB', + modelFileNameTips: 'The file name should not exceed 128 characters', fileIstoBig: 'File is to big', removeFile: 'Rmove file', uploadSuccess: 'upload success', diff --git a/web_src/vuepages/langs/config/zh-CN.js b/web_src/vuepages/langs/config/zh-CN.js index 9e97d03ea..4698c67e0 100644 --- a/web_src/vuepages/langs/config/zh-CN.js +++ b/web_src/vuepages/langs/config/zh-CN.js @@ -221,6 +221,7 @@ const zh = { uploadStatus: '上传状态', modelFileUploadDefaultTips: '点击添加文件或直接拖拽文件到此处', modelFileUploadErrTips: '单次最多上传10个文件,模型总文件大小不超过{size}G', + modelFileNameTips: '文件名长度不超过128字符', fileIstoBig: '文件太大', removeFile: '移除文件', uploadSuccess: '上传成功', diff --git a/web_src/vuepages/pages/modelmanage/local/modelmanage-local-create-2.vue b/web_src/vuepages/pages/modelmanage/local/modelmanage-local-create-2.vue index 0f95bc8c4..facd8f3e3 100644 --- a/web_src/vuepages/pages/modelmanage/local/modelmanage-local-create-2.vue +++ b/web_src/vuepages/pages/modelmanage/local/modelmanage-local-create-2.vue @@ -198,6 +198,11 @@ export default { this.showUploadErrInfo(true, this.getDefaultErrTxt()); return false; } + if (file && file.name.length > 128) { + this.showUploadErrInfo(true, this.$t('modelManage.modelFileNameTips')); + this.uploadError(file, this.$t('modelManage.modelFileNameTips')); + return false; + } this.showUploadErrInfo(false); return true; }, @@ -466,7 +471,7 @@ export default { }, uploadFinishCheck(file) { console.log('uploadFinishCheck', file, this.uploadLength, '/', this.uploadFiles.length); - if (this.uploadLength === this.uploadFiles.length) { + if (this.uploadLength === this.uploadFiles.length && this.uploadFiles.length != 0) { console.log('All file has finish, success ' + this.uploadSuccessLength); this.uploading = false; if (this.uploadSuccessLength == this.uploadLength) { @@ -483,7 +488,9 @@ export default { submit() { const fileList = this.dropzoneHandler.getAcceptedFiles(); if (!fileList.length) return; - if (!this.checkFiles()) return; + for (let i = 0, iLen = fileList.length; i < iLen; i++) { + if (!this.checkFiles(fileList[i])) return; + } this.resetFileStatus(); this.uploadFiles = fileList; this.uploading = true;