From 8db0b4349a4b127f33a2fa692d841f1d9fdf377e Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 25 Nov 2020 15:31:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20T?= =?UTF-8?q?CP=EF=BC=8CSQL=EF=BC=8CDUBBO=20=E5=8D=8F=E8=AE=AE=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=BD=95=E5=85=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/definition/request/MsTestElement.java | 10 +- .../request/sampler/MsDubboSampler.java | 143 ++++++++ .../request/sampler/MsJDBCSampler.java | 103 ++++++ .../request/sampler/MsTCPSampler.java | 104 ++++++ .../request/sampler/dubbo/MsConfigCenter.java | 14 + .../sampler/dubbo/MsConsumerAndService.java | 15 + .../sampler/dubbo/MsRegistryCenter.java | 13 + .../api/definition/components/ApiConfig.vue | 65 +++- .../ApiScenarioVariables.vue | 4 +- .../complete/AddCompleteDubboApi.vue | 79 +++++ .../components/complete/AddCompleteSqlApi.vue | 79 +++++ .../components/complete/AddCompleteTcpApi.vue | 78 +++++ .../components/complete/ApiTcpRequestForm.vue | 311 ------------------ .../components/debug/DebugJdbcPage.vue | 163 +++++++++ .../environment/EnvironmentCommonConfig.vue | 2 +- .../environment/EnvironmentEdit.vue | 2 +- .../components/sampler/dubbo-sampler/index.js | 38 +++ .../components/sampler/jdbc-sampler/index.js | 24 +- .../request/database/BasisParameters.vue | 263 +++++++++++++++ .../request/dubbo/BasisParameters.vue | 200 +++++++++++ .../components/request/dubbo/ConfigCenter.vue | 83 +++++ .../request/dubbo/ConsumerAndService.vue | 82 +++++ .../components/request/dubbo/Interface.vue | 124 +++++++ .../request/dubbo/RegistryCenter.vue | 73 ++++ .../components/request/dubbo/dubbo.css | 43 +++ .../request/tcp/BasisParameters.vue | 299 +++++++++++++++++ .../components/request/tcp/TcpConfig.vue | 2 +- 27 files changed, 2074 insertions(+), 342 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsDubboSampler.java create mode 100644 backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsJDBCSampler.java create mode 100644 backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java create mode 100644 backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsConfigCenter.java create mode 100644 backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsConsumerAndService.java create mode 100644 backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsRegistryCenter.java rename frontend/src/business/components/api/definition/components/{environment => }/ApiScenarioVariables.vue (96%) create mode 100644 frontend/src/business/components/api/definition/components/complete/AddCompleteDubboApi.vue create mode 100644 frontend/src/business/components/api/definition/components/complete/AddCompleteSqlApi.vue create mode 100644 frontend/src/business/components/api/definition/components/complete/AddCompleteTcpApi.vue delete mode 100644 frontend/src/business/components/api/definition/components/complete/ApiTcpRequestForm.vue create mode 100644 frontend/src/business/components/api/definition/components/debug/DebugJdbcPage.vue create mode 100644 frontend/src/business/components/api/definition/components/jmeter/components/sampler/dubbo-sampler/index.js create mode 100644 frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue create mode 100644 frontend/src/business/components/api/definition/components/request/dubbo/BasisParameters.vue create mode 100644 frontend/src/business/components/api/definition/components/request/dubbo/ConfigCenter.vue create mode 100644 frontend/src/business/components/api/definition/components/request/dubbo/ConsumerAndService.vue create mode 100644 frontend/src/business/components/api/definition/components/request/dubbo/Interface.vue create mode 100644 frontend/src/business/components/api/definition/components/request/dubbo/RegistryCenter.vue create mode 100644 frontend/src/business/components/api/definition/components/request/dubbo/dubbo.css create mode 100644 frontend/src/business/components/api/definition/components/request/tcp/BasisParameters.vue diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java index aea5f53ebf..43cee3bad6 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java @@ -10,7 +10,10 @@ import io.metersphere.api.dto.definition.request.configurations.MsHeaderManager; import io.metersphere.api.dto.definition.request.extract.MsExtract; import io.metersphere.api.dto.definition.request.processors.post.MsJSR223PostProcessor; import io.metersphere.api.dto.definition.request.processors.pre.MsJSR223PreProcessor; +import io.metersphere.api.dto.definition.request.sampler.MsDubboSampler; import io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy; +import io.metersphere.api.dto.definition.request.sampler.MsJDBCSampler; +import io.metersphere.api.dto.definition.request.sampler.MsTCPSampler; import io.metersphere.commons.utils.LogUtil; import lombok.Data; import org.apache.jmeter.protocol.http.control.AuthManager; @@ -33,9 +36,14 @@ import java.util.List; @JsonSubTypes.Type(value = MsAuthManager.class, name = "AuthManager"), @JsonSubTypes.Type(value = MsAssertions.class, name = "Assertions"), @JsonSubTypes.Type(value = MsExtract.class, name = "Extract"), + @JsonSubTypes.Type(value = MsTCPSampler.class, name = "TCPSampler"), + @JsonSubTypes.Type(value = MsDubboSampler.class, name = "DubboSampler"), + @JsonSubTypes.Type(value = MsJDBCSampler.class, name = "JDBCSampler"), }) -@JSONType(seeAlso = {MsHTTPSamplerProxy.class, MsHeaderManager.class, MsJSR223PostProcessor.class, MsJSR223PreProcessor.class, MsTestPlan.class, MsThreadGroup.class, AuthManager.class, MsAssertions.class, MsExtract.class}, typeKey = "type") +@JSONType(seeAlso = {MsHTTPSamplerProxy.class, MsHeaderManager.class, MsJSR223PostProcessor.class, + MsJSR223PreProcessor.class, MsTestPlan.class, MsThreadGroup.class, AuthManager.class, MsAssertions.class, + MsExtract.class, MsTCPSampler.class, MsDubboSampler.class, MsJDBCSampler.class}, typeKey = "type") @Data public abstract class MsTestElement { private String type; diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsDubboSampler.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsDubboSampler.java new file mode 100644 index 0000000000..600833239a --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsDubboSampler.java @@ -0,0 +1,143 @@ +package io.metersphere.api.dto.definition.request.sampler; + +import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson.annotation.JSONType; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.github.ningyu.jmeter.plugin.dubbo.sample.DubboSample; +import io.github.ningyu.jmeter.plugin.dubbo.sample.MethodArgument; +import io.github.ningyu.jmeter.plugin.util.Constants; +import io.metersphere.api.dto.definition.request.MsTestElement; +import io.metersphere.api.dto.definition.request.sampler.dubbo.MsConfigCenter; +import io.metersphere.api.dto.definition.request.sampler.dubbo.MsConsumerAndService; +import io.metersphere.api.dto.definition.request.sampler.dubbo.MsRegistryCenter; +import io.metersphere.api.dto.scenario.KeyValue; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.apache.commons.collections.CollectionUtils; +import org.apache.jmeter.config.ConfigTestElement; +import org.apache.jmeter.save.SaveService; +import org.apache.jmeter.testelement.TestElement; +import org.apache.jorphan.collections.HashTree; +import org.apache.jorphan.collections.ListedHashTree; + +import java.util.List; +import java.util.stream.Collectors; + +@Data +@EqualsAndHashCode(callSuper = true) +@JSONType(typeName = "DubboSampler") +public class MsDubboSampler extends MsTestElement { + // type 必须放最前面,以便能够转换正确的类 + private String type = "DubboSampler"; + + @JSONField(ordinal = 52) + private String protocol; + @JsonProperty(value = "interface") + @JSONField(ordinal = 53, name = "interface") + private String _interface; + @JSONField(ordinal = 54) + private String method; + + @JSONField(ordinal = 55) + private MsConfigCenter configCenter; + @JSONField(ordinal = 56) + private MsRegistryCenter registryCenter; + @JSONField(ordinal = 57) + private MsConsumerAndService consumerAndService; + + @JSONField(ordinal = 58) + private List args; + @JSONField(ordinal = 59) + private List attachmentArgs; + + public void toHashTree(HashTree tree, List hashTree) { + final HashTree testPlanTree = new ListedHashTree(); + testPlanTree.add(dubboConfig()); + tree.set(dubboSample(), testPlanTree); + if (CollectionUtils.isNotEmpty(hashTree)) { + hashTree.forEach(el -> { + el.toHashTree(testPlanTree, el.getHashTree()); + }); + } + } + + private DubboSample dubboSample() { + DubboSample sampler = new DubboSample(); + sampler.setName(this.getName()); + sampler.setProperty(TestElement.TEST_CLASS, DubboSample.class.getName()); + sampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("DubboSampleGui")); + + sampler.addTestElement(configCenter(this.getConfigCenter())); + sampler.addTestElement(registryCenter(this.getRegistryCenter())); + sampler.addTestElement(consumerAndService(this.getConsumerAndService())); + + Constants.setRpcProtocol(this.getProtocol(), sampler); + Constants.setInterfaceName(this.get_interface(), sampler); + Constants.setMethod(this.getMethod(), sampler); + + List methodArgs = this.getArgs().stream().filter(KeyValue::isValid).filter(KeyValue::isEnable) + .map(keyValue -> new MethodArgument(keyValue.getName(), keyValue.getValue())).collect(Collectors.toList()); + Constants.setMethodArgs(methodArgs, sampler); + + List attachmentArgs = this.getAttachmentArgs().stream().filter(KeyValue::isValid).filter(KeyValue::isEnable) + .map(keyValue -> new MethodArgument(keyValue.getName(), keyValue.getValue())).collect(Collectors.toList()); + Constants.setAttachmentArgs(attachmentArgs, sampler); + + return sampler; + } + + + private ConfigTestElement dubboConfig() { + ConfigTestElement configTestElement = new ConfigTestElement(); + configTestElement.setEnabled(true); + configTestElement.setName(this.getName()); + configTestElement.setProperty(TestElement.TEST_CLASS, ConfigTestElement.class.getName()); + configTestElement.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("DubboDefaultConfigGui")); + configTestElement.addConfigElement(configCenter(this.getConfigCenter())); + configTestElement.addConfigElement(registryCenter(this.getRegistryCenter())); + configTestElement.addConfigElement(consumerAndService(this.getConsumerAndService())); + return configTestElement; + } + + private ConfigTestElement configCenter(MsConfigCenter configCenter) { + ConfigTestElement configTestElement = new ConfigTestElement(); + if (configCenter != null) { + Constants.setConfigCenterProtocol(configCenter.getProtocol(), configTestElement); + Constants.setConfigCenterGroup(configCenter.getGroup(), configTestElement); + Constants.setConfigCenterNamespace(configCenter.getNamespace(), configTestElement); + Constants.setConfigCenterUserName(configCenter.getUsername(), configTestElement); + Constants.setConfigCenterPassword(configCenter.getPassword(), configTestElement); + Constants.setConfigCenterAddress(configCenter.getAddress(), configTestElement); + Constants.setConfigCenterTimeout(configCenter.getTimeout(), configTestElement); + } + return configTestElement; + } + + private ConfigTestElement registryCenter(MsRegistryCenter registryCenter) { + ConfigTestElement configTestElement = new ConfigTestElement(); + if (registryCenter != null) { + Constants.setRegistryProtocol(registryCenter.getProtocol(), configTestElement); + Constants.setRegistryGroup(registryCenter.getGroup(), configTestElement); + Constants.setRegistryUserName(registryCenter.getUsername(), configTestElement); + Constants.setRegistryPassword(registryCenter.getPassword(), configTestElement); + Constants.setRegistryTimeout(registryCenter.getTimeout(), configTestElement); + Constants.setAddress(registryCenter.getAddress(), configTestElement); + } + return configTestElement; + } + + private ConfigTestElement consumerAndService(MsConsumerAndService consumerAndService) { + ConfigTestElement configTestElement = new ConfigTestElement(); + if (consumerAndService != null) { + Constants.setTimeout(consumerAndService.getTimeout(), configTestElement); + Constants.setVersion(consumerAndService.getVersion(), configTestElement); + Constants.setGroup(consumerAndService.getGroup(), configTestElement); + Constants.setConnections(consumerAndService.getConnections(), configTestElement); + Constants.setLoadbalance(consumerAndService.getLoadBalance(), configTestElement); + Constants.setAsync(consumerAndService.getAsync(), configTestElement); + Constants.setCluster(consumerAndService.getCluster(), configTestElement); + } + return configTestElement; + } + +} diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsJDBCSampler.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsJDBCSampler.java new file mode 100644 index 0000000000..a140c867e1 --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsJDBCSampler.java @@ -0,0 +1,103 @@ +package io.metersphere.api.dto.definition.request.sampler; + +import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson.annotation.JSONType; +import io.metersphere.api.dto.definition.request.MsTestElement; +import io.metersphere.api.dto.scenario.DatabaseConfig; +import io.metersphere.api.dto.scenario.KeyValue; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.apache.commons.collections.CollectionUtils; +import org.apache.jmeter.config.Arguments; +import org.apache.jmeter.protocol.jdbc.config.DataSourceElement; +import org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler; +import org.apache.jmeter.save.SaveService; +import org.apache.jmeter.testelement.TestElement; +import org.apache.jorphan.collections.HashTree; +import org.apache.jorphan.collections.ListedHashTree; + +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +@JSONType(typeName = "JDBCSampler") +public class MsJDBCSampler extends MsTestElement { + // type 必须放最前面,以便能够转换正确的类 + private String type = "JDBCSampler"; + @JSONField(ordinal = 10) + private DatabaseConfig dataSource; + @JSONField(ordinal = 11) + private String query; + @JSONField(ordinal = 12) + private long queryTimeout; + @JSONField(ordinal = 13) + private String resultVariable; + @JSONField(ordinal = 14) + private String variableNames; + @JSONField(ordinal = 15) + private List variables; + @JSONField(ordinal = 16) + private String environmentId; + + public void toHashTree(HashTree tree, List hashTree) { + final HashTree samplerHashTree = new ListedHashTree(); + samplerHashTree.add(jdbcDataSource()); + samplerHashTree.add(arguments(this.getName() + " Variables", this.getVariables())); + tree.set(jdbcSampler(), samplerHashTree); + if (CollectionUtils.isNotEmpty(hashTree)) { + hashTree.forEach(el -> { + el.toHashTree(samplerHashTree, el.getHashTree()); + }); + } + } + + private Arguments arguments(String name, List variables) { + Arguments arguments = new Arguments(); + arguments.setEnabled(true); + arguments.setName(name); + arguments.setProperty(TestElement.TEST_CLASS, Arguments.class.getName()); + arguments.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("ArgumentsPanel")); + variables.stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue -> + arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=") + ); + return arguments; + } + + private JDBCSampler jdbcSampler() { + JDBCSampler sampler = new JDBCSampler(); + sampler.setName(this.getName()); + sampler.setProperty(TestElement.TEST_CLASS, JDBCSampler.class.getName()); + sampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI")); + // request.getDataSource() 是ID,需要转换为Name + sampler.setDataSource(this.dataSource.getName()); + sampler.setQuery(this.getQuery()); + sampler.setQueryTimeout(String.valueOf(this.getQueryTimeout())); + sampler.setResultVariable(this.getResultVariable()); + sampler.setVariableNames(this.getVariableNames()); + sampler.setResultSetHandler("Store as String"); + sampler.setQueryType("Callable Statement"); + return sampler; + } + + private DataSourceElement jdbcDataSource() { + DataSourceElement dataSourceElement = new DataSourceElement(); + dataSourceElement.setEnabled(true); + dataSourceElement.setName(this.getName() + " JDBCDataSource"); + dataSourceElement.setProperty(TestElement.TEST_CLASS, DataSourceElement.class.getName()); + dataSourceElement.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI")); + dataSourceElement.setAutocommit(true); + dataSourceElement.setKeepAlive(true); + dataSourceElement.setPreinit(true); + dataSourceElement.setDataSource(dataSource.getName()); + dataSourceElement.setDbUrl(dataSource.getDbUrl()); + dataSourceElement.setDriver(dataSource.getDriver()); + dataSourceElement.setUsername(dataSource.getUsername()); + dataSourceElement.setPassword(dataSource.getPassword()); + dataSourceElement.setPoolMax(String.valueOf(dataSource.getPoolMax())); + dataSourceElement.setTimeout(String.valueOf(dataSource.getTimeout())); + dataSourceElement.setConnectionAge("5000"); + dataSourceElement.setTrimInterval("60000"); + dataSourceElement.setTransactionIsolation("DEFAULT"); + return dataSourceElement; + } +} diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java new file mode 100644 index 0000000000..53bde7df7b --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java @@ -0,0 +1,104 @@ +package io.metersphere.api.dto.definition.request.sampler; + +import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson.annotation.JSONType; +import io.metersphere.api.dto.definition.request.MsTestElement; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.apache.commons.collections.CollectionUtils; +import org.apache.jmeter.config.ConfigTestElement; +import org.apache.jmeter.protocol.tcp.sampler.TCPSampler; +import org.apache.jmeter.save.SaveService; +import org.apache.jmeter.testelement.TestElement; +import org.apache.jorphan.collections.HashTree; +import org.apache.jorphan.collections.ListedHashTree; + +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +@JSONType(typeName = "TCPSampler") +public class MsTCPSampler extends MsTestElement { + @JSONField(ordinal = 10) + private String type = "TCPSampler"; + @JSONField(ordinal = 11) + private String classname = ""; + @JSONField(ordinal = 12) + private String server = ""; + @JSONField(ordinal = 13) + private String port = ""; + @JSONField(ordinal = 14) + private String ctimeout = ""; + @JSONField(ordinal = 15) + private String timeout = ""; + @JSONField(ordinal = 16) + private boolean reUseConnection = true; + @JSONField(ordinal = 17) + private boolean nodelay; + @JSONField(ordinal = 18) + private boolean closeConnection; + @JSONField(ordinal = 19) + private String soLinger = ""; + @JSONField(ordinal = 20) + private String eolByte = ""; + @JSONField(ordinal = 21) + private String username = ""; + @JSONField(ordinal = 22) + private String password = ""; + @JSONField(ordinal = 23) + private String request; + + public void toHashTree(HashTree tree, List hashTree) { + final HashTree samplerHashTree = new ListedHashTree(); + samplerHashTree.add(tcpConfig()); + tree.set(tcpSampler(), samplerHashTree); + if (CollectionUtils.isNotEmpty(hashTree)) { + hashTree.forEach(el -> { + el.toHashTree(samplerHashTree, el.getHashTree()); + }); + } + } + + private TCPSampler tcpSampler() { + TCPSampler tcpSampler = new TCPSampler(); + tcpSampler.setName(this.getName()); + tcpSampler.setProperty(TestElement.TEST_CLASS, TCPSampler.class.getName()); + tcpSampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TCPSamplerGui")); + tcpSampler.setClassname(this.getClassname()); + tcpSampler.setServer(this.getServer()); + tcpSampler.setPort(this.getPort()); + tcpSampler.setConnectTimeout(this.getCtimeout()); + tcpSampler.setProperty(TCPSampler.RE_USE_CONNECTION, this.isReUseConnection()); + tcpSampler.setProperty(TCPSampler.NODELAY, this.isNodelay()); + tcpSampler.setCloseConnection(String.valueOf(this.isCloseConnection())); + tcpSampler.setSoLinger(this.getSoLinger()); + tcpSampler.setEolByte(this.getEolByte()); + tcpSampler.setRequestData(this.getRequest()); + tcpSampler.setProperty(ConfigTestElement.USERNAME, this.getUsername()); + tcpSampler.setProperty(ConfigTestElement.PASSWORD, this.getPassword()); + + return tcpSampler; + } + + private ConfigTestElement tcpConfig() { + ConfigTestElement configTestElement = new ConfigTestElement(); + configTestElement.setEnabled(true); + configTestElement.setName(this.getName()); + configTestElement.setProperty(TestElement.TEST_CLASS, ConfigTestElement.class.getName()); + configTestElement.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TCPConfigGui")); + configTestElement.setProperty(TCPSampler.CLASSNAME, this.getClassname()); + configTestElement.setProperty(TCPSampler.SERVER, this.getServer()); + configTestElement.setProperty(TCPSampler.PORT, this.getPort()); + configTestElement.setProperty(TCPSampler.TIMEOUT_CONNECT, this.getCtimeout()); + configTestElement.setProperty(TCPSampler.RE_USE_CONNECTION, this.isReUseConnection()); + configTestElement.setProperty(TCPSampler.NODELAY, this.isNodelay()); + configTestElement.setProperty(TCPSampler.CLOSE_CONNECTION, this.isCloseConnection()); + configTestElement.setProperty(TCPSampler.SO_LINGER, this.getSoLinger()); + configTestElement.setProperty(TCPSampler.EOL_BYTE, this.getEolByte()); + configTestElement.setProperty(TCPSampler.SO_LINGER, this.getSoLinger()); + configTestElement.setProperty(ConfigTestElement.USERNAME, this.getUsername()); + configTestElement.setProperty(ConfigTestElement.PASSWORD, this.getPassword()); + return configTestElement; + } + +} diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsConfigCenter.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsConfigCenter.java new file mode 100644 index 0000000000..f1027b789b --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsConfigCenter.java @@ -0,0 +1,14 @@ +package io.metersphere.api.dto.definition.request.sampler.dubbo; + +import lombok.Data; + +@Data +public class MsConfigCenter { + private String protocol; + private String group; + private String namespace; + private String username; + private String address; + private String password; + private String timeout; +} diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsConsumerAndService.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsConsumerAndService.java new file mode 100644 index 0000000000..78897f843d --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsConsumerAndService.java @@ -0,0 +1,15 @@ +package io.metersphere.api.dto.definition.request.sampler.dubbo; + +import lombok.Data; + +@Data +public class MsConsumerAndService { + private String timeout; + private String version; + private String retries; + private String cluster; + private String group; + private String connections; + private String async; + private String loadBalance; +} diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsRegistryCenter.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsRegistryCenter.java new file mode 100644 index 0000000000..bfd98b49f6 --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/dubbo/MsRegistryCenter.java @@ -0,0 +1,13 @@ +package io.metersphere.api.dto.definition.request.sampler.dubbo; + +import lombok.Data; + +@Data +public class MsRegistryCenter { + private String protocol; + private String group; + private String username; + private String address; + private String password; + private String timeout; +} diff --git a/frontend/src/business/components/api/definition/components/ApiConfig.vue b/frontend/src/business/components/api/definition/components/ApiConfig.vue index 3119c496ec..c29ce51436 100644 --- a/frontend/src/business/components/api/definition/components/ApiConfig.vue +++ b/frontend/src/business/components/api/definition/components/ApiConfig.vue @@ -2,18 +2,28 @@
- - + - + + + + + + +
+ + diff --git a/frontend/src/business/components/api/definition/components/complete/AddCompleteSqlApi.vue b/frontend/src/business/components/api/definition/components/complete/AddCompleteSqlApi.vue new file mode 100644 index 0000000000..b8358e3c25 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/complete/AddCompleteSqlApi.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/frontend/src/business/components/api/definition/components/complete/AddCompleteTcpApi.vue b/frontend/src/business/components/api/definition/components/complete/AddCompleteTcpApi.vue new file mode 100644 index 0000000000..16d3d130c6 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/complete/AddCompleteTcpApi.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/frontend/src/business/components/api/definition/components/complete/ApiTcpRequestForm.vue b/frontend/src/business/components/api/definition/components/complete/ApiTcpRequestForm.vue deleted file mode 100644 index ae9683812e..0000000000 --- a/frontend/src/business/components/api/definition/components/complete/ApiTcpRequestForm.vue +++ /dev/null @@ -1,311 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/definition/components/debug/DebugJdbcPage.vue b/frontend/src/business/components/api/definition/components/debug/DebugJdbcPage.vue new file mode 100644 index 0000000000..43e805af72 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/debug/DebugJdbcPage.vue @@ -0,0 +1,163 @@ + + + + + diff --git a/frontend/src/business/components/api/definition/components/environment/EnvironmentCommonConfig.vue b/frontend/src/business/components/api/definition/components/environment/EnvironmentCommonConfig.vue index 9d0c893bb7..8c505131c8 100644 --- a/frontend/src/business/components/api/definition/components/environment/EnvironmentCommonConfig.vue +++ b/frontend/src/business/components/api/definition/components/environment/EnvironmentCommonConfig.vue @@ -15,7 +15,7 @@ + + diff --git a/frontend/src/business/components/api/definition/components/request/dubbo/BasisParameters.vue b/frontend/src/business/components/api/definition/components/request/dubbo/BasisParameters.vue new file mode 100644 index 0000000000..6803b47165 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/request/dubbo/BasisParameters.vue @@ -0,0 +1,200 @@ + + + + + diff --git a/frontend/src/business/components/api/definition/components/request/dubbo/ConfigCenter.vue b/frontend/src/business/components/api/definition/components/request/dubbo/ConfigCenter.vue new file mode 100644 index 0000000000..a3082133f2 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/request/dubbo/ConfigCenter.vue @@ -0,0 +1,83 @@ + + + diff --git a/frontend/src/business/components/api/definition/components/request/dubbo/ConsumerAndService.vue b/frontend/src/business/components/api/definition/components/request/dubbo/ConsumerAndService.vue new file mode 100644 index 0000000000..1d26f45eed --- /dev/null +++ b/frontend/src/business/components/api/definition/components/request/dubbo/ConsumerAndService.vue @@ -0,0 +1,82 @@ + + + diff --git a/frontend/src/business/components/api/definition/components/request/dubbo/Interface.vue b/frontend/src/business/components/api/definition/components/request/dubbo/Interface.vue new file mode 100644 index 0000000000..6676c9b5f8 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/request/dubbo/Interface.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/frontend/src/business/components/api/definition/components/request/dubbo/RegistryCenter.vue b/frontend/src/business/components/api/definition/components/request/dubbo/RegistryCenter.vue new file mode 100644 index 0000000000..5910097ce0 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/request/dubbo/RegistryCenter.vue @@ -0,0 +1,73 @@ + + + diff --git a/frontend/src/business/components/api/definition/components/request/dubbo/dubbo.css b/frontend/src/business/components/api/definition/components/request/dubbo/dubbo.css new file mode 100644 index 0000000000..d6a1180834 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/request/dubbo/dubbo.css @@ -0,0 +1,43 @@ +@media only screen and (max-width: 1200px) { + .dubbo-form-item { + width: 50%; + } + + .dubbo-form-item-long { + width: 100%; + } +} + +@media only screen and (min-width: 1201px) and (max-width: 1600px) { + .dubbo-form-item { + width: 33.33%; + } + + .dubbo-form-item-long { + width: 66.67%; + } +} + +@media only screen and (min-width: 1601px) { + .dubbo-form-item { + width: 25%; + } + + .dubbo-form-item-long { + width: 50%; + } +} + +.dubbo-form-item, .dubbo-form-item-long { + display: inline-block; +} + +.select-100 { + width: 100%; +} + +.dubbo-form-description { + width: 100%; + font-size: 13px; + margin-bottom: 12px; +} diff --git a/frontend/src/business/components/api/definition/components/request/tcp/BasisParameters.vue b/frontend/src/business/components/api/definition/components/request/tcp/BasisParameters.vue new file mode 100644 index 0000000000..5dbd575356 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/request/tcp/BasisParameters.vue @@ -0,0 +1,299 @@ + + + + + diff --git a/frontend/src/business/components/api/definition/components/request/tcp/TcpConfig.vue b/frontend/src/business/components/api/definition/components/request/tcp/TcpConfig.vue index d5c10e862b..24b97dc2a4 100644 --- a/frontend/src/business/components/api/definition/components/request/tcp/TcpConfig.vue +++ b/frontend/src/business/components/api/definition/components/request/tcp/TcpConfig.vue @@ -87,7 +87,7 @@ import {TCPConfig} from "../../../model/ApiTestModel"; export default { name: "MsTcpConfig", props: { - config: TCPConfig, + config: {}, isReadOnly: { type: Boolean, default: false