refactor the test jsp

This commit is contained in:
fanfuxiaoran 2014-01-14 11:35:23 +08:00
parent 197f012592
commit 5c00d49a9e
5 changed files with 266 additions and 14 deletions

View File

@ -1,9 +1,13 @@
h3,h4,h5{
color:#000;
}
.test-name-frame{
padding:15px;
background-color:#f5f5f5;
border-top-style:solid;
border-top-color:#dcdcdc;
border-top-color:#369bd7;
margin-top:10px;
}
.test-name-title{
margin-top:10px;
@ -22,24 +26,47 @@ i{
float:left;
}
.title{
font-size:20px;
font-size:15px;
margin-left:30px;
}
.content-frame{
display:none;
padding:15px;
/* display:none;
padding:15px; */
background-color:#f5f5f5;
border-top-style:solid;
border-top-color:#dcdcdc;
padding-left:10px;
margin-bottom:20px;
}
.float-left{
float:left;
}
.script-button{
height:75%;
width:90%;
padding:0;
}
.table-margin-top{
margin-top:10px;
margin-top:15px;
/* margin-left:20px; */
width:100%;
}
#userConfig{
width:60%;
}
#userConfig td,th{
text-align:left;
}
select{
margin-bottom:0px;
}
#highchartsPlot{
margin-left:280px;
margin-top:10px;
margin-bottom:10px;
width:85%;
}
.centre{
margin:20px;
@ -67,6 +94,7 @@ i{
}
.load-config-input-alert{
width:100px;
border:red 2px solid;
}
.allocation-input{

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

View File

@ -164,17 +164,19 @@ function getScriptId(scriptName){
function viewScript(node){
var scriptId;
var scriptName;
var index;
var selectNodes=document.getElementsByName("select");
var editScriptButtons=document.getElementById("userConfig").getElementsByTagName("button");
var length=editScriptButtons.length;
/* var index;*/
var selectNodes=document.getElementsByName("select");
/*var editScriptButtons=document.getElementById("userConfig").getElementsByTagName("button");
var editScriptButtons=$("#userConfig>a>button");*/
/*var length=editScriptButtons.length;
for(var i=0;i<length;i++){
if(editScriptButtons[i]==node)
{
index=i;
break;
}
}
}*/
var index=node.parentNode.parentNode.rowIndex-1;
scriptName=selectNodes[index].options[selectNodes[index].selectedIndex].value;
scriptId=getScriptId(scriptName);
window.open("script-edit.jsp?name=" + scriptName + "&scriptId=" + scriptId);
@ -309,7 +311,6 @@ function loadSchedulePlot(){
defaultSeriesType:'line',
type:'area',
height:300,
width:400
},
plotOptions:{

View File

@ -0,0 +1,223 @@
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<html>
<head>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<meta charset="utf-8">
<title>Bench4Q</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="Bench4Q, a new method for QOS benchmarking.">
<meta name="author" content="Kai Ren">
<!-- The styles -->
<link id="bs-css" href="css/bootstrap-cerulean.css" rel="stylesheet">
<style type="text/css">
body {
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/charisma-app.css" rel="stylesheet">
<link href="css/jquery-ui-1.8.21.custom.css" rel="stylesheet">
<link href='css/chosen.css' rel='stylesheet'>
<link href='css/uniform.default.css' rel='stylesheet'>
<link href='css/colorbox.css' rel='stylesheet'>
<link href='css/jquery.noty.css' rel='stylesheet'>
<link href='css/noty_theme_default.css' rel='stylesheet'>
<link href='css/elfinder.min.css' rel='stylesheet'>
<link href='css/elfinder.theme.css' rel='stylesheet'>
<link href='css/opa-icons.css' rel='stylesheet'>
<link href='css/uploadify.css' rel='stylesheet'>
<link href='bench4q-css/bench4q.css' rel='stylesheet'>
<link rel="shortcut icon" href="img/favicon.ico">
<link href='css/buttons.css' rel='stylesheet'>
<link href='bench4q-css/test-new.css' rel='stylesheet'>
</head>
<body>
<fmt:bundle basename="i18n">
<jsp:include page="publiccontrol/navigatebar.jsp"></jsp:include>
<div class="container-fluid">
<div class="row-fluid">
<jsp:include page="publiccontrol/leftmenubar.jsp"></jsp:include>
<div id="content" class="span10">
<!-- content starts -->
<!-- up navigatebar start-->
<div>
<ul class="breadcrumb">
<li><a href="homepage.jsp"><fmt:message key="home" /></a> <span
class="divider">/</span></li>
<li><a href="#"><fmt:message key="creatatest" /></a></li>
</ul>
</div>
<!-- up navigatebar ends -->
<div>
<h3>Create test configuration</h3>
</div>
<div class="test-name-frame">
<div>
<p class="test-name-title">Test configuration name</p>
<input id="testConfigurationName" class="name-input" type="text"
class="text-left" onblur="checkName()" />
<div id="nameMessage" class="hide">the test configuration
name can not be empty!</div>
</div>
</div>
<!--box content-->
<div class="title-frame">
<a href="#"><i class="icon-minus" id="icon-load"
onClick="toggleTestExecutionPlan()"></i></a>
<p class="title">Load test execution plan</p>
</div>
<div id="loadTestExecutionPlan" class="content-frame row-fluid">
<div class="span4">
<table id="loadConfig" class="table-margin-top">
<tr>
<th>RequireLoad</th>
<td><input id="RequireLoad" class="load-config-input"
type="text" value="10"
onblur="loadSchedulePlot();checkLoadConfig()" /></td>
</tr>
<tr>
<td height="15"></td>
</tr>
<tr>
<th>Warm Up</th>
<td><input id="WarmUp" class="load-config-input"
type="text" value="10"
onblur="loadSchedulePlot();checkLoadConfig()" /></td>
</tr>
<tr>
<td height="15"></td>
</tr>
<tr>
<th>Cool Down</th>
<td><input id="CoolDown" class="load-config-input"
type="text" value="10"
onblur="loadSchedulePlot();checkLoadConfig()" /></td>
</tr>
<tr>
<td height="15"></td>
</tr>
<tr>
<th>ExecuteRange</th>
<td><input id="ExecuteRange" class="load-config-input"
type="text" value="10"
onblur="loadSchedulePlot();checkLoadConfig()" /></td>
</tr>
</table>
<span id="loadConfigMessage" class="hide">all input can
not be empty <br />and must be greater than zero!
</span>
</div>
<div class="span8">
<div id="highchartsPlot"></div>
</div>
</div>
<div class="title-frame">
<a href="#"><i class="icon-minus" id="icon-user"
onClick="toggleUserScenarios()"></i></a>
<p class="title">User scenarios</p>
</div>
<div id="userScenarios" class="content-frame">
<table id="userConfig" class="table-margin-top">
<tr>
<th>Allocation %</th>
<th>Script Name</th>
<th>Operation</th>
</tr>
<tr>
<td><input class="allocation-input" value="100" type="text"
onblur="changeTotal();checkUserScenarios()" /> %</td>
<td><select name="select">
</select></td>
<td>
<a href="#"
class="button script-button" onClick="viewScript(this)"><img
src="/images/script_edit.png"
alt="Add"> View/Edit user script</a>
</td>
</tr>
</table>
<table>
<tr>
<th>Total:</th>
<th id="totalNumber" class="total-right">100%</th>
</tr>
</table>
<div id="alertMessage" class="hide">The total allocation
needs to be 100%</div>
<button type="submit" class="btn btn-primary add-button"
id="userScenariosButton"
onClick="addScenario();checkUserScenarios()">Add
scenario</button>
<div id="userConfigMessage" class="hide">all input can not
be empty and must be greater than zero!</div>
</div>
<div class="title-frame">
<a href="#"><i class="icon-minus float-left" id="icon-ip"
onClick="toggleIpConfig()"></i></a>
<p class="title">IP config</p>
</div>
<div id="ipConfig" class="content-frame">
<table id="ipConfigTable" class="table-margin-top">
<tr>
<th>IP:</th>
<th><input type="text" class="ip-input" onblur="checkIP()" /></th>
</tr>
</table>
<button type="submit" class="btn btn-primary add-button"
onClick="addIP();checkIP()">Add IP</button>
<div id="ipConfigMessage" class="hide">all IP address can
not be empty and must be consistent with the format!</div>
</div>
<div class="span12 center">
<button
class="btn-large btn-primary"
onClick="startTest()"><h4>Create test configuration and start Test</h4></button>
</div>
</div>
</div>
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
</div>
<!--/.fluid-container-->
<!-- external javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- jQuery -->
<script src="js/jquery-1.7.2.min.js"></script>
<!-- jQuery UI -->
<script src="js/jquery-ui-1.8.21.custom.min.js"></script>
<!-- custom dropdown library -->
<script src="js/bootstrap-dropdown.js"></script>
<!-- library for advanced tooltip -->
<script src="js/bootstrap-tooltip.js"></script>
<!-- popover effect library -->
<script src="js/bootstrap-popover.js"></script>
<!-- library for cookie management -->
<script src="js/jquery.cookie.js"></script>
<!-- application script for Charisma demo -->
<script src="js/theme.js"></script>
<!-- <script src="script/base.js"></script> -->
<script src="script/test-new.js"></script>
<script src="js/highcharts.js"></script>
</fmt:bundle>
</body>
</html>

View File

@ -62,9 +62,9 @@ body {
<div>
<div>
<div>
<h2>
<h3>
Create test configuration
</h2>
</h3>
</div>
<div class="test-name-frame">
<div><p class="test-name-title">Test configuration name</p>