diff --git a/Bench4Q-Web/src/main/java/org/bench4q/web/api/ScriptController.java b/Bench4Q-Web/src/main/java/org/bench4q/web/api/ScriptController.java index bea2ce05..c47eeb66 100644 --- a/Bench4Q-Web/src/main/java/org/bench4q/web/api/ScriptController.java +++ b/Bench4Q-Web/src/main/java/org/bench4q/web/api/ScriptController.java @@ -21,9 +21,11 @@ import org.bench4q.web.masterMessager.ScriptMessager; import org.bench4q.web.model.ScenarioModel; import org.bench4q.web.service.ScriptService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; @@ -101,7 +103,6 @@ public class ScriptController extends BaseController { if (operateScriptServerResponseModel.isSuccess()) { ScriptModel scriptModel = operateScriptServerResponseModel .getScriptModels().get(0); - System.out.println(scriptModel.getScriptContent()); RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper .tryUnmarshal(RunScenarioModel.class, scriptModel.getScriptContent()); @@ -132,7 +133,6 @@ public class ScriptController extends BaseController { if (operateScriptServerResponseModel.isSuccess()) { ScriptModel scriptModel = operateScriptServerResponseModel .getScriptModels().get(0); - System.out.println(scriptModel.getScriptContent()); RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper .tryUnmarshal(RunScenarioModel.class, scriptModel.getScriptContent()); @@ -252,7 +252,6 @@ public class ScriptController extends BaseController { Gson gson = new Gson(); RunScenarioModel runScenarioModel = gson.fromJson(runScenarioModelStr, RunScenarioModel.class); - System.out.println(MarshalHelper.tryMarshal(runScenarioModel)); return processScriptResponse( map, this.getScriptMessager().updateScript(accessToken, scriptId, @@ -289,6 +288,22 @@ public class ScriptController extends BaseController { this.getScriptMessager().stopScriptRecordServer(accessToken, port, scriptRecordUUID)); } + + @RequestMapping("testRecordProxy") + @ResponseBody + public Map testRecordProxy( + @RequestHeader HttpHeaders headers) { + Map map = new HashMap(); + //is from proxy + boolean isFromProxy = Boolean.parseBoolean(headers.getFirst("FromProxy")); + if(isFromProxy) + { + success(map); + }else{ + fail(map,"proxy setting error!"); + } + return map ; + } @RequestMapping("saveScriptRecorded") @ResponseBody diff --git a/Bench4Q-Web/src/main/resources/ipConfig.properties b/Bench4Q-Web/src/main/resources/ipConfig.properties index 06535e4f..61377bd7 100644 --- a/Bench4Q-Web/src/main/resources/ipConfig.properties +++ b/Bench4Q-Web/src/main/resources/ipConfig.properties @@ -1 +1 @@ -masterAddress=133.133.2.100:8901 \ No newline at end of file +masterAddress=localhost:8901 \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/script/scriptManager/dataCollect.js b/Bench4Q-Web/src/main/webapp/script/scriptManager/dataCollect.js index 1be2cb67..ab31bf59 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptManager/dataCollect.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptManager/dataCollect.js @@ -65,7 +65,7 @@ DataCollector.prototype.multiFieldData = function(editor) { }; DataCollector.prototype.tableData = function(editor) { - var thArray = editor.find("thead").children("tr")[0].children("th"); + var thArray = editor.find("thead").children("tr").children("th"); var editorArray = editor.find("tbody").children("tr"); var name = editor.attr("id"); var value = ""; @@ -77,14 +77,14 @@ DataCollector.prototype.tableData = function(editor) { || $(tdArray[j]).children("input").val() == "") { continue; } - trValue += thArray[j] + "=" + $(tdArray[j]).children("input").val() + trValue += thArray[j].innerText + "=" + $(tdArray[j]).children("input").val() + "|"; } trValue = trValue.substring(0, trValue.length - 1); - value += trValue + ";"; + value += trValue + "|;"; } - value = value.substring(0, value.length - 1); + value = value.substring(0, value.length - 2); // if (!this.validate(value)) { // return false; // }