From bdba094fffe0daf4b09391b9f8bfb32cb255b3e9 Mon Sep 17 00:00:00 2001 From: luqiong <605601787@qq.com> Date: Thu, 4 Sep 2014 18:54:32 +0800 Subject: [PATCH] modify testPlan settings charPlots --- Bench4Q-Web/src/main/webapp/css/test.css | 9 ++- .../script/TestPlan/TestPlanDataCollect.js | 28 +------ .../main/webapp/script/TestPlan/TestPlanUI.js | 32 +++++--- .../src/main/webapp/script/TestPlan/test.js | 16 ++++ Bench4Q-Web/src/main/webapp/test.jsp | 73 ++++++++++--------- 5 files changed, 83 insertions(+), 75 deletions(-) diff --git a/Bench4Q-Web/src/main/webapp/css/test.css b/Bench4Q-Web/src/main/webapp/css/test.css index 4e34e13d..ae60ebbf 100644 --- a/Bench4Q-Web/src/main/webapp/css/test.css +++ b/Bench4Q-Web/src/main/webapp/css/test.css @@ -91,13 +91,15 @@ select{ border:red 2px solid; } .load-config-input{ - width:100px; + width:150px; } .load-config-input-alert{ width:100px; - border:red 2px solid; } +#loadConfig td{ + padding-left:50px; +} .allocation-input{ width:100px; } @@ -112,3 +114,6 @@ select{ width:150px; border:red 2px solid; } +#addStep{ + margin-left:50px; +} \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanDataCollect.js b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanDataCollect.js index 4c63f09d..8dc10214 100644 --- a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanDataCollect.js +++ b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanDataCollect.js @@ -59,26 +59,6 @@ function checkRequireLoad() { "load-config-input"); } -function checkWarmUp() { - if (parseInt($("#WarmUp").val()) <= 0 - || $("#WarmUp").val() == "") - $("#WarmUp").attr("class", - "load-config-input-alert"); - else - $("#WarmUp").attr("class", - "load-config-input"); -} - -function checkCoolDown() { - if (parseInt($("#CoolDown").val()) <= 0 - || $("#CoolDown").val() == "") - $("#CoolDown").attr("class", - "load-config-input-alert"); - else - $("#CoolDown").attr("class", - "load-config-input"); -} - function checkExecuteRange() { if (parseInt($("#ExecuteRange").val()) <= 0 || $("#ExecuteRange").val() == "") @@ -91,13 +71,9 @@ function checkExecuteRange() { function checkLoadConfig() { checkExecuteRange(); - checkCoolDown(); checkRequireLoad(); - checkWarmUp(); - if ($("#ExecuteRange").attr("class") == "load-config-input" - && $("#CoolDown").attr("class") == "load-config-input" - && $("#WarmUp").attr("class") == "load-config-input" - && $("#RequireLoad").attr("class") == "load-config-input") + if ($('input[name="ExecuteRange"]').attr("class") == "load-config-input" + && $('input[name="RequireLoad"]').attr("class") == "load-config-input") $("#loadConfigMessage").attr("class", "hide"); else diff --git a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanUI.js b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanUI.js index 2242f1dc..c742b07c 100644 --- a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanUI.js +++ b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanUI.js @@ -24,11 +24,11 @@ function loadSchedulePlot() { defaultSeriesType : 'line', type : 'area', height : 300, - }, plotOptions : { series : { - fillOpacity : 0.5, + fillOpacity : 0.85, + color : '#369bd7' } }, credits : { @@ -44,6 +44,9 @@ function loadSchedulePlot() { xAxis : { categories : [ 0 ], min : 0, + title : { + text : 'Time(s)' + } }, yAxis : { plotLines : [ { @@ -51,6 +54,9 @@ function loadSchedulePlot() { width : 1, color : '#808080' } ], + title : { + text : 'Users' + }, min : 0 }, tooltip : { @@ -63,16 +69,18 @@ function loadSchedulePlot() { data : [ 0 ] } ] }; - var RequireLoad = parseInt($("#RequireLoad").val()); - var WarmUp = parseInt($("#WarmUp").val()); - var CoolDown = parseInt($("#CoolDown").val()); - var ExecuteRange = parseInt($("#ExecuteRange").val()); - options.xAxis.categories.push(WarmUp); - options.xAxis.categories.push(WarmUp + ExecuteRange); - options.xAxis.categories.push(WarmUp + ExecuteRange + CoolDown); - options.series[0].data.push(RequireLoad); - options.series[0].data.push(RequireLoad); - options.series[0].data.push(0); + var RequireLoadLength = $('input[name="RequireLoad"]').length; + var RequireLoad = 0; + for(var i = 1; i < RequireLoadLength; i++){ + RequireLoad = parseInt($('input[name="RequireLoad"]')[i].value); + options.series[0].data.push(RequireLoad); + } + var ExecuteRangeLength = $('input[name="ExecuteRange"]').length; + var ExecuteRange = 0; + for(var i = 1; i < ExecuteRangeLength; i++){ + ExecuteRange += parseInt($('input[name="ExecuteRange"]')[i].value); + options.xAxis.categories.push(ExecuteRange); + } var chart = new Highcharts.Chart(options); } diff --git a/Bench4Q-Web/src/main/webapp/script/TestPlan/test.js b/Bench4Q-Web/src/main/webapp/script/TestPlan/test.js index 6ed62bc2..dd2580c1 100644 --- a/Bench4Q-Web/src/main/webapp/script/TestPlan/test.js +++ b/Bench4Q-Web/src/main/webapp/script/TestPlan/test.js @@ -9,6 +9,22 @@ $("#selectFilter #ok").click(function() { $("#createFilter").click(function() { $("#selectFilter").show(); }) +$("#addStep").click(function(){ + var clone=$("#step-clone-continuous").clone(); + clone.removeAttr('id'); + clone.show(); + clone.appendTo('#test-plan-continuous'); + loadSchedulePlot(); + checkLoadConfig(); +}); +function deleteStep(){ + var deleteStep = document.getElementsByClassName('deleteStep'); + var length = deleteStep.length; + var deleteObj = $(deleteStep[length-1]).parent().parent().parent().parent().parent(); + deleteObj.remove(); + loadSchedulePlot(); + checkLoadConfig(); +} var scenarioConfigContent; function addScenario() { //create delete button diff --git a/Bench4Q-Web/src/main/webapp/test.jsp b/Bench4Q-Web/src/main/webapp/test.jsp index 3e3d94c8..1883d4cc 100644 --- a/Bench4Q-Web/src/main/webapp/test.jsp +++ b/Bench4Q-Web/src/main/webapp/test.jsp @@ -82,41 +82,44 @@ body {
- - - - - - - - - - - - - - - - - - - - - - - - - - -
(s)
(s)
(s)
+
+ +
+ + + + + + + + + + + +
(s)
+
+
+ all input can not be empty
and must be greater than zero!