fix the bug in homepage and script

This commit is contained in:
fanfuxiaoran 2014-01-17 14:17:56 +08:00
parent c56c541a0e
commit 42505ee570
3 changed files with 9 additions and 4 deletions

View File

@ -138,11 +138,11 @@ body {
<div class="modal-footer">
<button type="button" class="btn btn-primary"
onClick="startServer()">
onClick="startServer()" id="startServer">
<fmt:message key="startserver" />
</button>
<button type="button" class="btn btn-primary"
onClick="stopServer()">
onClick="stopServer()" id="stopServer">
<fmt:message key="stopserver" />
</button>
<button type="button" id="uploadScript" class="btn btn-primary">

View File

@ -19,7 +19,7 @@ function loadTests(table, model,loadLength,actionButton) {
$.post("loadTestPlans", {}, function(data) {
if (data != null) {
if (data.list != null){
if(loadLength<=0)
if(data.list.length<loadLength)
loadLength=data.list.length;
for ( var i = 0; i < loadLength; i++)
table.dataTable().fnAddData(

View File

@ -8,6 +8,7 @@ $('.datatable').dataTable({
}
} );
// add error massage!
$('.btn-setting').click(function(e) {
e.preventDefault();
$('#myModal').modal('show');
@ -30,6 +31,8 @@ function startServer() {
}
}, "json");
$('#startServer').attr('disabled', true);
$('#stopServer').attr('disabled', false);
}
$('#uploadScript').click(function(){
var myModalContent=$('#myModal').html();
@ -73,6 +76,8 @@ function stopServer() {
else{
$('#scriptInfo').text("record script server has not started");
}
$('#stopServer').attr('disabled', true);
$('#startServer').attr('disabled', false);
}
function saveScript() {
@ -95,6 +100,6 @@ function saveScript() {
}
$(document).ready(function() {
loadScript(table,2);
$('#stopServer').attr('disabled', true);
});