response host ip to web when recording script

resolve stop recording button 
add highlight in new script and new testplan webpage
This commit is contained in:
hmm 2014-09-04 17:43:29 +08:00
parent ff5dd49e0b
commit 37abca2229
9 changed files with 37 additions and 33 deletions

View File

@ -368,7 +368,7 @@ public class ScriptController extends BaseController {
OperateScriptServerResponseModel responseModel = new OperateScriptServerResponseModel();
responseModel.setSuccess(isSuccess);
responseModel.setFailCauseString(failCauseString);
responseModel.setHostName(hostName);
responseModel.setHostNameString(hostName);
responseModel.setPort(port);
responseModel.setFileName(fileName);
if (scriptModels == null || scriptModels.size() == 0) {

View File

@ -37,16 +37,7 @@ public class OperateScriptServerResponseModel {
public void setFailCauseString(String failCauseString) {
this.failCauseString = failCauseString;
}
@XmlElement
public String getHostNameString() {
return hostNameString;
}
public void setHostName(String hostNameString) {
this.hostNameString = hostNameString;
}
@XmlElement
public int getPort() {
return port;
@ -65,6 +56,15 @@ public class OperateScriptServerResponseModel {
this.fileName = fileName;
}
@XmlElement
public String getHostNameString() {
return hostNameString;
}
public void setHostNameString(String hostNameString) {
this.hostNameString = hostNameString;
}
@XmlElement
public List<ScriptModel> getScriptModels() {
return scriptModels;

View File

@ -226,11 +226,11 @@ body {
<script src="lib/bootstrap/js/bootstrap-modal.js"></script>
<script src="lib/chrisma/js/jquery.cookie.js"></script>
<script src="lib/chrisma/js/theme.js"></script>
<!-- <script src="script/base.js"></script> -->
<script src="lib/HashMap/HashMap.js"></script>
<script src="lib/other/jstree.min.js"></script>
<script src="lib/other/jquery.msgbox.min.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/base.js"></script>
<script src="script/scriptManager/scriptModels.js"></script>
<script src="script/scriptManager/editorFactory.js"></script>
<script src="script/scriptManager/containerFactory.js"></script>

View File

@ -145,7 +145,7 @@ body {
<div class="modal hide fade" id="myModal">
<div class="modal-header">
<button type="button" id="myModal-close" class="close"
data-dismiss="modal">×</button>
data-dismiss="modal" onclick="resetMsg()">×</button>
<h3>
<fmt:message key="settings" />
</h3>

View File

@ -13,16 +13,16 @@ function startServer() {
$("#target-url2").val($("#target-url").val());
$('#scriptInfo2').text(
$.i18n.prop("setProxy")+
" IP:133.133.2.100"
+ " ,port: " + server.port
" IP:"+server.hostNameString
+ " , port: " + server.port
+ $.i18n.prop("recordScript"))
$('#stopRecording').attr('disabled', false);
$('#stopRecording').attr('disabled', true);
$('#startRecording').attr('disabled', false);
startServerSuccess = true;
stopServerSuccess = false;
} else {
$('#scriptInfo').html(
$.i18n.prop("startServerFail") + data.failedMessage);
information($.i18n.prop("startServerFail") + data.failedMessage);
}
}, "json");
}
@ -46,7 +46,6 @@ function startRecording() {
$('#stopRecording').attr('disabled', false);
$('#startRecording').attr('disabled', true);
startRecordingSuccess = true;
stopServerSuccess = false;
}
}, "json");
} else {
@ -63,19 +62,15 @@ function stopRecording() {
if (!data.success) {
$('#scriptInfo3').text(
"stop record server error:" + data.failedMessage);
$('#stopRecording').attr('disabled', true);
$('#startRecording').attr('disabled', false);
}
else {
$('#scriptInfo3').text($.i18n.prop("stopRecord"));
$('#stopRecording').attr('disabled', true);
$('#fileName').show();
stopServer();
stopServerSuccess = true;
startRecordingSuccess = false;
}
$('#stopRecording').attr('disabled', true);
}, "json");
} else {
$('#scriptInfo3').text("record script server has not started");
@ -91,13 +86,11 @@ function stopServer() {
if (!data.success) {
$('#scriptInfo3').text(
"stop record server error:" + data.failedMessage);
$('#stopRecording').attr('disabled', true);
$('#startRecording').attr('disabled', false);
}
else {
stopServerSuccess = true;
startServerSuccess = false;
}
$('#startRecording').attr('disabled', false);
}, "json");
} else {
$('#scriptInfo3').text("record script server has not started");

View File

@ -5,12 +5,12 @@ $('.btn-setting').click(function(e) {
function dismiss(container){
$(container).modal('hide');
if(startRecordingSuccess && !stopServerSuccess){
if(startRecordingSuccess){
stopRecording();
$('#fileName').hide();
}
if(startServerSuccess && !stopServerSuccess)
}else if(startServerSuccess)
stopServer();
resetMsg();
}
$('#uploadScript')
@ -51,4 +51,7 @@ $(document).ready(function() {
function refresh() {
location.replace(location);
}
function resetMsg(){
$('#scriptInfo').html($.i18n.prop("startServer"));
}

View File

@ -16,9 +16,7 @@ function loadScript(table) {
new Date(scripts[i].createDateTime),
editButton + deleteButton ]).draw().node();
$(tr).attr("id", scripts[i].id);
}
} else {
information(data.failedMessage);
}

View File

@ -6,11 +6,20 @@ function ScriptModel(ID, load, warmup, cooldown, executeRange, isFilterTimer, fi
this.cooldown = cooldown;
this.isFilterTimer = isFilterTimer;
this.filterTypeMatches = filterTypeMatches;
}
};
function TestPlanRequestModel(scriptList, ipList, testPlanName) {
this.scriptList = scriptList;
this.ipList = ipList;
this.testPlanName = testPlanName;
};
};
function WebScheduleModel(points){
this.points = points;
}
function WebPointModel(timeInSecond, load){
this.timeInSecond = timeInSecond;
this.load = load;
}

View File

@ -225,6 +225,7 @@ body {
<script src="lib/chrisma/js/theme.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="lib/other/jquery.noty.packaged.min.js"></script>
<script src="script/base.js"></script>
<script src="script/scriptManager/uiFactory.js"></script>
<script src="script/Share/loadProperties.js"></script>
<script src="script/TestPlan/TestPlanModels.js"></script>