This commit is contained in:
chenjianxing 2020-09-17 16:43:44 +08:00
commit 4001c981ff
12 changed files with 271 additions and 215 deletions

View File

@ -3,16 +3,20 @@ package io.metersphere.api.jmeter;
import io.metersphere.api.service.APIReportService; import io.metersphere.api.service.APIReportService;
import io.metersphere.api.service.APITestService; import io.metersphere.api.service.APITestService;
import io.metersphere.base.domain.ApiTestReport; import io.metersphere.base.domain.ApiTestReport;
import io.metersphere.base.domain.Notice;
import io.metersphere.commons.constants.APITestStatus; import io.metersphere.commons.constants.APITestStatus;
import io.metersphere.commons.constants.ApiRunMode; import io.metersphere.commons.constants.ApiRunMode;
import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.commons.utils.LogUtil; import io.metersphere.commons.utils.LogUtil;
import io.metersphere.notice.service.MailService;
import io.metersphere.notice.service.NoticeService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.jmeter.assertions.AssertionResult; import org.apache.jmeter.assertions.AssertionResult;
import org.apache.jmeter.samplers.SampleResult; import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.visualizers.backend.AbstractBackendListenerClient; import org.apache.jmeter.visualizers.backend.AbstractBackendListenerClient;
import org.apache.jmeter.visualizers.backend.BackendListenerContext; import org.apache.jmeter.visualizers.backend.BackendListenerContext;
import javax.annotation.Resource;
import java.io.Serializable; import java.io.Serializable;
import java.util.*; import java.util.*;
@ -113,9 +117,12 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
report = apiReportService.getRunningReport(testResult.getTestId()); report = apiReportService.getRunningReport(testResult.getTestId());
} }
apiReportService.complete(testResult, report); apiReportService.complete(testResult, report);
queue.clear(); queue.clear();
super.teardownTest(context); super.teardownTest(context);
NoticeService noticeService = CommonBeanFactory.getBean(NoticeService.class);
List<Notice> notice = noticeService.queryNotice(testResult.getTestId());
MailService mailService = CommonBeanFactory.getBean(MailService.class);
mailService.sendHtml(report.getId(), notice, report.getStatus(), "api");
} }
private RequestResult getRequestResult(SampleResult result) { private RequestResult getRequestResult(SampleResult result) {
@ -170,7 +177,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
this.runMode = context.getParameter("runMode"); this.runMode = context.getParameter("runMode");
this.debugReportId = context.getParameter("debugReportId"); this.debugReportId = context.getParameter("debugReportId");
if (StringUtils.isBlank(this.runMode)) { if (StringUtils.isBlank(this.runMode)) {
this.runMode = ApiRunMode.RUN.name(); this.runMode = ApiRunMode.RUN.name();
} }
} }

View File

