Merge branch 'v1.0' of https://github.com/metersphere/server into v1.0
This commit is contained in:
commit
beba2650eb
|
@ -8,6 +8,7 @@ import io.metersphere.api.jmeter.JMeterService;
|
||||||
import io.metersphere.base.domain.*;
|
import io.metersphere.base.domain.*;
|
||||||
import io.metersphere.base.mapper.ApiTestFileMapper;
|
import io.metersphere.base.mapper.ApiTestFileMapper;
|
||||||
import io.metersphere.base.mapper.ApiTestMapper;
|
import io.metersphere.base.mapper.ApiTestMapper;
|
||||||
|
import io.metersphere.base.mapper.TestCaseMapper;
|
||||||
import io.metersphere.base.mapper.ext.ExtApiTestMapper;
|
import io.metersphere.base.mapper.ext.ExtApiTestMapper;
|
||||||
import io.metersphere.commons.constants.APITestStatus;
|
import io.metersphere.commons.constants.APITestStatus;
|
||||||
import io.metersphere.commons.exception.MSException;
|
import io.metersphere.commons.exception.MSException;
|
||||||
|
@ -46,6 +47,8 @@ public class APITestService {
|
||||||
private JMeterService jMeterService;
|
private JMeterService jMeterService;
|
||||||
@Resource
|
@Resource
|
||||||
private APIReportService apiReportService;
|
private APIReportService apiReportService;
|
||||||
|
@Resource
|
||||||
|
private TestCaseMapper testCaseMapper;
|
||||||
|
|
||||||
public List<APITestResult> list(QueryAPITestRequest request) {
|
public List<APITestResult> list(QueryAPITestRequest request) {
|
||||||
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
|
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
|
||||||
|
@ -110,6 +113,20 @@ public class APITestService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(String testId) {
|
public void delete(String testId) {
|
||||||
|
|
||||||
|
// 是否关联测试用例
|
||||||
|
TestCaseExample testCaseExample = new TestCaseExample();
|
||||||
|
testCaseExample.createCriteria().andTestIdEqualTo(testId);
|
||||||
|
List<TestCase> testCases = testCaseMapper.selectByExample(testCaseExample);
|
||||||
|
if (testCases.size() > 0) {
|
||||||
|
String caseName = "";
|
||||||
|
for (int i = 0; i < testCases.size(); i++) {
|
||||||
|
caseName = caseName + testCases.get(i).getName() + ",";
|
||||||
|
}
|
||||||
|
caseName = caseName.substring(0, caseName.length() - 1);
|
||||||
|
MSException.throwException(Translator.get("related_case_del_fail_prefix") + caseName + Translator.get("related_case_del_fail_suffix"));
|
||||||
|
}
|
||||||
|
|
||||||
deleteFileByTestId(testId);
|
deleteFileByTestId(testId);
|
||||||
apiReportService.deleteByTestId(testId);
|
apiReportService.deleteByTestId(testId);
|
||||||
apiTestMapper.deleteByPrimaryKey(testId);
|
apiTestMapper.deleteByPrimaryKey(testId);
|
||||||
|
|
|
@ -40,17 +40,24 @@ public class SystemParameterService {
|
||||||
|
|
||||||
public void editMail(List<SystemParameter> parameters) {
|
public void editMail(List<SystemParameter> parameters) {
|
||||||
List<SystemParameter> paramList = this.getParamList(ParamConstants.Classify.MAIL.getValue());
|
List<SystemParameter> paramList = this.getParamList(ParamConstants.Classify.MAIL.getValue());
|
||||||
boolean empty = paramList.size() < 2;
|
boolean empty = paramList.size() <= 0;
|
||||||
|
|
||||||
parameters.forEach(parameter -> {
|
parameters.forEach(parameter -> {
|
||||||
|
SystemParameterExample example = new SystemParameterExample();
|
||||||
if (parameter.getParamKey().equals(ParamConstants.MAIL.PASSWORD.getKey())) {
|
if (parameter.getParamKey().equals(ParamConstants.MAIL.PASSWORD.getKey())) {
|
||||||
String string = EncryptUtils.aesEncrypt(parameter.getParamValue()).toString();
|
if (!StringUtils.isBlank(parameter.getParamValue())) {
|
||||||
parameter.setParamValue(string);
|
String string = EncryptUtils.aesEncrypt(parameter.getParamValue()).toString();
|
||||||
|
parameter.setParamValue(string);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (empty) {
|
example.createCriteria().andParamKeyEqualTo(parameter.getParamKey());
|
||||||
systemParameterMapper.insert(parameter);
|
if (systemParameterMapper.countByExample(example) > 0) {
|
||||||
} else {
|
|
||||||
systemParameterMapper.updateByPrimaryKey(parameter);
|
systemParameterMapper.updateByPrimaryKey(parameter);
|
||||||
|
} else {
|
||||||
|
systemParameterMapper.insert(parameter);
|
||||||
}
|
}
|
||||||
|
example.clear();
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +75,8 @@ public class SystemParameterService {
|
||||||
javaMailSender.setUsername(hashMap.get(ParamConstants.MAIL.ACCOUNT.getKey()));
|
javaMailSender.setUsername(hashMap.get(ParamConstants.MAIL.ACCOUNT.getKey()));
|
||||||
javaMailSender.setPassword(hashMap.get(ParamConstants.MAIL.PASSWORD.getKey()));
|
javaMailSender.setPassword(hashMap.get(ParamConstants.MAIL.PASSWORD.getKey()));
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
|
props.put("mail.smtp.timeout", "5000");
|
||||||
|
props.put("mail.smtp.connectiontimeout", "5000");
|
||||||
props.put("mail.smtp.auth", "true");
|
props.put("mail.smtp.auth", "true");
|
||||||
if (BooleanUtils.toBoolean(hashMap.get(ParamConstants.MAIL.SSL.getKey()))) {
|
if (BooleanUtils.toBoolean(hashMap.get(ParamConstants.MAIL.SSL.getKey()))) {
|
||||||
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
||||||
|
@ -105,8 +114,11 @@ public class SystemParameterService {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
paramList.stream().filter(param -> param.getParamKey().equals(ParamConstants.MAIL.PASSWORD.getKey())).forEach(param -> {
|
paramList.stream().filter(param -> param.getParamKey().equals(ParamConstants.MAIL.PASSWORD.getKey())).forEach(param -> {
|
||||||
String string = EncryptUtils.aesDecrypt(param.getParamValue()).toString();
|
if (!StringUtils.isBlank(param.getParamValue())) {
|
||||||
param.setParamValue(string);
|
String string = EncryptUtils.aesDecrypt(param.getParamValue()).toString();
|
||||||
|
param.setParamValue(string);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
paramList.sort(Comparator.comparingInt(SystemParameter::getSort));
|
paramList.sort(Comparator.comparingInt(SystemParameter::getSort));
|
||||||
|
|
|
@ -131,12 +131,15 @@
|
||||||
let transactions = data.reduce(function (total, currentValue) {
|
let transactions = data.reduce(function (total, currentValue) {
|
||||||
return total + parseFloat(currentValue.transactions);
|
return total + parseFloat(currentValue.transactions);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
transactions = transactions.toFixed(2);
|
||||||
let received = data.reduce(function (total, currentValue) {
|
let received = data.reduce(function (total, currentValue) {
|
||||||
return total + parseFloat(currentValue.received);
|
return total + parseFloat(currentValue.received);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
received = received.toFixed(2);
|
||||||
let sent = data.reduce(function (total, currentValue) {
|
let sent = data.reduce(function (total, currentValue) {
|
||||||
return total + parseFloat(currentValue.sent);
|
return total + parseFloat(currentValue.sent);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
sent = sent.toFixed(2);
|
||||||
|
|
||||||
let error = (Math.round(failSize / allSamples * 10000) / 100) + '%';
|
let error = (Math.round(failSize / allSamples * 10000) / 100) + '%';
|
||||||
let averageTime = (averageTimeTotal / allSamples).toFixed(2);
|
let averageTime = (averageTimeTotal / allSamples).toFixed(2);
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
</ms-main-container>
|
</ms-main-container>
|
||||||
|
|
||||||
<el-dialog :title="title" :visible.sync="createVisible">
|
<el-dialog :title="title" :visible.sync="createVisible" destroy-on-close>
|
||||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="100px" size="small">
|
<el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="100px" size="small">
|
||||||
<el-form-item :label="$t('commons.name')" prop="name">
|
<el-form-item :label="$t('commons.name')" prop="name">
|
||||||
<el-input v-model="form.name" autocomplete="off"></el-input>
|
<el-input v-model="form.name" autocomplete="off"></el-input>
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!--Change personal password-->
|
<!--Change personal password-->
|
||||||
<el-dialog :title="$t('member.edit_password')" :visible.sync="editPasswordVisible" width="35%" left>
|
<el-dialog :title="$t('member.edit_password')" :visible.sync="editPasswordVisible" width="35%" :before-close='closeDialog' left >
|
||||||
<el-form :model="ruleForm" :rules="rules" ref="editPasswordForm" label-width="120px" class="demo-ruleForm">
|
<el-form :model="ruleForm" :rules="rules" ref="editPasswordForm" label-width="120px" class="demo-ruleForm">
|
||||||
<el-form-item :label="$t('member.old_password')" prop="password" style="margin-bottom: 29px">
|
<el-form-item :label="$t('member.old_password')" prop="password" style="margin-bottom: 29px">
|
||||||
<el-input v-model="ruleForm.password" autocomplete="off" show-password/>
|
<el-input v-model="ruleForm.password" autocomplete="off" show-password/>
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<ms-dialog-footer
|
<ms-dialog-footer
|
||||||
@cancel="editPasswordVisible = false"
|
@cancel="cancel()"
|
||||||
@confirm="updatePassword('editPasswordForm')"/>
|
@confirm="updatePassword('editPasswordForm')"/>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -156,6 +156,16 @@
|
||||||
editPassword(row) {
|
editPassword(row) {
|
||||||
this.editPasswordVisible = true;
|
this.editPasswordVisible = true;
|
||||||
},
|
},
|
||||||
|
cancel(){
|
||||||
|
this.editPasswordVisible = false;
|
||||||
|
this.ruleForm.password="";
|
||||||
|
this.ruleForm.newpassword="";
|
||||||
|
},
|
||||||
|
closeDialog(){
|
||||||
|
this.editPasswordVisible = false;
|
||||||
|
this.ruleForm.password="";
|
||||||
|
this.ruleForm.newpassword="";
|
||||||
|
},
|
||||||
updateUser(updateUserForm) {
|
updateUser(updateUserForm) {
|
||||||
this.$refs[updateUserForm].validate(valid => {
|
this.$refs[updateUserForm].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
host: [
|
host: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: ''
|
message: ' '
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
port: [
|
port: [
|
||||||
|
@ -115,6 +115,7 @@
|
||||||
|
|
||||||
activated() {
|
activated() {
|
||||||
this.query()
|
this.query()
|
||||||
|
this.change()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeType() {
|
changeType() {
|
||||||
|
@ -126,9 +127,15 @@
|
||||||
this.$set(this.formInline, "port", response.data[1].paramValue);
|
this.$set(this.formInline, "port", response.data[1].paramValue);
|
||||||
this.$set(this.formInline, "account", response.data[2].paramValue);
|
this.$set(this.formInline, "account", response.data[2].paramValue);
|
||||||
this.$set(this.formInline, "password", response.data[3].paramValue);
|
this.$set(this.formInline, "password", response.data[3].paramValue);
|
||||||
this.$set(this.formInline, "SSL", JSON.parse(response.data[4].paramValue));
|
if(response.data[4].paramValue!=""){
|
||||||
this.$set(this.formInline, "TLS", JSON.parse(response.data[5].paramValue));
|
this.$set(this.formInline, "SSL", JSON.parse(response.data[4].paramValue));
|
||||||
this.$set(this.formInline, "SMTP", JSON.parse(response.data[6].paramValue));
|
}
|
||||||
|
if(response.data[5].paramValue!=""){
|
||||||
|
this.$set(this.formInline, "TLS", JSON.parse(response.data[5].paramValue));
|
||||||
|
}
|
||||||
|
if(response.data[6].paramValue!=""){
|
||||||
|
this.$set(this.formInline, "SMTP", JSON.parse(response.data[6].paramValue));
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
change() {
|
change() {
|
||||||
|
@ -161,6 +168,7 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
edit() {
|
edit() {
|
||||||
|
this.change()
|
||||||
this.showEdit = false;
|
this.showEdit = false;
|
||||||
this.showSave = true;
|
this.showSave = true;
|
||||||
this.showCancel = true;
|
this.showCancel = true;
|
||||||
|
@ -197,11 +205,13 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
this.query();
|
||||||
this.showEdit = true;
|
this.showEdit = true;
|
||||||
this.showCancel = false;
|
this.showCancel = false;
|
||||||
this.showSave = false;
|
this.showSave = false;
|
||||||
this.show = true;
|
this.show = true;
|
||||||
this.query();
|
this.change()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<el-table :data="tableData" style="width: 100%">
|
<el-table :data="tableData" style="width: 100%">
|
||||||
<el-table-column prop="id" label="ID"/>
|
<el-table-column prop="id" label="ID"/>
|
||||||
<el-table-column prop="name" :label="$t('commons.username')" width="200"/>
|
<el-table-column prop="name" :label="$t('commons.name')" width="200"/>
|
||||||
<el-table-column :label="$t('commons.role')" width="120">
|
<el-table-column :label="$t('commons.role')" width="120">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<ms-roles-tag :roles="scope.row.roles"/>
|
<ms-roles-tag :roles="scope.row.roles"/>
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!--Modify user information in system settings-->
|
<!--Modify user information in system settings-->
|
||||||
<el-dialog :title="$t('user.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true"
|
<el-dialog :title="$t('user.modify')" :visible.sync="updateVisible" width="35%" :destroy-on-close="true"
|
||||||
@close="handleClose">
|
@close="handleClose">
|
||||||
<el-form :model="form" label-position="right" label-width="120px" size="small" :rules="rule" ref="updateUserForm">
|
<el-form :model="form" label-position="right" label-width="120px" size="small" :rules="rule" ref="updateUserForm">
|
||||||
<el-form-item label="ID" prop="id">
|
<el-form-item label="ID" prop="id">
|
||||||
|
|
|
@ -355,6 +355,13 @@
|
||||||
this.$success(this.$t('commons.save_success'));
|
this.$success(this.$t('commons.save_success'));
|
||||||
if (this.operationType == 'add' && this.isCreateContinue) {
|
if (this.operationType == 'add' && this.isCreateContinue) {
|
||||||
this.form.name = '';
|
this.form.name = '';
|
||||||
|
this.form.prerequisite = '';
|
||||||
|
this.form.steps = [{
|
||||||
|
num: 1,
|
||||||
|
desc: '',
|
||||||
|
result: ''
|
||||||
|
}];
|
||||||
|
this.form.remark = '';
|
||||||
this.$emit("refresh");
|
this.$emit("refresh");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue