Merge remote-tracking branch 'origin/master'

This commit is contained in:
song.tianyang 2020-12-24 10:16:34 +08:00
commit f71d60fe54
20 changed files with 240 additions and 134 deletions

View File

@ -55,7 +55,9 @@ public class MsScenario extends MsTestElement {
if (StringUtils.isNotEmpty(environmentId)) { if (StringUtils.isNotEmpty(environmentId)) {
ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class); ApiTestEnvironmentService environmentService = CommonBeanFactory.getBean(ApiTestEnvironmentService.class);
ApiTestEnvironmentWithBLOBs environment = environmentService.get(environmentId); ApiTestEnvironmentWithBLOBs environment = environmentService.get(environmentId);
config.setConfig(JSONObject.parseObject(environment.getConfig(), EnvironmentConfig.class)); if (environment != null && environment.getConfig() != null) {
config.setConfig(JSONObject.parseObject(environment.getConfig(), EnvironmentConfig.class));
}
} }
if (CollectionUtils.isNotEmpty(this.getVariables())) { if (CollectionUtils.isNotEmpty(this.getVariables())) {
config.setVariables(this.variables); config.setVariables(this.variables);

View File

@ -116,11 +116,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
} }
try { try {
if (config != null && config.getConfig() != null) { if (config != null && config.getConfig() != null) {
String url = ""; String url = config.getConfig().getHttpConfig().getProtocol() + "://" + config.getConfig().getHttpConfig().getSocket();
sampler.setDomain(config.getConfig().getHttpConfig().getDomain());
sampler.setPort(config.getConfig().getHttpConfig().getPort());
sampler.setProtocol(config.getConfig().getHttpConfig().getProtocol());
url = config.getConfig().getHttpConfig().getProtocol() + "://" + config.getConfig().getHttpConfig().getSocket();
// 补充如果是完整URL 则用自身URL // 补充如果是完整URL 则用自身URL
boolean isUrl = false; boolean isUrl = false;
if (StringUtils.isNotEmpty(this.getUrl()) && isURL(this.getUrl())) { if (StringUtils.isNotEmpty(this.getUrl()) && isURL(this.getUrl())) {
@ -128,12 +124,21 @@ public class MsHTTPSamplerProxy extends MsTestElement {
isUrl = true; isUrl = true;
} }
URL urlObject = new URL(url); URL urlObject = new URL(url);
if (isUrl) {
sampler.setDomain(URLDecoder.decode(urlObject.getHost(), "UTF-8"));
sampler.setPort(urlObject.getPort());
sampler.setProtocol(urlObject.getProtocol());
} else {
sampler.setDomain(config.getConfig().getHttpConfig().getDomain());
sampler.setPort(config.getConfig().getHttpConfig().getPort());
sampler.setProtocol(config.getConfig().getHttpConfig().getProtocol());
}
String envPath = StringUtils.equals(urlObject.getPath(), "/") ? "" : urlObject.getPath(); String envPath = StringUtils.equals(urlObject.getPath(), "/") ? "" : urlObject.getPath();
if (StringUtils.isNotBlank(this.getPath()) && !isUrl) { if (StringUtils.isNotBlank(this.getPath()) && !isUrl) {
envPath += this.getPath(); envPath += this.getPath();
} }
if (CollectionUtils.isNotEmpty(this.getRest()) && this.isRest()) { if (CollectionUtils.isNotEmpty(this.getRest()) && this.isRest()) {
envPath = getRestParameters(URLDecoder.decode(envPath, "UTF-8")); envPath = getRestParameters(URLDecoder.decode(envPath, "UTF-8"), config);
sampler.setPath(envPath); sampler.setPath(envPath);
} }
if (CollectionUtils.isNotEmpty(this.getArguments())) { if (CollectionUtils.isNotEmpty(this.getArguments())) {
@ -150,7 +155,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
sampler.setProtocol(urlObject.getProtocol()); sampler.setProtocol(urlObject.getProtocol());
if (CollectionUtils.isNotEmpty(this.getRest()) && this.isRest()) { if (CollectionUtils.isNotEmpty(this.getRest()) && this.isRest()) {
sampler.setPath(getRestParameters(URLDecoder.decode(urlObject.getPath(), "UTF-8"))); sampler.setPath(getRestParameters(URLDecoder.decode(urlObject.getPath(), "UTF-8"), config));
} }
if (CollectionUtils.isNotEmpty(this.getArguments())) { if (CollectionUtils.isNotEmpty(this.getArguments())) {
sampler.setPath(getPostQueryParameters(URLDecoder.decode(urlObject.getPath(), "UTF-8"))); sampler.setPath(getPostQueryParameters(URLDecoder.decode(urlObject.getPath(), "UTF-8")));
@ -193,7 +198,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
} }
} }
private String getRestParameters(String path) { private String getRestParameters(String path, ParameterConfig config) {
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(path); stringBuffer.append(path);
stringBuffer.append("/"); stringBuffer.append("/");
@ -201,14 +206,31 @@ public class MsHTTPSamplerProxy extends MsTestElement {
this.getRest().stream().filter(KeyValue::isEnable).filter(KeyValue::isValid).forEach(keyValue -> this.getRest().stream().filter(KeyValue::isEnable).filter(KeyValue::isValid).forEach(keyValue ->
keyValueMap.put(keyValue.getName(), keyValue.getValue()) keyValueMap.put(keyValue.getName(), keyValue.getValue())
); );
// 这块是否使用jmeter自身机制
Map<String, String> pubKeyValueMap = new HashMap<>();
if (config != null && config.getVariables() != null) {
config.getVariables().stream().forEach(keyValue -> {
pubKeyValueMap.put(keyValue.getName(), keyValue.getValue());
});
}
for (String key : keyValueMap.keySet()) {
if (keyValueMap.get(key) != null && keyValueMap.get(key).startsWith("$")) {
String pubKey = keyValueMap.get(key).substring(2, keyValueMap.get(key).length() - 1);
keyValueMap.put(key, pubKeyValueMap.get(pubKey));
}
}
Pattern p = Pattern.compile("(\\{)([\\w]+)(\\})"); Pattern p = Pattern.compile("(\\{)([\\w]+)(\\})");
Matcher m = p.matcher(path); Matcher m = p.matcher(path);
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
while (m.find()) { try {
String group = m.group(2); while (m.find()) {
//替换并且把替换好的值放到sb中 String group = m.group(2);
m.appendReplacement(sb, keyValueMap.get(group)); //替换并且把替换好的值放到sb中
m.appendReplacement(sb, keyValueMap.get(group));
}
} catch (Exception ex) {
ex.printStackTrace();
} }
//把符合的数据追加到sb尾 //把符合的数据追加到sb尾
m.appendTail(sb); m.appendTail(sb);

@ -1 +1 @@
Subproject commit 9f4a9bbf46fc1333dbcccea21f83e27e3ec10b1f Subproject commit 79343a2763b014355f91fc21b2356a95ae437973

View File

@ -33,6 +33,7 @@
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-calendar-heatmap": "^0.8.4", "vue-calendar-heatmap": "^0.8.4",
"vue-echarts": "^4.1.0", "vue-echarts": "^4.1.0",
"vue-float-action-button": "^0.6.6",
"vue-i18n": "^8.15.3", "vue-i18n": "^8.15.3",
"vue-input-tag": "^2.0.7", "vue-input-tag": "^2.0.7",
"vue-pdf": "^4.2.0", "vue-pdf": "^4.2.0",

View File

@ -2,14 +2,15 @@
<div class="text-container"> <div class="text-container">
<el-collapse-transition> <el-collapse-transition>
<el-tabs v-model="activeName" v-show="isActive"> <el-tabs v-model="activeName" v-show="isActive">
<el-tab-pane :label="$t('api_test.definition.request.response_header')" name="headers" class="pane">
<pre>{{ response.headers }}</pre>
</el-tab-pane>
<el-tab-pane :class="'body-pane'" :label="$t('api_test.definition.request.response_body')" name="body" class="pane"> <el-tab-pane :class="'body-pane'" :label="$t('api_test.definition.request.response_body')" name="body" class="pane">
<ms-sql-result-table v-if="isSqlType" :body="response.body"/> <ms-sql-result-table v-if="isSqlType" :body="response.body"/>
<ms-code-edit v-if="!isSqlType" :mode="mode" :read-only="true" :data="response.body" :modes="modes" ref="codeEdit"/> <ms-code-edit v-if="!isSqlType" :mode="mode" :read-only="true" :data="response.body" :modes="modes" ref="codeEdit"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.definition.request.response_header')" name="headers" class="pane">
<pre>{{ response.headers }}</pre>
</el-tab-pane>
<el-tab-pane :label="$t('api_test.definition.request.console')" name="console" class="pane"> <el-tab-pane :label="$t('api_test.definition.request.console')" name="console" class="pane">
<pre>{{response.console}}</pre> <pre>{{response.console}}</pre>
</el-tab-pane> </el-tab-pane>

View File

@ -182,42 +182,19 @@
</el-col> </el-col>
<!-- 按钮列表 --> <!-- 按钮列表 -->
<div> <div>
<el-col :span="3" class="ms-left-cell"> <el-col :span="3">
<el-button type="primary" icon="el-icon-refresh" size="small" @click="showAll">{{$t('commons.show_all')}}</el-button> <vue-fab id="fab" mainBtnColor="#783887" :click-auto-close="false">
<br/> <fab-item
<div v-if="operatingElements.indexOf('HTTPSamplerProxy')!=-1 || operatingElements.indexOf('DubboSampler')!=-1 || operatingElements.indexOf('JDBCSampler')!=-1 || operatingElements.indexOf('TCPSampler')!=-1 "> v-for="(item, index) in buttons"
<el-button class="ms-right-buttion ms-btn-1" size="small" @click="apiListImport">+{{$t('api_test.automation.api_list_import')}}</el-button> :key="index"
</div> :idx="getIdx(index)"
<div v-if="operatingElements.indexOf('OT_IMPORT')!=-1"> :title="item.title"
<el-button class="ms-right-buttion" size="small" style="color: #409EFF;background-color: #EEF5FE" @click="addComponent('OT_IMPORT')">+{{$t('api_test.automation.external_import')}}</el-button> :title-bg-color="item.titleBgColor"
</div> :title-color="item.titleColor"
<div v-if="operatingElements.indexOf('ConstantTimer')!=-1"> :color="item.titleColor"
<el-button class="ms-right-buttion ms-btn-3" size="small" @click="addComponent('ConstantTimer')">+{{$t('api_test.automation.wait_controller')}}</el-button> :icon="item.icon"
</div> @clickItem="item.click"/>
<div v-if="operatingElements.indexOf('IfController')!=-1"> </vue-fab>
<el-button class="ms-right-buttion ms-btn-4" size="small" @click="addComponent('IfController')">+{{$t('api_test.automation.if_controller')}}</el-button>
</div>
<div v-if="operatingElements.indexOf('scenario')===0">
<el-button class="ms-right-buttion ms-btn-5" size="small" @click="addComponent('scenario')">+{{$t('api_test.automation.scenario_import')}}</el-button>
</div>
<div v-if="operatingElements.indexOf('JSR223Processor')!=-1">
<el-button class="ms-right-buttion ms-btn-6" size="small" @click="addComponent('JSR223Processor')">+{{$t('api_test.automation.customize_script')}}</el-button>
</div>
<div v-if="operatingElements.indexOf('CustomizeReq')!=-1">
<el-button class="ms-right-buttion ms-btn-7" size="small" @click="addComponent('CustomizeReq')">+{{$t('api_test.automation.customize_req')}}</el-button>
</div>
<div v-if="operatingElements.indexOf('JSR223PreProcessor')!=-1">
<el-button class="ms-right-buttion ms-btn-8" size="small" @click="addComponent('JSR223PreProcessor')">+{{$t('api_test.definition.request.pre_script')}}</el-button>
</div>
<div v-if="operatingElements.indexOf('JSR223PostProcessor')!=-1">
<el-button class="ms-right-buttion ms-btn-9" size="small" @click="addComponent('JSR223PostProcessor')">+{{$t('api_test.definition.request.post_script')}}</el-button>
</div>
<div v-if="operatingElements.indexOf('Assertions')!=-1">
<el-button class="ms-right-buttion ms-btn-10" size="small" @click="addComponent('Assertions')">+{{$t('api_test.definition.request.assertions_rule')}}</el-button>
</div>
<div v-if="operatingElements.indexOf('Extract')!=-1">
<el-button class="ms-right-buttion ms-btn-11" size="small" @click="addComponent('Extract')">+{{$t('api_test.definition.request.extract_param')}}</el-button>
</div>
</el-col> </el-col>
</div> </div>
</el-row> </el-row>
@ -282,6 +259,7 @@
import MsScenarioParameters from "./ScenarioParameters"; import MsScenarioParameters from "./ScenarioParameters";
import ApiImport from "../../definition/components/import/ApiImport"; import ApiImport from "../../definition/components/import/ApiImport";
import InputTag from 'vue-input-tag' import InputTag from 'vue-input-tag'
import "@/common/css/material-icons.css"
export default { export default {
name: "EditApiScenario", name: "EditApiScenario",
@ -358,12 +336,127 @@
this.operatingElements = ELEMENTS.get("ALL"); this.operatingElements = ELEMENTS.get("ALL");
this.getMaintainerOptions(); this.getMaintainerOptions();
this.getApiScenario(); this.getApiScenario();
this.getEnvironments();
} }
, ,
watch: {} watch: {}
, ,
computed: {
buttons() {
let buttons = [
{
title: this.$t('api_test.automation.api_list_import'),
show: this.showButton("HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler"),
titleColor: "#F56C6C",
titleBgColor: "#FCF1F1",
icon: "api",
click: this.apiListImport
}, {
title: this.$t('api_test.automation.external_import'),
show: this.showButton("OT_IMPORT"),
titleColor: "#409EFF",
titleBgColor: "#EEF5FE",
icon: "next_plan",
click: () => {
this.addComponent('OT_IMPORT')
}
}, {
title: this.$t('api_test.automation.wait_controller'),
show: this.showButton("ConstantTimer"),
titleColor: "#67C23A",
titleBgColor: "#F2F9EE",
icon: "access_time",
click: () => {
this.addComponent('ConstantTimer')
}
}, {
title: this.$t('api_test.automation.if_controller'),
show: this.showButton("IfController"),
titleColor: "#E6A23C",
titleBgColor: "#FCF6EE",
icon: "alt_route",
click: () => {
this.addComponent('IfController')
}
}, {
title: this.$t('api_test.automation.scenario_import'),
show: this.operatingElements.indexOf('scenario') === 0,
titleColor: "#606266",
titleBgColor: "#F4F4F5",
icon: "movie",
click: () => {
this.addComponent('scenario')
}
}, {
title: this.$t('api_test.automation.customize_script'),
show: this.showButton("JSR223Processor"),
titleColor: "#7B4D12",
titleBgColor: "#F1EEE9",
icon: "code",
click: () => {
this.addComponent('JSR223Processor')
}
}, {
title: this.$t('api_test.automation.customize_req'),
show: this.showButton("CustomizeReq"),
titleColor: "#008080",
titleBgColor: "#EBF2F2",
icon: "tune",
click: () => {
this.addComponent('CustomizeReq')
}
}, {
title: this.$t('api_test.definition.request.pre_script'),
show: this.showButton("JSR223PreProcessor"),
titleColor: "#B8741A",
titleBgColor: "#F9F1EA",
icon: "skip_previous",
click: () => {
this.addComponent('JSR223PreProcessor')
}
}, {
title: this.$t('api_test.definition.request.post_script'),
show: this.showButton("JSR223PostProcessor"),
titleColor: "#783887",
titleBgColor: "#F2ECF3",
icon: "skip_next",
click: () => {
this.addComponent('JSR223PostProcessor')
}
}, {
title: this.$t('api_test.definition.request.assertions_rule'),
show: this.showButton("Assertions"),
titleColor: "#A30014",
titleBgColor: "#F7E6E9",
icon: "fact_check",
click: () => {
this.addComponent('Assertions')
}
}, {
title: this.$t('api_test.definition.request.extract_param'),
show: this.showButton("Extract"),
titleColor: "#015478",
titleBgColor: "#E6EEF2",
icon: "colorize",
click: () => {
this.addComponent('Extract')
}
}
];
return buttons.filter(btn => btn.show);
}
},
methods: { methods: {
getIdx(index) {
return -1 * index - 2.25; //
},
showButton(...names) {
for (const name of names) {
if (this.operatingElements.includes(name)) {
return true;
}
}
return false;
},
addComponent(type) { addComponent(type) {
switch (type) { switch (type) {
case ELEMENT_TYPE.IfController: case ELEMENT_TYPE.IfController:
@ -586,6 +679,16 @@
this.environments.forEach(environment => { this.environments.forEach(environment => {
parseEnvironment(environment); parseEnvironment(environment);
}); });
let hasEnvironment = false;
for (let i in this.environments) {
if (this.environments[i].id === this.currentEnvironmentId) {
hasEnvironment = true;
break;
}
}
if (!hasEnvironment) {
this.currentEnvironmentId = '';
}
}); });
} }
} }
@ -718,8 +821,7 @@
}) })
} }
}) })
} },
,
getApiScenario() { getApiScenario() {
if (this.currentScenario.tags != undefined && !(this.currentScenario.tags instanceof Array)) { if (this.currentScenario.tags != undefined && !(this.currentScenario.tags instanceof Array)) {
this.currentScenario.tags = JSON.parse(this.currentScenario.tags); this.currentScenario.tags = JSON.parse(this.currentScenario.tags);
@ -741,6 +843,7 @@
this.path = "/api/automation/create"; this.path = "/api/automation/create";
} }
} }
this.getEnvironments();
}) })
} }
} }
@ -842,63 +945,10 @@
margin-top: 5px; margin-top: 5px;
} }
.ms-right-buttion { #fab {
margin-top: 10px; bottom: unset;
} right: 90px;
z-index: 5;
.ms-btn-1 {
color: #F56C6C;
background-color: #FCF1F1
}
.ms-btn-2 {
color: #F56C6C;
background-color: #FCF1F1
}
.ms-btn-3 {
color: #67C23A;
background-color: #F2F9EE
}
.ms-btn-4 {
color: #E6A23C;
background-color: #FCF6EE
}
.ms-btn-5 {
color: #606266;
background-color: #F4F4F5
}
.ms-btn-6 {
color: #7B4D12;
background-color: #F1EEE9
}
.ms-btn-7 {
color: #008080;
background-color: #EBF2F2
}
.ms-btn-8 {
color: #B8741A;
background-color: #F9F1EA
}
.ms-btn-9 {
color: #783887;
background-color: #F2ECF3
}
.ms-btn-10 {
color: #A30014;
background-color: #F7E6E9
}
.ms-btn-11 {
color: #015478;
background-color: #E6EEF2
} }
/deep/ .el-tree-node__content { /deep/ .el-tree-node__content {
@ -944,5 +994,4 @@
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px; font-size: 13px;
} }
</style> </style>