@ -223,10 +223,10 @@ public class APITestService {
apiTest.setUserId(request.getUserId()); apiTest.setUserId(request.getUserId());
} }
String reportId = apiReportService.create(apiTest, request.getTriggerMode()); String reportId = apiReportService.create(apiTest, request.getTriggerMode());
if (request.getTriggerMode().equals("SCHEDULE")) { /*if (request.getTriggerMode().equals("SCHEDULE")) {
List<Notice> notice = noticeService.queryNotice(request.getId()); List<Notice> notice = noticeService.queryNotice(request.getId());
mailService.sendHtml(reportId,notice,"api"); mailService.sendHtml(reportId,notice,"api");
} }*/
changeStatus(request.getId(), APITestStatus.Running); changeStatus(request.getId(), APITestStatus.Running);
jMeterService.run(request.getId(), null, is); jMeterService.run(request.getId(), null, is);
return reportId; return reportId;

View File

@ -9,6 +9,7 @@ import io.metersphere.commons.utils.LogUtil;
import io.metersphere.dto.LoadTestDTO; import io.metersphere.dto.LoadTestDTO;
import io.metersphere.service.SystemParameterService; import io.metersphere.service.SystemParameterService;
import io.metersphere.service.UserService; import io.metersphere.service.UserService;
import org.springframework.mail.MailException;
import org.springframework.mail.javamail.JavaMailSenderImpl; import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -30,25 +31,25 @@ public class MailService {
@Resource @Resource
private SystemParameterService systemParameterService; private SystemParameterService systemParameterService;
public void sendHtml(String id, List<Notice> notice,String type) { public void sendHtml(String id, List<Notice> notice, String status, String type) {
JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl(); JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl();
List<SystemParameter> paramList=systemParameterService.getParamList(ParamConstants.Classify.MAIL.getValue()); List<SystemParameter> paramList = systemParameterService.getParamList(ParamConstants.Classify.MAIL.getValue());
javaMailSender.setDefaultEncoding("UTF-8"); javaMailSender.setDefaultEncoding("UTF-8");
javaMailSender.setProtocol("smtps"); javaMailSender.setProtocol("smtps");
for(SystemParameter p:paramList){ for (SystemParameter p : paramList) {
if(p.getParamKey().equals("smtp.host")){ if (p.getParamKey().equals("smtp.host")) {
javaMailSender.setHost(p.getParamValue()); javaMailSender.setHost(p.getParamValue());
}
if(p.getParamKey().equals("smtp.port")){
javaMailSender.setPort(Integer.parseInt(p.getParamValue()));
}
if(p.getParamKey().equals("smtp.account")){
javaMailSender.setUsername(p.getParamValue());
}
if(p.getParamKey().equals("smtp.password")){
javaMailSender.setPassword(EncryptUtils.aesDecrypt(p.getParamValue()).toString());
}
} }
if (p.getParamKey().equals("smtp.port")) {
javaMailSender.setPort(Integer.parseInt(p.getParamValue()));
}
if (p.getParamKey().equals("smtp.account")) {
javaMailSender.setUsername(p.getParamValue());
}
if (p.getParamKey().equals("smtp.password")) {
javaMailSender.setPassword(EncryptUtils.aesDecrypt(p.getParamValue()).toString());
}
}
Properties props = new Properties(); Properties props = new Properties();
props.put("mail.smtp.auth", "true"); props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.starttls.enable", "true");
@ -58,15 +59,12 @@ public class MailService {
javaMailSender.setJavaMailProperties(props); javaMailSender.setJavaMailProperties(props);
MimeMessage mimeMessage = javaMailSender.createMimeMessage(); MimeMessage mimeMessage = javaMailSender.createMimeMessage();
String testName = ""; String testName = "";
String state = "";
if (type.equals("api")) { if (type.equals("api")) {
APIReportResult reportResult = apiAndPerformanceHelper.getApi(id); APIReportResult reportResult = apiAndPerformanceHelper.getApi(id);
testName = reportResult.getTestName(); testName = reportResult.getTestName();
state = reportResult.getStatus();
} else if (type.equals("performance")) { } else if (type.equals("performance")) {
LoadTestDTO performanceResult = apiAndPerformanceHelper.getPerformance(id); LoadTestDTO performanceResult = apiAndPerformanceHelper.getPerformance(id);
testName = performanceResult.getName(); testName = performanceResult.getName();
state = performanceResult.getStatus();
} }
String html1 = "<!DOCTYPE html>\n" + String html1 = "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" + "<html lang=\"en\">\n" +
@ -76,12 +74,12 @@ public class MailService {
"</head>\n" + "</head>\n" +
"<body style=\"text-align: left\">\n" + "<body style=\"text-align: left\">\n" +
" <div>\n" + " <div>\n" +
" <h3>"+type+"定时任务结果通知</h3>\n" + " <h3>" + type + "定时任务结果通知</h3>\n" +
" <p> 尊敬的用户:您好,您所执行的"+testName+"运行失败,请点击报告链接查看</p>\n" + " <p> 尊敬的用户:您好,您所执行的" + testName + "运行失败,请点击报告链接查看</p>\n" +
" </div>\n" + " </div>\n" +
"</body>\n" + "</body>\n" +
"</html>"; "</html>";
String html2="<!DOCTYPE html>\n" + String html2 = "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" + "<html lang=\"en\">\n" +
"<head>\n" + "<head>\n" +
" <meta charset=\"UTF-8\">\n" + " <meta charset=\"UTF-8\">\n" +
@ -89,8 +87,8 @@ public class MailService {
"</head>\n" + "</head>\n" +
"<body style=\"text-align: left\">\n" + "<body style=\"text-align: left\">\n" +
" <div>\n" + " <div>\n" +
" <h3>"+type+"定时任务结果通知</h3>\n" + " <h3>" + type + "定时任务结果通知</h3>\n" +
" <p> 尊敬的用户:您好,"+testName+"运行成功,请点击报告链接查看</p>\n" + " <p> 尊敬的用户:您好," + testName + "运行成功,请点击报告链接查看</p>\n" +
" </div>\n" + " </div>\n" +
"</body>\n" + "</body>\n" +
"</html>"; "</html>";
@ -99,36 +97,40 @@ public class MailService {
helper.setFrom(javaMailSender.getUsername()); helper.setFrom(javaMailSender.getUsername());
helper.setSubject("MeterSphere定时任务结果通知"); helper.setSubject("MeterSphere定时任务结果通知");
String users[] = {}; String users[] = {};
List<String> successEmailList=new ArrayList<>(); List<String> successEmailList = new ArrayList<>();
List<String> failEmailList=new ArrayList<>(); List<String> failEmailList = new ArrayList<>();
if(notice.size()>0){ if (notice.size() > 0) {
for(Notice n:notice){ for (Notice n : notice) {
if (n.getEnable().equals("true")&&n.getEvent().equals("执行成功")) { if (n.getEnable().equals("true") && n.getEvent().equals("执行成功")) {
successEmailList=userService.queryEmail(n.getNames()); successEmailList = userService.queryEmail(n.getNames());
} }
if (n.getEnable().equals("true")&&n.getEvent().equals("执行失败")) { if (n.getEnable().equals("true") && n.getEvent().equals("执行失败")) {
failEmailList=userService.queryEmail(n.getNames()); failEmailList = userService.queryEmail(n.getNames());
} }
} }
}else{ } else {
LogUtil.error("Recipient information is empty"); LogUtil.error("Recipient information is empty");
} }
if(state.equals("success")){ if (status.equals("Success")) {
users=successEmailList.toArray(new String[successEmailList.size()]); users = successEmailList.toArray(new String[successEmailList.size()]);
helper.setText(html2,true); helper.setText(html2, true);
}else{ } else {
users=failEmailList.toArray(new String[failEmailList.size()]); users = failEmailList.toArray(new String[failEmailList.size()]);
helper.setText(html1,true); helper.setText(html1, true);
} }
helper.setTo(users); helper.setTo(users);
javaMailSender.send(mimeMessage);
} catch (MessagingException e) { } catch (MessagingException e) {
e.printStackTrace(); e.printStackTrace();
} }
try {
javaMailSender.send(mimeMessage);
} catch (MailException e) {
e.printStackTrace();
}
} }

View File

@ -16,53 +16,77 @@ import java.util.List;
public class NoticeService { public class NoticeService {
@Resource @Resource
private NoticeMapper noticeMapper; private NoticeMapper noticeMapper;
public void saveNotice(NoticeRequest noticeRequest) { public void saveNotice(NoticeRequest noticeRequest) {
Notice notice = new Notice();
NoticeExample example = new NoticeExample(); NoticeExample example = new NoticeExample();
example.createCriteria().andTestIdEqualTo(noticeRequest.getTestId()); example.createCriteria().andTestIdEqualTo(noticeRequest.getTestId());
List<Notice> notices = noticeMapper.selectByExample(example); List<Notice> notices = noticeMapper.selectByExample(example);
if (notices != null) { if (notices.size() > 0) {
noticeMapper.deleteByExample(example); noticeMapper.deleteByExample(example);
noticeRequest.getNotices().forEach(notice -> { noticeRequest.getNotices().forEach(n -> {
for(String x:notice.getNames()){ if (n.getNames().length > 0) {
notice.setEvent(notice.getEvent()); for (String x : n.getNames()) {
notice.setEmail(notice.getEmail()); notice.setEvent(n.getEvent());
notice.setEnable(notice.getEnable()); notice.setEmail(n.getEmail());
notice.setEnable(n.getEnable());
notice.setTestId(noticeRequest.getTestId());
notice.setName(x);
noticeMapper.insert(notice);
}
} else {
notice.setEvent(n.getEvent());
notice.setEmail(n.getEmail());
notice.setEnable(n.getEnable());
notice.setTestId(noticeRequest.getTestId()); notice.setTestId(noticeRequest.getTestId());
notice.setName(x); notice.setName("");
noticeMapper.insert(notice); noticeMapper.insert(notice);
} }
}); });
} else { } else {
noticeRequest.getNotices().forEach(notice -> { noticeRequest.getNotices().forEach(n -> {
notice.setEvent(noticeRequest.getEvent()); if (n.getNames().length > 0) {
notice.setTestId(noticeRequest.getTestId()); for (String x : n.getNames()) {
noticeMapper.insert(notice); notice.setEvent(n.getEvent());
notice.setEmail(n.getEmail());
notice.setEnable(n.getEnable());
notice.setTestId(noticeRequest.getTestId());
notice.setName(x);
noticeMapper.insert(notice);
}
} else {
notice.setEvent(n.getEvent());
notice.setEmail(n.getEmail());
notice.setEnable(n.getEnable());
notice.setTestId(noticeRequest.getTestId());
notice.setName("");
noticeMapper.insert(notice);
}
}); });
} }
} }
public List<Notice> queryNotice(String id) { public List<Notice> queryNotice(String id) {
NoticeExample example = new NoticeExample(); NoticeExample example = new NoticeExample();
example.createCriteria().andTestIdEqualTo(id); example.createCriteria().andTestIdEqualTo(id);
List<Notice> notices=noticeMapper.selectByExample(example); List<Notice> notices = noticeMapper.selectByExample(example);
List<Notice> notice=new ArrayList<>(); List<Notice> notice = new ArrayList<>();
List<String> success=new ArrayList<>(); List<String> success = new ArrayList<>();
List<String> fail=new ArrayList<>(); List<String> fail = new ArrayList<>();
String[] successArray=new String[success.size()]; String[] successArray = new String[success.size()];
String[] failArray=new String[fail.size()]; String[] failArray = new String[fail.size()];
Notice notice1=new Notice(); Notice notice1 = new Notice();
Notice notice2=new Notice(); Notice notice2 = new Notice();
if(notices.size()>0){ if (notices.size() > 0) {
for(Notice n:notices){ for (Notice n : notices) {
if(n.getEvent().equals("执行成功")){ if (n.getEvent().equals("执行成功")) {
success.add(n.getName()); success.add(n.getName());
notice1.setEnable(n.getEnable()); notice1.setEnable(n.getEnable());
notice1.setTestId(id); notice1.setTestId(id);
notice1.setEvent(n.getEvent()); notice1.setEvent(n.getEvent());
notice1.setEmail(n.getEmail()); notice1.setEmail(n.getEmail());
} }
if(n.getEvent().equals("执行失败")){ if (n.getEvent().equals("执行失败")) {
fail.add(n.getName()); fail.add(n.getName());
notice2.setEnable(n.getEnable()); notice2.setEnable(n.getEnable());
notice2.setTestId(id); notice2.setTestId(id);
@ -70,8 +94,8 @@ public class NoticeService {
notice2.setEmail(n.getEmail()); notice2.setEmail(n.getEmail());
} }
} }
successArray=success.toArray(new String[success.size()]); successArray = success.toArray(new String[success.size()]);
failArray=fail.toArray(new String[fail.size()]); failArray = fail.toArray(new String[fail.size()]);
notice1.setNames(successArray); notice1.setNames(successArray);
notice2.setNames(failArray); notice2.setNames(failArray);
notice.add(notice1); notice.add(notice1);

View File

@ -442,8 +442,10 @@ public class JmeterDocumentParser implements DocumentParser {
// 增加一个response_timeout避免目标网站不反回结果导致测试不能结束 // 增加一个response_timeout避免目标网站不反回结果导致测试不能结束
if (item instanceof Element && nodeNameEquals(item, STRING_PROP) if (item instanceof Element && nodeNameEquals(item, STRING_PROP)
&& StringUtils.equals(((Element) item).getAttribute("name"), "HTTPSampler.response_timeout")) { && StringUtils.equals(((Element) item).getAttribute("name"), "HTTPSampler.response_timeout")) {
removeChildren(item); if (context.getProperty("responseTimeout") != null) {
item.appendChild(ele.getOwnerDocument().createTextNode("")); removeChildren(item);
item.appendChild(ele.getOwnerDocument().createTextNode(context.getProperty("responseTimeout").toString()));
}
} }
} }
} }

View File

@ -239,7 +239,7 @@ public class PerformanceTestService {
startEngine(loadTest, engine, request.getTriggerMode()); startEngine(loadTest, engine, request.getTriggerMode());
if (request.getTriggerMode().equals("SCHEDULE")) { if (request.getTriggerMode().equals("SCHEDULE")) {
List<Notice> notice = noticeService.queryNotice(request.getId()); List<Notice> notice = noticeService.queryNotice(request.getId());
mailService.sendHtml(engine.getReportId(),notice,"performance"); mailService.sendHtml(engine.getReportId(), notice, "success", "performance");
} }
return engine.getReportId(); return engine.getReportId();
} }

View File

@ -71,6 +71,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-button type="primary" @click="saveNotice">{{$t('commons.save')}}</el-button>
</template> </template>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -206,9 +207,11 @@
return false; return false;
} }
}); });
},
saveNotice(){
let param = this.buildParam(); let param = this.buildParam();
this.result = this.$post("notice/save", param, () => { this.result = this.$post("notice/save", param, () => {
this.$success(this.$t('commons.save_success'));
}) })
}, },
close() { close() {

View File

@ -90,6 +90,20 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
<el-col :span="8">
<el-form :inline="true">
<el-form-item>
<div>{{ $t('load_test.response_timeout') }}</div>
</el-form-item>
<el-form-item>
<el-input-number :disabled="readOnly" size="mini" v-model="responseTimeout" :min="10"
:max="100000"></el-input-number>
</el-form-item>
<el-form-item>
ms
</el-form-item>
</el-form>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
@ -109,169 +123,170 @@
</template> </template>
<script> <script>
import MsTableOperatorButton from "../../../common/components/MsTableOperatorButton"; import MsTableOperatorButton from "../../../common/components/MsTableOperatorButton";
export default { export default {
name: "PerformanceAdvancedConfig", name: "PerformanceAdvancedConfig",
components: {MsTableOperatorButton}, components: {MsTableOperatorButton},
data() { data() {
return { return {
timeout: 2000, timeout: 2000,
statusCode: [], responseTimeout: null,
domains: [], statusCode: [],
params: [], domains: [],
statusCodeStr: '', params: [],
} statusCodeStr: '',
}
},
props: {
readOnly: {
type: Boolean,
default: false
}, },
props: { testId: String,
readOnly: { },
type: Boolean, mounted() {
default: false if (this.testId) {
}, this.getAdvancedConfig();
testId: String, }
}, },
mounted() { watch: {
testId() {
if (this.testId) { if (this.testId) {
this.getAdvancedConfig(); this.getAdvancedConfig();
} }
}, }
watch: { },
testId() { methods: {
if (this.testId) { getAdvancedConfig() {
this.getAdvancedConfig(); this.$get('/performance/get-advanced-config/' + this.testId, (response) => {
if (response.data) {
let data = JSON.parse(response.data);
this.timeout = data.timeout || 10;
this.responseTimeout = data.responseTimeout;
this.statusCode = data.statusCode || [];
this.statusCodeStr = this.statusCode.join(',');
this.domains = data.domains || [];
this.params = data.params || [];
} }
});
},
add(dataName) {
if (dataName === 'domains') {
this[dataName].push({
domain: 'fit2cloud.com',
enable: true,
ip: '127.0.0.1',
edit: true,
});
}
if (dataName === 'params') {
this[dataName].push({
name: 'param1',
enable: true,
value: '0',
edit: true,
});
} }
}, },
methods: { edit(row) {
getAdvancedConfig() { row.edit = !row.edit
this.$get('/performance/get-advanced-config/' + this.testId, (response) => { },
if (response.data) { del(row, dataName, index) {
let data = JSON.parse(response.data); this[dataName].splice(index, 1);
this.timeout = data.timeout || 10; },
this.statusCode = data.statusCode || []; confirmEdit(row) {
this.statusCodeStr = this.statusCode.join(','); row.edit = false;
this.domains = data.domains || []; row.enable = true;
this.params = data.params || []; },
/*this.domains.forEach(d => d.edit = false); groupBy(data, key) {
this.params.forEach(d => d.edit = false);*/ return data.reduce((p, c) => {
} let name = c[key];
}); if (!p.hasOwnProperty(name)) {
}, p[name] = 0;
add(dataName) {
if (dataName === 'domains') {
this[dataName].push({
domain: 'fit2cloud.com',
enable: true,
ip: '127.0.0.1',
edit: true,
});
} }
if (dataName === 'params') { p[name]++;
this[dataName].push({ return p;
name: 'param1', }, {});
enable: true, },
value: '0', validConfig() {
edit: true, let counts = this.groupBy(this.domains, 'domain');
}); for (let c in counts) {
} if (counts[c] > 1) {
}, this.$error(this.$t('load_test.domain_is_duplicate'));
edit(row) {
row.edit = !row.edit
},
del(row, dataName, index) {
this[dataName].splice(index, 1);
},
confirmEdit(row) {
row.edit = false;
row.enable = true;
},
groupBy(data, key) {
return data.reduce((p, c) => {
let name = c[key];
if (!p.hasOwnProperty(name)) {
p[name] = 0;
}
p[name]++;
return p;
}, {});
},
validConfig() {
let counts = this.groupBy(this.domains, 'domain');
for (let c in counts) {
if (counts[c] > 1) {
this.$error(this.$t('load_test.domain_is_duplicate'));
return false;
}
}
counts = this.groupBy(this.params, 'name');
for (let c in counts) {
if (counts[c] > 1) {
this.$error(this.$t('load_test.param_is_duplicate'));
return false;
}
}
if (this.domains.filter(d => !d.domain || !d.ip).length > 0) {
this.$error(this.$t('load_test.domain_ip_is_empty'));
return false; return false;
} }
if (this.params.filter(d => !d.name || !d.value).length > 0) { }
this.$error(this.$t('load_test.param_name_value_is_empty')); counts = this.groupBy(this.params, 'name');
for (let c in counts) {
if (counts[c] > 1) {
this.$error(this.$t('load_test.param_is_duplicate'));
return false; return false;
} }
return true; }
}, if (this.domains.filter(d => !d.domain || !d.ip).length > 0) {
checkStatusCode() { this.$error(this.$t('load_test.domain_ip_is_empty'));
let license_num = this.statusCodeStr; return false;
license_num = license_num.replace(/[^\d,]/g, ''); // . }
this.statusCodeStr = license_num; if (this.params.filter(d => !d.name || !d.value).length > 0) {
}, this.$error(this.$t('load_test.param_name_value_is_empty'));
cancelAllEdit() { return false;
this.domains.forEach(d => d.edit = false); }
this.params.forEach(d => d.edit = false); return true;
}, },
configurations() { checkStatusCode() {
let statusCode = []; let license_num = this.statusCodeStr;
if (this.statusCodeStr) { license_num = license_num.replace(/[^\d,]/g, ''); // .
statusCode = this.statusCodeStr.split(','); this.statusCodeStr = license_num;
} },
return { cancelAllEdit() {
timeout: this.timeout, this.domains.forEach(d => d.edit = false);
statusCode: statusCode, this.params.forEach(d => d.edit = false);
params: this.params, },
domains: this.domains, configurations() {
}; let statusCode = [];
}, if (this.statusCodeStr) {
} statusCode = this.statusCodeStr.split(',');
}
return {
timeout: this.timeout,
responseTimeout: this.responseTimeout,
statusCode: statusCode,
params: this.params,
domains: this.domains,
};
},
} }
}
</script> </script>
<style scoped> <style scoped>
.el-row { .el-row {
margin-bottom: 10px; margin-bottom: 10px;
} }
.edit-input { .edit-input {
padding-right: 0px; padding-right: 0px;
} }
.tb-edit .el-textarea { .tb-edit .el-textarea {
display: none; display: none;
} }
.tb-edit .current-row .el-textarea { .tb-edit .current-row .el-textarea {
display: block; display: block;
} }
.tb-edit .current-row .el-textarea + span { .tb-edit .current-row .el-textarea + span {
display: none; display: none;
} }
.el-col { .el-col {
text-align: left; text-align: left;
} }
.el-col .el-table { .el-col .el-table {
align: center; align: center;
} }
</style> </style>

@ -1 +1 @@
Subproject commit 0a375848d034d20eaf05caf11769e1c75c39235c Subproject commit f2d5a342c82e629f510550d5778d752bb73bf5e7

View File

@ -378,6 +378,7 @@ export default {
domain_ip_is_empty: 'Domain and IP cannot be empty', domain_ip_is_empty: 'Domain and IP cannot be empty',
param_name_value_is_empty: 'Parameters cannot be empty', param_name_value_is_empty: 'Parameters cannot be empty',
connect_timeout: 'Timeout to establish a connection', connect_timeout: 'Timeout to establish a connection',
response_timeout: 'Timeout to response',
custom_http_code: 'Custom HTTP response success status code', custom_http_code: 'Custom HTTP response success status code',
separated_by_commas: 'Separated by commas', separated_by_commas: 'Separated by commas',
create: 'Create Test', create: 'Create Test',

View File

@ -377,6 +377,7 @@ export default {
domain_ip_is_empty: '域名和IP不能为空', domain_ip_is_empty: '域名和IP不能为空',
param_name_value_is_empty: '参数名和参数值不能为空', param_name_value_is_empty: '参数名和参数值不能为空',
connect_timeout: '建立连接超时时间', connect_timeout: '建立连接超时时间',
response_timeout: '响应超时时间',
custom_http_code: '自定义 HTTP 响应成功状态码', custom_http_code: '自定义 HTTP 响应成功状态码',
separated_by_commas: '按逗号分隔', separated_by_commas: '按逗号分隔',
create: '创建测试', create: '创建测试',

View File

@ -377,6 +377,7 @@ export default {
domain_ip_is_empty: '域名和IP不能為空', domain_ip_is_empty: '域名和IP不能為空',
param_name_value_is_empty: '參數名和參數值不能為空', param_name_value_is_empty: '參數名和參數值不能為空',
connect_timeout: '建立連接超時時間', connect_timeout: '建立連接超時時間',
response_timeout: '響應超時時間',
custom_http_code: '自定義 HTTP 響應成功狀態碼', custom_http_code: '自定義 HTTP 響應成功狀態碼',
separated_by_commas: '按逗號分隔', separated_by_commas: '按逗號分隔',
create: '創建測試', create: '創建測試',