...
|
...
|
@@ -105,6 +105,19 @@ |
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<button id="btnNew" class="btn btn-primary" style="margin-left: 10px;margin-top:10px" onclick="testexecute()">
|
|
|
集成测试
|
|
|
</button>
|
|
|
</div>
|
|
|
<div class="widget-title" style="height: 40px;display:none;" id="testingdiv">
|
|
|
<div>
|
|
|
<div class="form-inline" role="form">
|
|
|
<div class="input-group" style="float: left;margin-left: 25px;margin-top:3px">
|
|
|
<span class="input-group-addon">集成测试结果:</span>
|
|
|
<input type="text" readonly="readonly" id="testingresult" name="testingresult" style="width: 500px" class="form-control" placeholder="" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<c:forEach items="${messageList }" var="message">
|
|
|
<div style="float: left;height: 600px;">
|
...
|
...
|
@@ -209,6 +222,70 @@ |
|
|
});
|
|
|
}
|
|
|
|
|
|
//做停止用
|
|
|
var setIntervalIndex;
|
|
|
/**
|
|
|
* 集成测试
|
|
|
*/
|
|
|
function testexecute(){
|
|
|
var value;
|
|
|
var envi = $("#environment_name").val();
|
|
|
if(envi == "aws"){
|
|
|
value = 6;
|
|
|
}else if(envi == "qcloud"){
|
|
|
value = 7;
|
|
|
}else{
|
|
|
value = 5;
|
|
|
}
|
|
|
if(setIntervalIndex != null && setIntervalIndex != undefined){
|
|
|
clearInterval(setIntervalIndex);
|
|
|
setIntervalIndex = null;
|
|
|
}
|
|
|
$.ajax({
|
|
|
url: contextPath + 'project/testexecute?env=' + value,
|
|
|
type: 'POST',
|
|
|
dataType: 'json',
|
|
|
success: function (returnVal) {
|
|
|
if(returnVal == null || returnVal.data == null){
|
|
|
alert("http://qmc.yohops.com:9999/autoTask/executeApiAutoTask,参数env="+value+",post请求失败!");
|
|
|
}
|
|
|
var json = returnVal.data;
|
|
|
//获取到id
|
|
|
var id = json.id;
|
|
|
setIntervalIndex = setInterval(function(){testget(id);}, 1000 * 60);
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 集成测试
|
|
|
*/
|
|
|
function testget(id){
|
|
|
if(id == null || id == undefined){
|
|
|
return;
|
|
|
}
|
|
|
$.ajax({
|
|
|
url: contextPath + 'project/testget?id=' + id,
|
|
|
type: 'POST',
|
|
|
dataType: 'json',
|
|
|
success: function (returnVal) {
|
|
|
if(returnVal == null || returnVal.data == null){
|
|
|
return;
|
|
|
}
|
|
|
var message = returnVal.message;
|
|
|
var code = returnVal.code;
|
|
|
|
|
|
$("#testingdiv").show();
|
|
|
$("#testingresult").val("id:" + id + ";message:" + message + ";code:"+code);
|
|
|
|
|
|
clearInterval(setIntervalIndex);
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<script>
|
...
|
...
|
|