View File

@ -31,14 +31,14 @@
<style scoped> <style scoped>
ms-input-tag-wrapper >>> .vue-input-tag-wrapper { .ms-input-tag-wrapper >>> .vue-input-tag-wrapper {
border-radius: 2px; border-radius: 2px;
border: 1px solid #a5d24a; border: 1px solid #a5d24a;
color: #909399; color: #909399;
display: inline-block; display: inline-block;
} }
ms-input-remove >>> .remove { .ms-input-remove >>> .remove {
color: #909399; color: #909399;
} }

View File

@ -266,7 +266,7 @@
}, },
saveApi(data) { saveApi(data) {
this.setTabTitle(data); this.setTabTitle(data);
this.$refs.apiList[0].initTable(data); this.refresh(data);
}, },
showExecResult(row) { showExecResult(row) {

View File

@ -48,7 +48,6 @@
<ms-code-edit :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" :mode="'xml'" ref="codeEdit"/> <ms-code-edit :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" :mode="'xml'" ref="codeEdit"/>
</div> </div>
<div class="ms-body" v-if="body.type == 'Raw'"> <div class="ms-body" v-if="body.type == 'Raw'">
<ms-code-edit :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" ref="codeEdit"/> <ms-code-edit :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" ref="codeEdit"/>
</div> </div>
@ -69,7 +68,6 @@
import {BODY_TYPE, KeyValue} from "../../model/ApiTestModel"; import {BODY_TYPE, KeyValue} from "../../model/ApiTestModel";
import MsCodeEdit from "../../../../common/components/MsCodeEdit"; import MsCodeEdit from "../../../../common/components/MsCodeEdit";
import MsJsonCodeEdit from "../../../../common/components/MsJsonCodeEdit"; import MsJsonCodeEdit from "../../../../common/components/MsJsonCodeEdit";
import MsDropdown from "../../../../common/components/MsDropdown"; import MsDropdown from "../../../../common/components/MsDropdown";
import MsApiVariable from "../ApiVariable"; import MsApiVariable from "../ApiVariable";
import MsApiBinaryVariable from "./ApiBinaryVariable"; import MsApiBinaryVariable from "./ApiBinaryVariable";

View File

@ -1,6 +1,6 @@
<template> <template>
<div v-if="visible"> <div v-if="visible">
<ms-drawer :size="40" @close="apiCaseClose" direction="bottom"> <ms-drawer :size="60" @close="apiCaseClose" direction="bottom">
<template v-slot:header> <template v-slot:header>
<api-case-header <api-case-header
:api="api" :api="api"
@ -17,8 +17,8 @@
/> />
</template> </template>
<el-container v-loading="result.loading" style="padding-bottom: 200px"> <el-container v-loading="result.loading">
<el-main v-loading="batchLoading" style="overflow: auto"> <el-main v-loading="batchLoading">
<div v-for="(item,index) in apiCaseList" :key="index"> <div v-for="(item,index) in apiCaseList" :key="index">
<api-case-item v-loading="singleLoading && singleRunId === item.id" <api-case-item v-loading="singleLoading && singleRunId === item.id"
@refresh="refresh" @refresh="refresh"
@ -250,4 +250,8 @@
<style scoped> <style scoped>
.ms-drawer >>> .ms-drawer-body {
margin-top: 80px;
}
</style> </style>

View File

@ -248,7 +248,7 @@
let arr = Array.from(this.selectRows); let arr = Array.from(this.selectRows);
// 1 // 1
if (this.selectRows.size === 1) { if (this.selectRows.size === 1) {
this.$set(arr[0], "showMore", false); this.$set(arr[0], "showMore", true);
} else if (this.selectRows.size === 2) { } else if (this.selectRows.size === 2) {
arr.forEach(row => { arr.forEach(row => {
this.$set(row, "showMore", true); this.$set(row, "showMore", true);

View File

@ -2,13 +2,14 @@
<div class="text-container"> <div class="text-container">
<el-tabs v-model="activeName" v-show="isActive"> <el-tabs v-model="activeName" v-show="isActive">
<el-tab-pane :label="$t('api_test.definition.request.response_header')" name="headers" class="pane">
<pre>{{ response.responseResult.headers }}</pre>
</el-tab-pane>
<el-tab-pane :label="$t('api_test.definition.request.response_body')" name="body" class="pane"> <el-tab-pane :label="$t('api_test.definition.request.response_body')" name="body" class="pane">
<ms-sql-result-table v-if="isSqlType" :body="response.responseResult.body"/> <ms-sql-result-table v-if="isSqlType" :body="response.responseResult.body"/>
<ms-code-edit v-if="!isSqlType" :mode="mode" :read-only="true" :modes="modes" :data.sync="response.responseResult.body" ref="codeEdit"/> <ms-code-edit v-if="!isSqlType" :mode="mode" :read-only="true" :modes="modes" :data.sync="response.responseResult.body" ref="codeEdit"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.definition.request.response_header')" name="headers" class="pane">
<pre>{{ response.responseResult.headers }}</pre>
</el-tab-pane>
<!--<el-tab-pane label="Cookie" name="cookie" class="pane cookie">--> <!--<el-tab-pane label="Cookie" name="cookie" class="pane cookie">-->
<!--<pre>{{response.cookies}}</pre>--> <!--<pre>{{response.cookies}}</pre>-->
<!--</el-tab-pane>--> <!--</el-tab-pane>-->
@ -80,7 +81,7 @@
data() { data() {
return { return {
isActive: true, isActive: true,
activeName: "headers", activeName: "body",
modes: ['text', 'json', 'xml', 'html'], modes: ['text', 'json', 'xml', 'html'],
sqlModes: ['text', 'table'], sqlModes: ['text', 'table'],
mode: BODY_FORMAT.TEXT mode: BODY_FORMAT.TEXT

View File

@ -217,6 +217,7 @@
let url = "/api/definition/update"; let url = "/api/definition/update";
let bodyFiles = this.getBodyUploadFiles(); let bodyFiles = this.getBodyUploadFiles();
this.api.method = this.api.request.method; this.api.method = this.api.request.method;
this.api.path = this.api.request.path;
this.$fileUpload(url, null, bodyFiles, this.api, () => { this.$fileUpload(url, null, bodyFiles, this.api, () => {
this.$success(this.$t('commons.save_success')); this.$success(this.$t('commons.save_success'));
this.$emit('saveApi', this.api); this.$emit('saveApi', this.api);
@ -273,7 +274,7 @@
environmentConfigClose() { environmentConfigClose() {
this.getEnvironments(); this.getEnvironments();
}, },
refresh(){ refresh() {
this.$emit('refresh'); this.$emit('refresh');
}, },
getResult() { getResult() {

View File

@ -843,6 +843,7 @@ export class JSR223Processor extends BaseConfig {
this.type = "JSR223Processor"; this.type = "JSR223Processor";
this.script = undefined; this.script = undefined;
this.language = "beanshell"; this.language = "beanshell";
this.scriptLanguage = "java";
this.enable = true; this.enable = true;
this.hashTree = []; this.hashTree = [];
this.set(options); this.set(options);

View File

@ -178,7 +178,9 @@
} }
.ms-drawer-header { .ms-drawer-header {
position: relative; position: fixed;
width: 100%;
z-index: 999;
} }
.el-icon-close { .el-icon-close {

View File

@ -17,12 +17,12 @@
}, },
mode: { mode: {
type: String, type: String,
default: "tree" default: "code"
}, },
modes: { modes: {
type: Array, type: Array,
default: function () { default: function () {
return ["tree", "code"]; return ["code"];
} }
} }
}, },

View File

@ -17,6 +17,7 @@ import CalendarHeatmap from "../common/js/calendar-heatmap";
import '../common/css/menu-header.css'; import '../common/css/menu-header.css';
import '../common/css/main.css'; import '../common/css/main.css';
import CKEditor from '@ckeditor/ckeditor5-vue'; import CKEditor from '@ckeditor/ckeditor5-vue';
import VueFab from 'vue-float-action-button'
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(icon); Vue.use(icon);
@ -29,7 +30,8 @@ Vue.use(chart);
Vue.use(CalendarHeatmap); Vue.use(CalendarHeatmap);
Vue.use(message); Vue.use(message);
Vue.use(CKEditor); Vue.use(CKEditor);
Vue.use(YanProgress) Vue.use(YanProgress);
Vue.use(VueFab);
// v-permission // v-permission
Vue.directive('permission', permission); Vue.directive('permission', permission);

View File

@ -134,6 +134,6 @@ html,body {
} }
::-webkit-scrollbar-track{ ::-webkit-scrollbar-track{
border-radius: 1em; border-radius: 1em;
background-color: rgba(50,50,50,.1); background-color: transparent;
position: fixed; position: fixed;
} }

View File

@ -0,0 +1,22 @@
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(./material.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}

Binary file not shown.