";
tableHtml += "";
tableHtml += " ";
tableHtml += " ";
@@ -245,35 +250,35 @@ function CreateTableHTML_Benchmark(jsonObj){
tableHtml += "";
tableHtml += ""+index+" ";
if(val.additional_option == "restart"){
- tableHtml += "";
+ tableHtml += "";
tableHtml += "NULL ";
tableHtml += "restart ";
tableHtml += "redeploy ";
tableHtml += "resetPerf ";
}
if(val.additional_option == "redeploy"){
- tableHtml += "";
+ tableHtml += "";
tableHtml += "NULL ";
tableHtml += "restart ";
tableHtml += "redeploy ";
tableHtml += "resetPerf ";
}
if(val.additional_option == "resetPerf"){
- tableHtml += "";
+ tableHtml += "";
tableHtml += "NULL ";
tableHtml += "restart ";
tableHtml += "redeploy ";
tableHtml += "resetPerf ";
}
if(val.additional_option == "NULL"){
- tableHtml += "";
+ tableHtml += "";
tableHtml += "NULL ";
tableHtml += "restart ";
tableHtml += "redeploy ";
tableHtml += "resetPerf ";
}
if(val.additional_option == ""){
- tableHtml += "";
+ tableHtml += "";
tableHtml += "NULL ";
tableHtml += "restart ";
tableHtml += "redeploy ";
@@ -295,18 +300,20 @@ function CreateTableHTML_Benchmark(jsonObj){
//------------------------------ Events Definition ----------------------------
//label click opertion
function Label_Click(count,value){
- var rowNum = count;
- olabel = document.getElementById("label_id_"+rowNum);
- olabel.style.backgroundColor = "#cff";
+ if(GetDataByAjax(address-userrole) == 2){
+ var rowNum = count;
+ olabel = document.getElementById("label_id_"+rowNum);
+ olabel.style.backgroundColor = "#cff";
- otd = document.getElementById("td_value_id_"+rowNum);
- otd.removeChild(olabel);
+ otd = document.getElementById("td_value_id_"+rowNum);
+ otd.removeChild(olabel);
- var strHtml = " ";
- strHtml += " ";
- strHtml += " ";
+ var strHtml = " ";
+ strHtml += " ";
+ strHtml += " ";
- otd.innerHTML =strHtml;
+ otd.innerHTML =strHtml;
+ }
}
//edit value apply
@@ -317,7 +324,7 @@ function Ok_Apply(rowNum){
otd.innerHTML =" "+ valueStr +" ";
//--------set to ajax----------
- var request_type,key,value;//set_config?request_type= &key= &value=
+ var request_type,key,value;//set_config?request_type= &key= &value=
request_type= $("#div_Configuration_right_top_titel_id").attr("title");
key = $("#td_value_id_"+rowNum).parent().children().eq(1).children("label").text();
value = $("#td_value_id_"+rowNum).parent().children().eq(2).children("label").text();
@@ -343,7 +350,7 @@ function Ok_Apply(rowNum){
Append_Row_to_Configuration(value)
});
}
-
+
CheckTableDataError();
ExecutvieCheckSync();
}
@@ -363,14 +370,16 @@ function Additional_option_change(){
//label click opertion
function Label_benchmark_Click(rowNum , colNum , value){
- olabel = document.getElementById("label_benchmark_id_" + rowNum + "_" + colNum);
- olabel.style.backgroundColor = "#cff";
- otd = document.getElementById("td_benchmark_id_" + rowNum + "_" + colNum);
- otd.removeChild(olabel);
- var strHtml = " ";
- strHtml += " ";
- strHtml += " ";
- otd.innerHTML =strHtml;
+ if(GetDataByAjax(address-userrole) == 2){
+ olabel = document.getElementById("label_benchmark_id_" + rowNum + "_" + colNum);
+ olabel.style.backgroundColor = "#cff";
+ otd = document.getElementById("td_benchmark_id_" + rowNum + "_" + colNum);
+ otd.removeChild(olabel);
+ var strHtml = " ";
+ strHtml += " ";
+ strHtml += " ";
+ otd.innerHTML =strHtml;
+ }
}
//edit value apply
@@ -388,7 +397,7 @@ function Ok_benchmark_Apply(rowNum , colNum ){
function Cancel_benchmark_Apply(rowNum , colNum ,value){
otd = document.getElementById("td_benchmark_id_"+rowNum+ "_" + colNum);
otext = document.getElementById("text_benchmark_id_"+rowNum+ "_" + colNum);
- otd.innerHTML =" "+ value +" ";
+ otd.innerHTML =" "+ value +" ";
}
/********************************************************************************************************************************************************/
@@ -397,17 +406,17 @@ function Del(tableType){
if(tableType =="configuration"){
$(".checkbox_configuration_class").each(function(index,value){
if($(this).is(':checked')){
- var request_type, key ;//del_config?request_type=& key =
+ var request_type, key ;//del_config?request_type=& key =
request_type = $("#div_Configuration_right_top_titel_id").attr("title");;
key = $(this).parent().parent().children().eq(1).children("label").text();
- var data ={};
+ var data ={};
data.request_type= request_type;
data.key = key;
var result = GetDataByAjax_POST(address_Delete,data);
- $(this).parent().parent().remove();
+ $(this).parent().parent().remove();
}
});
}
@@ -417,7 +426,7 @@ function Del(tableType){
$(".checkbox_benchmark_class").each(function(index,value){
if($(this).is(':checked')){
rowNum = index;
- $(this).parent().parent().remove();
+ $(this).parent().parent().remove();
}
});
Submit_Benchmark();
@@ -435,7 +444,7 @@ function Del(tableType){
data.key = key;
var result = GetDataByAjax_POST(address_Report_Delete,data);
- $(this).parent().parent().remove();
+ $(this).parent().parent().remove();
}
});
}
@@ -474,8 +483,8 @@ function GetTableRowsCount(id){
}
//select elements for classname by js code
-function getElementsClass(classnames){
- var classobj= new Array();
+function getElementsClass(classnames){
+ var classobj= new Array();
var classint=0;
var tags=document.getElementsByTagName("*");
for(var i in tags){
@@ -582,10 +591,10 @@ function ConfigurationModal_OK(key, value, dsc){
$("#div_configuration_message_div").show();
}else{
//--------set to ajax----------
- var request_type,key,value;//set_config?request_type= &key= &value=
+ var request_type,key,value;//set_config?request_type= &key= &value=
request_type= $("#div_Configuration_right_top_titel_id").attr("title");
- var data ={};
+ var data ={};
data.request_type= request_type;
data.key = key;
data.value = value;
@@ -608,21 +617,21 @@ function Append_Row_to_Configuration(params){
html +="";
html +=" ";
html +=" ";
-
+
html += "";
html += ""+key+" ";
html += " ";
-
+
html += ""
html +=""+ value +" ";
html +=" ";
-
+
html += "";
html += ""+dsc+" ";
html += " ";
-
+
html += "";
- $("#table_id").append(html);
+ $("#table_id").append(html);
//if result check is false , add error sytle
if(check == false){
$("#td_value_id_"+rows).addClass("error");
@@ -775,14 +784,14 @@ function BenchMarkModel_OK(){
html += " ";
- $("#table_benchmark_id").append(html);
+ $("#table_benchmark_id").append(html);
Submit_Benchmark();
}
}
}
function Submit_Benchmark(){
- var post_json = {}//set_config?request_type=testcase &key=testcase &value=
+ var post_json = {}//set_config?request_type=testcase &key=testcase &value=
var table_data= [];
var benchmark_driver,worker,container_size,io_pattern,block_size,work_depth,ramup_time,run_time,device,parameter,desc;
@@ -803,7 +812,7 @@ function Submit_Benchmark(){
var rowid = $(this).parent().parent().children().eq(12).children().eq(0).text();
additional = document.getElementById("additional_option_dropdown_"+rowid).value;
- var data ={};
+ var data ={};
data.benchmark_driver = benchmark_driver;
data.worker = worker;
data.container_size = container_size;
@@ -824,7 +833,7 @@ function Submit_Benchmark(){
post_json.value = JSON.stringify(table_data);
post_json.key="testcase";
var address_Configuration_Set="../configuration/set_config";
- var result = GetDataByAjax_POST(address_Configuration_Set,post_json);
+ var result = GetDataByAjax_POST(address_Configuration_Set,post_json);
//--------------------------------------------------------------------
// check benchmark_driver type and load more benchmark configurations
/*engine_type_list = [];
diff --git a/webui/static/js/Script.js b/webui/static/js/Script.js
index c588650..1aa1ed5 100644
--- a/webui/static/js/Script.js
+++ b/webui/static/js/Script.js
@@ -3,7 +3,7 @@
Author: Sean,Lin
E-mail: xiangx.lin@intel.com
Date:2015-09-18
- Descrption:
+ Descrption:
**********************************/
//http://192.168.5.22:8080/configuration/get_group?request_type=cluster
var address_Configuration_Get="../configuration/get_group?request_type=";
@@ -22,6 +22,7 @@ var address_GetRuningStatus="../monitor/cetune_status";
var address_IntoRuningMode="../configuration/execute";
var address_ExitRuningMode_cancel_all="../configuration/cancel_all";
var address_ExitRuningMode_cancel_one="../configuration/cancel_one";
+var address_userrole="../configuration/user_role";
var timer_RunStatus;
var timer_Console;
@@ -37,8 +38,10 @@ function showtopdiv(){
$("#result_report_top").show("slow");
}
function mouse_on(){
- $("#result_report_top").show("slow");
- document.getElementById('result_report_top').style.display="block";
+ if(GetDataByAjax(address_userrole) == 2{
+ $("#result_report_top").show("slow");
+ document.getElementById('result_report_top').style.display="block";
+ }
}
function Cancel_delete(){
$("#result_report_top").hide("slow");
@@ -60,7 +63,7 @@ function RunStatus_Timer(){
}
else
{
- $("#div_Configuration_right_back_id").hide();
+ $("#div_Configuration_right_back_id").hide();
clearTimer(timer_RunStatus);
$("#div_top_status_id h1").text(line1);
$("#div_top_status_id .ceph_thr").text(line2);
@@ -75,7 +78,7 @@ function Console_Timer(init){
return
//(1) get the last timestamp
var timestamp = GetTimestamp();
-
+
//(2) request ajax
var data ;
if(timestamp!="" & typeof(timestamp) != "undefined" & timestamp != undefined)
@@ -85,17 +88,17 @@ function Console_Timer(init){
}else{
var consoleData = GetDataByAjax(address_Status);
}
-
+
if(consoleData.content == "")
- return
+ return
//create content html
var consoleHTML = "";
consoleHTML += "";
consoleHTML += consoleData.content;
consoleHTML += "
";
-
+
//insert html
- $("#div_console_id").append(consoleHTML);
+ $("#div_console_id").append(consoleHTML);
var scroll_position = 0
$("#div_console_id").children(".div_console_timestamp").each(function(){ scroll_position += $(this).height()});
$("#div_console_id").scrollTop( scroll_position );
@@ -188,7 +191,7 @@ function Report_Timer(init){
var reportSummaryData = GetDataByAjax(address_Report);
reportSummaryData = reportSummaryData.replace(/