disable stop-testplan button when test plan completed

This commit is contained in:
hmm 2014-09-10 11:13:38 +08:00
parent 25c9af9af1
commit f030705b35
1 changed files with 27 additions and 20 deletions

View File

@ -28,6 +28,11 @@ $(function() {
chartSelector.initChart();
graphButtonListener(chartSelector);
UrlContentTypeDistribution("pie-chart", testPlanRunId);
if(testPlan.currentStatus == "Complete"){
$("#stop-testplan").attr('disabled', true);
}else{
$("#stop-testplan").attr('disabled', false);
$("#stop-testplan").click(function() {
if ($("#status").attr("status") == "InRunning") {
$.post("stop/" + testPlanRunId, {}, function(data) {
@ -35,6 +40,7 @@ $(function() {
$('#status').attr("status", "Complete");
var testStatus = testStatusMap("Complete");
$('#status').html("<h4>" + testStatus + '</h4>');
$("#stop-testplan").attr('disabled', true);
} else {
information($.i18n("stopTestPlan_fail"));
}
@ -48,6 +54,7 @@ $(function() {
}
});
}
});
function getTestInfo(testPlanId) {
var testPlan;