<script type="text/javascript">
$(document).ready(function(){
......// 一些css和js资源加载
var allReportData = ${allData};
// 开始遍历第一层,如key为“ACDP”
for(var proName in allReportData) {
var testData;
var testLabels;
var analysisData;
var deployData;
var deployLabels;
for(var paramData in allReportData[proName]) {
// 开始遍历第二层,如key为“analysisReport”等
if (paramData == "testLabels") {
testLabels = allReportData[proName][paramData];
} else if (paramData == "analysisReport") {
analysisData = allReportData[proName][paramData];
} else if (paramData == "deployReport") {
deployData = allReportData[proName][paramData];
} else if (paramData == "deployLabels") {
deployLabels = allReportData[proName][paramData];
}
}
showiChart2D(proName+"c1","Code Analysis","Ok",analysisData);
showColumnStacked2D(proName+"c2","Test Result","Ok",testLabels,testData);
showArea2D(proName+"c3","Job Status","subtitle","footText",deployLabels,deployData);
}
}
</script>
传递给js的字符串如下,通过${allData}获取,其实就是Java bean转Json得到的Json字符串:
{
"ACDP": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"opment Build Testing",
" "
],
"deployReport": [
"3",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"8",
"8",
"8"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"2",
"2",
"2"
]
}
]
},
"AccelaConstructTest": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"Eng-API",
" "
],
"deployReport": [
"3",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"AccelaConstructmaster": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"API staging",
"API production"
],
"deployReport": [
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"AnalyticsiOS": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"nalytics-01-codescan",
" "
],
"deployReport": [
"1",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"ArchiveTest": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"Package test",
"Email_Test",
"IOS_Code_Scan",
"Code_Scan_Test",
"JUnitTest_Test",
"UI_Automation_Test",
"MonkeyTalk_test",
"IOS_Deploy_Test",
"Auto_JS_Test_Case",
"Email Test Pro"
],
"deployReport": [
"3",
"3",
"3",
"1",
"3",
"2",
"3",
"3",
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"2",
"2",
"2"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"20",
"20",
"20"
]
}
]
},
"BRE": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"BRE Unit Test",
"BRE Unit Test Pro"
],
"deployReport": [
"3",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"22",
"0",
"0"
]
}
]
},
"CivicData": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"oader_App_Dev_Deploy",
"er_App_Dev_NUnitTest",
"rtal_Site_Dev_Deploy",
"ata_Site_Pro_Monitor",
"cData_DB_Pro_Monitor",
"Portal_DB_Dev_Deploy",
"ivicData_UI_Pro_Test",
"nPortal_API_DEV_Test",
"Loader_App_QA_Deploy",
"Portal_Site_CodeScan",
"minPortal_UI_QA_Test",
"ivicData_API_QA_Test"
],
"deployReport": [
"3",
"1",
"3",
"3",
"3",
"3",
"3",
"1",
"3",
"3",
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"2",
"0",
"0"
]
}
]
},
"PermitsSolution": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"tion Development App",
"sAdmin_DB_Dev_Depoly",
"tion_Site_QA_UITests",
"SolutionAdmin_Build",
"ution_Site_QA_Deploy",
"tion_Site_Dev_Deploy",
"tion_Site_Pro_Deploy",
"dmin_Site_Pro_Deploy",
"sAdmin_DB_Pro_Deploy",
"hj1",
"testjj",
"one",
"ion_Site_QA_APITests",
"_Site_QA_JSUnitTests"
],
"deployReport": [
"3",
"1",
"1",
"3",
"3",
"2",
"3",
"2",
"2",
"1",
"1",
"1",
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"2",
"2",
"2"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"20",
"20",
"20"
]
}
]
},
"Productionsitemonitor": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"Monitor API",
"tor Developer Portal",
"Monitor Admin Portal",
"nitor Construct Auth",
"Monitor User Portal"
],
"deployReport": [
"3",
"3",
"3",
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"TestIgor": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"TestIgor1",
" "
],
"deployReport": [
"1",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"WorkCrewiOS": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"WorkCrew-01-codescan",
"WorkCrew-02-unittest",
"utomation-monkeytalk",
"WorkCrew-04-deploy"
],
"deployReport": [
"3",
"1",
"1",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"2",
"2",
"2"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"20",
"20",
"20"
]
}
]
},
"ankertest": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"gather",
"gather_android",
"android_code_scan",
"gather_test_test"
],
"deployReport": [
"1",
"1",
"3",
"1"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"gather": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"gather_build",
" "
],
"deployReport": [
"3",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
}
}
$(document).ready(function(){
......// 一些css和js资源加载
initDashboard();
var allReportData = ${allData};
// 开始遍历第一层,如key为“ACDP”
for(var proName in allReportData) {
var testData;
var testLabels;
var analysisData;
var deployData;
var deployLabels;
for(var paramData in allReportData[proName]) {
// 开始遍历第二层,如key为“analysisReport”等
if (paramData == "testLabels") {
testLabels = allReportData[proName][paramData];
} else if (paramData == "analysisReport") {
analysisData = allReportData[proName][paramData];
} else if (paramData == "deployReport") {
deployData = allReportData[proName][paramData];
} else if (paramData == "deployLabels") {
deployLabels = allReportData[proName][paramData];
}
}
showiChart2D(proName+"c1","Code Analysis","Ok",analysisData);
showColumnStacked2D(proName+"c2","Test Result","Ok",testLabels,testData);
showArea2D(proName+"c3","Job Status","subtitle","footText",deployLabels,deployData);
}
}
</script>
传递给js的字符串如下,通过${allData}获取,其实就是Java bean转Json得到的Json字符串:
{
"ACDP": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"opment Build Testing",
" "
],
"deployReport": [
"3",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"8",
"8",
"8"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"2",
"2",
"2"
]
}
]
},
"AccelaConstructTest": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"Eng-API",
" "
],
"deployReport": [
"3",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"AccelaConstructmaster": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"API staging",
"API production"
],
"deployReport": [
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"AnalyticsiOS": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"nalytics-01-codescan",
" "
],
"deployReport": [
"1",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"ArchiveTest": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"Package test",
"Email_Test",
"IOS_Code_Scan",
"Code_Scan_Test",
"JUnitTest_Test",
"UI_Automation_Test",
"MonkeyTalk_test",
"IOS_Deploy_Test",
"Auto_JS_Test_Case",
"Email Test Pro"
],
"deployReport": [
"3",
"3",
"3",
"1",
"3",
"2",
"3",
"3",
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"2",
"2",
"2"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"20",
"20",
"20"
]
}
]
},
"BRE": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"BRE Unit Test",
"BRE Unit Test Pro"
],
"deployReport": [
"3",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"22",
"0",
"0"
]
}
]
},
"CivicData": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"oader_App_Dev_Deploy",
"er_App_Dev_NUnitTest",
"rtal_Site_Dev_Deploy",
"ata_Site_Pro_Monitor",
"cData_DB_Pro_Monitor",
"Portal_DB_Dev_Deploy",
"ivicData_UI_Pro_Test",
"nPortal_API_DEV_Test",
"Loader_App_QA_Deploy",
"Portal_Site_CodeScan",
"minPortal_UI_QA_Test",
"ivicData_API_QA_Test"
],
"deployReport": [
"3",
"1",
"3",
"3",
"3",
"3",
"3",
"1",
"3",
"3",
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"2",
"0",
"0"
]
}
]
},
"PermitsSolution": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"tion Development App",
"sAdmin_DB_Dev_Depoly",
"tion_Site_QA_UITests",
"SolutionAdmin_Build",
"ution_Site_QA_Deploy",
"tion_Site_Dev_Deploy",
"tion_Site_Pro_Deploy",
"dmin_Site_Pro_Deploy",
"sAdmin_DB_Pro_Deploy",
"hj1",
"testjj",
"one",
"ion_Site_QA_APITests",
"_Site_QA_JSUnitTests"
],
"deployReport": [
"3",
"1",
"1",
"3",
"3",
"2",
"3",
"2",
"2",
"1",
"1",
"1",
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"2",
"2",
"2"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"20",
"20",
"20"
]
}
]
},
"Productionsitemonitor": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"Monitor API",
"tor Developer Portal",
"Monitor Admin Portal",
"nitor Construct Auth",
"Monitor User Portal"
],
"deployReport": [
"3",
"3",
"3",
"3",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"TestIgor": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"TestIgor1",
" "
],
"deployReport": [
"1",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"WorkCrewiOS": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"WorkCrew-01-codescan",
"WorkCrew-02-unittest",
"utomation-monkeytalk",
"WorkCrew-04-deploy"
],
"deployReport": [
"3",
"1",
"1",
"3"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"2",
"2",
"2"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"20",
"20",
"20"
]
}
]
},
"ankertest": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"gather",
"gather_android",
"android_code_scan",
"gather_test_test"
],
"deployReport": [
"1",
"1",
"3",
"1"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
},
"gather": {
"analysisReport": [
{
"color": "#aa4643",
"name": "High",
"value": 45
},
{
"color": "#89a54e",
"name": "Middle",
"value": 550
},
{
"color": "#4572a7",
"name": "Low",
"value": 30
}
],
"deployLabels": [
"gather_build",
" "
],
"deployReport": [
"3",
"2"
],
"testLabels": [
"UI Test",
"ISO Test",
"JS Test"
],
"testReport": [
{
"color": "#32bdbc",
"name": "success",
"value": [
"0",
"0",
"0"
]
},
{
"color": "#d75a5e",
"name": "failure",
"value": [
"0",
"0",
"0"
]
}
]
}
}

1914

被折叠的 条评论
为什么被折叠?



