From a98cb1a06cbc857eeaada7f69f58ff4041e4c569 Mon Sep 17 00:00:00 2001 From: luqiong <605601787@qq.com> Date: Mon, 25 Aug 2014 18:01:59 +0800 Subject: [PATCH 1/6] edit result.css --- Bench4Q-Web/src/main/webapp/css/result.css | 5 +++++ Bench4Q-Web/src/main/webapp/result.jsp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Bench4Q-Web/src/main/webapp/css/result.css b/Bench4Q-Web/src/main/webapp/css/result.css index 825b8624..44d5e7ed 100644 --- a/Bench4Q-Web/src/main/webapp/css/result.css +++ b/Bench4Q-Web/src/main/webapp/css/result.css @@ -95,6 +95,11 @@ margin-bottom:5px } +.testHeader .span-brief .value{ + color:#317eac; + font-size:19px +} + .testHeader .span-brief h4{ font-size:23px } diff --git a/Bench4Q-Web/src/main/webapp/result.jsp b/Bench4Q-Web/src/main/webapp/result.jsp index 76483e98..2e2d8382 100644 --- a/Bench4Q-Web/src/main/webapp/result.jsp +++ b/Bench4Q-Web/src/main/webapp/result.jsp @@ -46,15 +46,15 @@ body {

-
+

-
+

-
+
<%--
From ecdd92c7413ecaac5ab85e3f59b14a6ecb8412c7 Mon Sep 17 00:00:00 2001 From: daisyonly <1241945585@qq.com> Date: Tue, 26 Aug 2014 09:06:24 +0800 Subject: [PATCH 2/6] remove alert --- .../src/main/webapp/script/scriptManager/contentVerification.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Bench4Q-Web/src/main/webapp/script/scriptManager/contentVerification.js b/Bench4Q-Web/src/main/webapp/script/scriptManager/contentVerification.js index b2628b00..35af054c 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptManager/contentVerification.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptManager/contentVerification.js @@ -1,6 +1,5 @@ $(document).ready(function(){ $("#behaviorEditor").on("focusout",".editor input",function(){ console.log(this); - alert("This input field has lost its focus."); }) }); \ No newline at end of file From c93b0319db15038fc1154ea173fdcecced2c5eec Mon Sep 17 00:00:00 2001 From: daisyonly <1241945585@qq.com> Date: Tue, 26 Aug 2014 14:24:55 +0800 Subject: [PATCH 3/6] edit ui.xml --- .../org/bench4q/agent/plugin/basic/http/ui.xml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml index 91ba98a7..00a8d872 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml @@ -7,7 +7,7 @@ - + @@ -31,11 +31,12 @@ - + + label="The regular expression of extracting variables from response" + required="false">
@@ -48,7 +49,7 @@ - +
@@ -58,7 +59,8 @@ + label="The regular expression of extracting variables from response" + required="false">
@@ -71,7 +73,7 @@ - +
@@ -81,7 +83,8 @@ + label="The regular expression of extracting variables from response" + required="false">
From 63b5cdf6880e7214196d5440f2f6c530c438f8d1 Mon Sep 17 00:00:00 2001 From: daisyonly <1241945585@qq.com> Date: Tue, 26 Aug 2014 16:30:44 +0800 Subject: [PATCH 4/6] add set required in PluginFactory add set required in PluginFactory --- .../bench4q/master/domain/entity/plugin/ParamInfo.java | 10 ++++++++++ .../master/domain/factory/PluginEntityFactory.java | 2 ++ 2 files changed, 12 insertions(+) diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/plugin/ParamInfo.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/plugin/ParamInfo.java index e0696d2b..efed25ff 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/plugin/ParamInfo.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/plugin/ParamInfo.java @@ -19,6 +19,7 @@ public class ParamInfo { private int id; private String name; private String lable; + private String required; private ParamType paramType; private ParamsContainer paramsContainer; @@ -50,6 +51,15 @@ public class ParamInfo { public void setLable(String lable) { this.lable = lable; } + + @Column(name = "required") + public String getRequired() { + return required; + } + + public void setRequired(String required) { + this.required = required; + } @OneToOne(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER) @JoinColumn(name = "typeId", nullable = false) diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/PluginEntityFactory.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/PluginEntityFactory.java index 233ec15c..58cafbc5 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/PluginEntityFactory.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/PluginEntityFactory.java @@ -165,6 +165,8 @@ public class PluginEntityFactory { ParamInfo paramInfo = new ParamInfo(); paramInfo.setLable(XmlParseHelper.getAttribute(paramElement, "label")); paramInfo.setName(XmlParseHelper.getAttribute(paramElement, "name")); + paramInfo.setRequired(XmlParseHelper.getAttribute(paramElement, + "required")); paramInfo.setParamType(ParamTypeFactory .createParamTypeInfo(XmlParseHelper .getSingleChild(paramElement))); From edb85afd675c60c048f9c6cf726a5163f9197269 Mon Sep 17 00:00:00 2001 From: daisyonly <1241945585@qq.com> Date: Tue, 26 Aug 2014 17:36:37 +0800 Subject: [PATCH 5/6] add required in editorFactory and containerFactory add required in editorFactory and containerFactory --- .../script/scriptManager/containerFactory.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Bench4Q-Web/src/main/webapp/script/scriptManager/containerFactory.js b/Bench4Q-Web/src/main/webapp/script/scriptManager/containerFactory.js index cfb1ca62..fe78bc68 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptManager/containerFactory.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptManager/containerFactory.js @@ -22,9 +22,9 @@ ContainerFactory.prototype.createEditorContainer = function(header, id, containerInfo[i].name == ""; } if (containerInfo[i].children == null) { - + console.log(containerInfo[i]); this.appendEdtiors(container, containerInfo[i].label, - containerInfo[i].nameCN, containerInfo[i].name, + containerInfo[i].nameCN, containerInfo[i].required, containerInfo[i].name, containerInfo[i].paramTypeModel,containerInfo[i].value == null ?"":containerInfo[i].value); } else { $(container).append( @@ -39,29 +39,30 @@ ContainerFactory.prototype.createEditorContainer = function(header, id, }; -ContainerFactory.prototype.appendEdtiors = function(container, label, name, id, +ContainerFactory.prototype.appendEdtiors = function(container, label, name, required, id, editorInfo, value) { var editorFactory = new EditorFactory(); if (editorInfo.type.toLowerCase() == "field") { + console.log("required:"+required); $(container).append( - editorFactory.createField(label, name, editorInfo.size, id,value)); + editorFactory.createField(label, name, required, editorInfo.size, id,value)); } else if (editorInfo.type.toLowerCase() == "nfield") { $(container).append( editorFactory - .createMultiField(label, name, editorInfo.size, id,value)); + .createMultiField(label, name, required, editorInfo.size, id,value)); } else if (editorInfo.type.toLowerCase() == "table") { $(container).append( - editorFactory.createTable(label, name, editorInfo.cols, id,value)); + editorFactory.createTable(label, name, required, editorInfo.cols, id,value)); } else if (editorInfo.type.toLowerCase() == "file") { $(container).append( - editorFactory.createFile(lable, name, editorInfo.size, id,value)); + editorFactory.createFile(lable, name, required, editorInfo.size, id,value)); } else if (editorInfo.type.toLowerCase() == "date") { $(container).append( - editorFactory.createDate(label, name, editorInfo.size, id,value)); + editorFactory.createDate(label, name, required, editorInfo.size, id,value)); } else if (editorInfo.type.toLowerCase() == "select") { $(container).append( editorFactory.createSelect(label, name, editorInfo.size, From 6eba56d7f8fd7624fc4923815ca3f5dea2526c2f Mon Sep 17 00:00:00 2001 From: daisyonly <1241945585@qq.com> Date: Tue, 26 Aug 2014 17:37:54 +0800 Subject: [PATCH 6/6] add required in editorFactory add required in editorFactory --- .../script/scriptManager/editorFactory.js | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/Bench4Q-Web/src/main/webapp/script/scriptManager/editorFactory.js b/Bench4Q-Web/src/main/webapp/script/scriptManager/editorFactory.js index f273819a..8f8d361f 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptManager/editorFactory.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptManager/editorFactory.js @@ -50,14 +50,14 @@ EditorFactory.prototype.createChoice = function(value, defaultValue, name, return div; } -EditorFactory.prototype.createField = function(label, name, size, id, value) { +EditorFactory.prototype.createField = function(label, name, required, size, id, value) { var div = this.createBaseEditor(label, id); $(div).children(".editor").attr("editorType", "field"); - $(div).children(".editor").append(this.createFieldLine(size, name, value)); + $(div).children(".editor").append(this.createFieldLine(size, name, required, value)); return div; } -EditorFactory.prototype.createMultiField = function(label, name, size, id, +EditorFactory.prototype.createMultiField = function(label, name, required, size, id, value) { var div = this.createBaseEditor(label, id); $(div).children(".editor").attr("editorType", "multiField"); @@ -65,7 +65,7 @@ EditorFactory.prototype.createMultiField = function(label, name, size, id, var values = value.split(";"); for (var i = 0; i < values.length; i++) { $(div).children(".editor").append( - this.createFieldLine(size, name, values[i])); + this.createFieldLine(size, name, required, values[i])); } } @@ -94,19 +94,22 @@ EditorFactory.prototype.createMultiField = function(label, name, size, id, return div; } -EditorFactory.prototype.createFieldLine = function(size, name, value) { +EditorFactory.prototype.createFieldLine = function(size, name, required, value) { var fieldDiv = document.createElement("div"); $(fieldDiv).addClass("field"); var fieldName = document.createElement("label"); $(fieldName).html(name); var field = document.createElement("input"); $(field).attr("type", "text"); + if(required=="true"){ + $(field).attr("required", "required"); + } // $(field).attr("maxlength", size); $(field).attr("value", value); $(fieldDiv).append(fieldName.outerHTML + field.outerHTML); return fieldDiv; } -EditorFactory.prototype.createFile = function(label, name, size, id, value) { +EditorFactory.prototype.createFile = function(label, name, required, size, id, value) { if (size == null || size <= 0) { size = 150; } @@ -119,6 +122,9 @@ EditorFactory.prototype.createFile = function(label, name, size, id, value) { $(fieldName).html(name); var file = document.createElement("input"); $(file).attr("type", "file"); + if(required == "true"){ + $(field).attr("required", "required"); + } // $(field).attr("maxlength", size); $(fileEditor).append(fieldName.outerHTML + file.outerHTML); $(div).children(".editor").append(fileEditor); @@ -134,7 +140,7 @@ EditorFactory.prototype.createTable = /** * @param value * @returns */ -function(label, name, cols, id, value) { +function(label, name, required, cols, id, value) { var div = this.createBaseEditor(label, id); $(div).children(".editor").attr("editorType", "table"); @@ -152,7 +158,7 @@ function(label, name, cols, id, value) { function(event) { event.preventDefault(); $(this).parent().children("table").children("tbody").append( - createTr(event.data.headers, event.data.fieldName)); + createTr(event.data.headers, event.data.fieldName, required)); }); var deleteButton = document.createElement("button"); $(deleteButton).html("remove"); @@ -188,7 +194,7 @@ function(label, name, cols, id, value) { var tbody = document.createElement("tbody"); $(thead).append(createHeader(headers)); for (var i = 0; i < values.length; i++) {//this minus one because there is a "|;" in the end of value string - $(tbody).append(createTr(headers, name, values[i])); + $(tbody).append(createTr(headers, name, required, values[i])); } $(table).append(thead); @@ -208,7 +214,7 @@ function(label, name, cols, id, value) { } return tr; } - function createTr(headers, name, value) { + function createTr(headers, name, required, value) { value == null? value="":value; var values = value.split("|"); var tr = document.createElement("tr"); @@ -220,6 +226,9 @@ function(label, name, cols, id, value) { var input = document.createElement("input"); $(input).attr("type", "text"); $(input).attr("style","width:"+"90%"); + if(required == "true"){ + $(field).attr("required", "required"); + } if(values[i] != undefined){ $(input).val(values[i].split("=")[1]); } @@ -259,7 +268,7 @@ EditorFactory.prototype.createSelect = function(label, name, size, options, id, $(div).children(".editor").append(select); return div; } -EditorFactory.prototype.createDate = function(label, name, size, id, value) { +EditorFactory.prototype.createDate = function(label, name, required, size, id, value) { if (size == null || size < 0) { size = 150 @@ -270,6 +279,9 @@ EditorFactory.prototype.createDate = function(label, name, size, id, value) { $(dateLabel).html(name); var date = document.createElement("input"); $(date).attr("type", "date"); + if(required == "true"){ + $(field).attr("required", "required"); + } $(div).children(".editor").append(dateLabel); $(div).children(".editor").append(date); return div;