diff --git a/backend/src/main/resources/db/migration/V79__v1.8.1_release.sql b/backend/src/main/resources/db/migration/V79__v1.8.1_release.sql new file mode 100644 index 0000000000..db9b4273a0 --- /dev/null +++ b/backend/src/main/resources/db/migration/V79__v1.8.1_release.sql @@ -0,0 +1,2 @@ +ALTER TABLE file_metadata + MODIFY name VARCHAR(250) NOT NULL COMMENT 'File name'; \ No newline at end of file diff --git a/frontend/src/business/components/performance/test/components/ExistFiles.vue b/frontend/src/business/components/performance/test/components/ExistFiles.vue index bcecb0713c..e264843c2b 100644 --- a/frontend/src/business/components/performance/test/components/ExistFiles.vue +++ b/frontend/src/business/components/performance/test/components/ExistFiles.vue @@ -154,35 +154,39 @@ export default { } let rows = this.existFiles.filter(f => this.selectIds.has(f.id)); + let jmxIds = []; for (let i = 0; i < rows.length; i++) { let row = rows[i]; if (this.tableData.filter(f => f.name === row.name).length > 0) { - this.$error(this.$t('load_test.delete_file') + ', name: ' + row.name); - this.selectIds.clear(); - return; + setTimeout(() => { + this.$warning(this.$t('load_test.delete_file') + 'name: ' + row.name); + }, 100); + continue; } + if (row.type.toUpperCase() === 'JMX') { + jmxIds.push(row.id); + } + this.tableData.push({ + name: row.name, + size: (row.size / 1024).toFixed(2) + ' KB', + type: row.type.toUpperCase(), + updateTime: row.lastModified, + }); } if (this.loadType === 'resource') { rows.forEach(row => { this.fileList.push(row); - this.tableData.push({ - name: row.name, - size: (row.size / 1024).toFixed(2) + ' KB', - type: row.type.toUpperCase(), - updateTime: row.lastModified, - }); }) this.$success(this.$t('test_track.case.import.success')); - this.loadFileVisible = false; - this.selectIds.clear(); + this.close(); return; } - this.getJmxContents(); + this.getJmxContents(jmxIds); }, - getJmxContents() { - this.projectLoadingResult = this.$post('/performance/export/jmx', [...this.selectIds], (response) => { + getJmxContents(jmxIds) { + this.projectLoadingResult = this.$post('/performance/export/jmx', jmxIds, (response) => { let data = response.data; if (!data) { return; @@ -195,18 +199,11 @@ export default { }); let file = new File([d.jmx], d.name); this.uploadList.push(file); - this.tableData.push({ - name: file.name, - size: (file.size / 1024).toFixed(2) + ' KB', - type: 'JMX', - updateTime: file.lastModified, - }); }); this.$emit('fileChange', this.scenarios); this.$success(this.$t('test_track.case.import.success')); - this.loadFileVisible = false; - this.selectIds.clear(); + this.close(); }); }, beforeUploadFile(file) {